From 536a373dea65667acef5c142f5ed4bc6dc6ea1e1 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Tue, 27 Dec 2005 16:07:24 +0000 Subject: [PATCH] add clear() git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@359225 13f79535-47bb-0310-9956-ffa450edef68 --- .../resources/BaseResourceCollectionContainer.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java b/src/main/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java index 0f3b666e5..9b14632d3 100755 --- a/src/main/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java +++ b/src/main/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java @@ -55,6 +55,20 @@ public abstract class BaseResourceCollectionContainer return cache; } + /** + * Clear the container. + * @throws BuildException on error. + */ + public synchronized void clear() throws BuildException { + if (isReference()) { + throw noChildrenAllowed(); + } + rc.clear(); + FailFast.invalidate(this); + coll = null; + setChecked(false); + } + /** * Add a ResourceCollection to the container. * @param c the ResourceCollection to add.