ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java
Date Wed, 05 Jun 2002 07:14:11 GMT
conor       2002/06/05 00:14:10

  Modified:    src/main/org/apache/tools/ant Tag: ANT_15_BRANCH
                        Project.java
  Log:
  Project's own use of the listener list could miss notifying
  some listeners if a listener is removed during the traversal.
  PR:	9609
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.108.2.4 +8 -1      jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.108.2.3
  retrieving revision 1.108.2.4
  diff -u -w -u -r1.108.2.3 -r1.108.2.4
  --- Project.java	5 Jun 2002 06:37:57 -0000	1.108.2.3
  +++ Project.java	5 Jun 2002 07:14:09 -0000	1.108.2.4
  @@ -83,7 +83,7 @@
    *
    * @author duncan@x180.com
    *
  - * @version $Revision: 1.108.2.3 $
  + * @version $Revision: 1.108.2.4 $
    */
   
   public class Project {
  @@ -1756,6 +1756,7 @@
        */
       public void fireBuildStarted() {
           BuildEvent event = new BuildEvent(this);
  +        Vector listeners = getBuildListeners();
           for (int i = 0; i < listeners.size(); i++) {
               BuildListener listener = (BuildListener) listeners.elementAt(i);
               listener.buildStarted(event);
  @@ -1771,6 +1772,7 @@
       public void fireBuildFinished(Throwable exception) {
           BuildEvent event = new BuildEvent(this);
           event.setException(exception);
  +        Vector listeners = getBuildListeners();
           for (int i = 0; i < listeners.size(); i++) {
               BuildListener listener = (BuildListener) listeners.elementAt(i);
               listener.buildFinished(event);
  @@ -1786,6 +1788,7 @@
        */
       protected void fireTargetStarted(Target target) {
           BuildEvent event = new BuildEvent(target);
  +        Vector listeners = getBuildListeners();
           for (int i = 0; i < listeners.size(); i++) {
               BuildListener listener = (BuildListener) listeners.elementAt(i);
               listener.targetStarted(event);
  @@ -1805,6 +1808,7 @@
       protected void fireTargetFinished(Target target, Throwable exception) {
           BuildEvent event = new BuildEvent(target);
           event.setException(exception);
  +        Vector listeners = getBuildListeners();
           for (int i = 0; i < listeners.size(); i++) {
               BuildListener listener = (BuildListener) listeners.elementAt(i);
               listener.targetFinished(event);
  @@ -1821,6 +1825,7 @@
           // register this as the current task on the current thread.
           registerThreadTask(Thread.currentThread(), task);
           BuildEvent event = new BuildEvent(task);
  +        Vector listeners = getBuildListeners();
           for (int i = 0; i < listeners.size(); i++) {
               BuildListener listener = (BuildListener) listeners.elementAt(i);
               listener.taskStarted(event);
  @@ -1843,6 +1848,7 @@
           System.err.flush();
           BuildEvent event = new BuildEvent(task);
           event.setException(exception);
  +        Vector listeners = getBuildListeners();
           for (int i = 0; i < listeners.size(); i++) {
               BuildListener listener = (BuildListener) listeners.elementAt(i);
               listener.taskFinished(event);
  @@ -1862,6 +1868,7 @@
       private void fireMessageLoggedEvent(BuildEvent event, String message,
                                           int priority) {
           event.setMessage(message, priority);
  +        Vector listeners = getBuildListeners();
           for (int i = 0; i < listeners.size(); i++) {
               BuildListener listener = (BuildListener) listeners.elementAt(i);
               listener.messageLogged(event);
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message