Browse Source

bugzilla 37184: multiple calls to addlistener for introspection helper objects

reporter:  Frank Harnack


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@328081 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
642fd3b8ce
3 changed files with 9 additions and 1 deletions
  1. +2
    -1
      CONTRIBUTORS
  2. +3
    -0
      WHATSNEW
  3. +4
    -0
      src/main/org/apache/tools/ant/Project.java

+ 2
- 1
CONTRIBUTORS View File

@@ -67,8 +67,9 @@ Erik Hatcher
Erik Langenbach Erik Langenbach
Erik Meade Erik Meade
Ernst de Haan Ernst de Haan
Frederic Lavigne
Frank Somers Frank Somers
Frank Harnack
Frederic Lavigne
Gary S. Weaver Gary S. Weaver
Gautam Guliani Gautam Guliani
Gero Vermaas Gero Vermaas


+ 3
- 0
WHATSNEW View File

@@ -147,6 +147,9 @@ Fixed bugs:
* <cvschangelog> was crashing with CVS versions >= 1.12.x due to change in * <cvschangelog> was crashing with CVS versions >= 1.12.x due to change in
the date format. Bugzilla report 30962. the date format. Bugzilla report 30962.


* The same IntrospectionHelper instance was contineously added as a listener
to project. Bugzilla report 37184.

Other changes: Other changes:
-------------- --------------
* Fixed references to obsoleted CVS web site. Burzilla Report 36854. * Fixed references to obsoleted CVS web site. Burzilla Report 36854.


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

@@ -327,6 +327,10 @@ public class Project {
* Must not be <code>null</code>. * Must not be <code>null</code>.
*/ */
public synchronized void addBuildListener(BuildListener listener) { 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 // create a new Vector to avoid ConcurrentModificationExc when
// the listeners get added/removed while we are in fire // the listeners get added/removed while we are in fire
Vector newListeners = getBuildListeners(); Vector newListeners = getBuildListeners();


Loading…
Cancel
Save