diff --git a/CONTRIBUTORS b/CONTRIBUTORS index e7e35b303..8f24b6a7b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -67,8 +67,9 @@ Erik Hatcher Erik Langenbach Erik Meade Ernst de Haan -Frederic Lavigne Frank Somers +Frank Harnack +Frederic Lavigne Gary S. Weaver Gautam Guliani Gero Vermaas diff --git a/WHATSNEW b/WHATSNEW index fbb41b720..1e4b513c3 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -147,6 +147,9 @@ Fixed bugs: * was crashing with CVS versions >= 1.12.x due to change in the date format. Bugzilla report 30962. +* The same IntrospectionHelper instance was contineously added as a listener + to project. Bugzilla report 37184. + Other changes: -------------- * Fixed references to obsoleted CVS web site. Burzilla Report 36854. diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index 6de28ed91..c406e7b0e 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -327,6 +327,10 @@ public class Project { * Must not be null. */ public synchronized void addBuildListener(BuildListener listener) { + // If the listeners already has this listener, do nothing + if (listeners.contains(listener)) { + return; + } // create a new Vector to avoid ConcurrentModificationExc when // the listeners get added/removed while we are in fire Vector newListeners = getBuildListeners();