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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to