Browse Source

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
master
Peter Reilly 18 years ago
parent
commit
7d8402eb23
2 changed files with 5 additions and 62 deletions
  1. +3
    -62
      src/main/org/apache/tools/ant/IntrospectionHelper.java
  2. +2
    -0
      src/main/org/apache/tools/ant/Project.java

+ 3
- 62
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -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) {
}

/**
*
*/


+ 2
- 0
src/main/org/apache/tools/ant/Project.java View File

@@ -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();
}

/**


Loading…
Cancel
Save