You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/07/04 18:46:49 UTC
DO NOT REPLY [Bug 21346] New: -
Minor Project.listeners opt - avoid cloning
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