ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21346] New: - Minor Project.listeners opt - avoid cloning
Date Fri, 04 Jul 2003 16:46:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21346>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21346

Minor Project.listeners opt - avoid cloning

           Summary: Minor Project.listeners opt - avoid cloning
           Product: Ant
           Version: 1.6Alpha (nightly)
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: jesse.glick@netbeans.com


Mentioned in bug #21296. Currently Project clones its listener list every time
it fires something to a BuildListener - which can happen quite a lot, especially
in an incremental build where no-op messages are flashing by.

This small patch should avoid any cloning except when getBuildListeners is
called - currently only done by the <ant> task. Should be safe even in the
presence of <parallel>, I think.

Note that listeners are notified within the scope of the synch block, so they
may not e.g. call add/removeBuildListener themselves, or block on some other
thread which might do so; not sure if this could be considered a problem or not.
To avoid that possibility, you would need to clone (or use toArray).

Anyway, the patch is just for evaluation purposes.

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


Mime
View raw message