From 7d8402eb2340f92ce04b61c3d55d3ba9eb743a1f Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Fri, 20 Oct 2006 22:40:27 +0000 Subject: [PATCH] Stop making IH a project listener, instead clean the IH cache explititly on build finished. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@466290 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/IntrospectionHelper.java | 65 +------------------ src/main/org/apache/tools/ant/Project.java | 2 + 2 files changed, 5 insertions(+), 62 deletions(-) diff --git a/src/main/org/apache/tools/ant/IntrospectionHelper.java b/src/main/org/apache/tools/ant/IntrospectionHelper.java index 55055d7f1..a0cf19365 100644 --- a/src/main/org/apache/tools/ant/IntrospectionHelper.java +++ b/src/main/org/apache/tools/ant/IntrospectionHelper.java @@ -38,7 +38,7 @@ import org.apache.tools.ant.taskdefs.PreSetDef; * elements. * The class is final as it has a private constructor. */ -public final class IntrospectionHelper implements BuildListener { +public final class IntrospectionHelper { /** * EMPTY_MAP was added in java 1.3 (EMPTY_SET and EMPTY_LIST @@ -342,10 +342,6 @@ public final class IntrospectionHelper implements BuildListener { HELPERS.put(c.getName(), ih); } } - if (p != null) { - // Cleanup at end of project - p.addBuildListener(ih); - } return ih; } @@ -1323,67 +1319,12 @@ public final class IntrospectionHelper implements BuildListener { } /** - * Clears all storage used by this class, including the static cache of - * helpers. - * - * @param event Ignored in this implementation. + * Clears the static cache of on build finished. */ - public void buildFinished(BuildEvent event) { - attributeTypes.clear(); - attributeSetters.clear(); - nestedTypes.clear(); - nestedCreators.clear(); - addText = null; + /*package private*/ static void clearCache() { HELPERS.clear(); } - /** - * Empty implementation to satisfy the BuildListener interface. - * @param event Ignored in this implementation. - */ - public void buildStarted(BuildEvent event) { - } - - /** - * Empty implementation to satisfy the BuildListener interface. - * - * @param event Ignored in this implementation. - */ - public void targetStarted(BuildEvent event) { - } - - /** - * Empty implementation to satisfy the BuildListener interface. - * - * @param event Ignored in this implementation. - */ - public void targetFinished(BuildEvent event) { - } - - /** - * Empty implementation to satisfy the BuildListener interface. - * - * @param event Ignored in this implementation. - */ - public void taskStarted(BuildEvent event) { - } - - /** - * Empty implementation to satisfy the BuildListener interface. - * - * @param event Ignored in this implementation. - */ - public void taskFinished(BuildEvent event) { - } - - /** - * Empty implementation to satisfy the BuildListener interface. - * - * @param event Ignored in this implementation. - */ - public void messageLogged(BuildEvent event) { - } - /** * */ diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index ace9e2956..c054d88c3 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -1958,6 +1958,8 @@ public class Project implements ResourceFactory { BuildListener listener = (BuildListener) iter.next(); listener.buildFinished(event); } + // Inform IH to clear the cache + IntrospectionHelper.clearCache(); } /**