Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 38296 invoked from network); 29 Mar 2005 21:46:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Mar 2005 21:46:41 -0000 Received: (qmail 90451 invoked by uid 500); 29 Mar 2005 21:46:39 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 90365 invoked by uid 500); 29 Mar 2005 21:46:38 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 90338 invoked by uid 500); 29 Mar 2005 21:46:38 -0000 Received: (qmail 90322 invoked by uid 99); 29 Mar 2005 21:46:38 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 29 Mar 2005 13:46:37 -0800 Received: (qmail 38209 invoked by uid 1939); 29 Mar 2005 21:46:36 -0000 Date: 29 Mar 2005 21:46:36 -0000 Message-ID: <20050329214636.38208.qmail@minotaur.apache.org> From: jglick@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant Project.java X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N jglick 2005/03/29 13:46:36 Modified: src/main/org/apache/tools/ant Project.java Log: Avoid hypothetical memory leak by not holding a strong reference to the thread or thread groups used as keys to report task associations. Revision Changes Path 1.190 +7 -4 ant/src/main/org/apache/tools/ant/Project.java Index: Project.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v retrieving revision 1.189 retrieving revision 1.190 diff -u -r1.189 -r1.190 --- Project.java 29 Mar 2005 19:56:15 -0000 1.189 +++ Project.java 29 Mar 2005 21:46:36 -0000 1.190 @@ -23,6 +23,7 @@ import java.io.InputStream; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.util.Collections; import java.util.Enumeration; import java.util.Hashtable; import java.util.Iterator; @@ -31,6 +32,8 @@ import java.util.Vector; import java.util.Set; import java.util.HashSet; +import java.util.Map; +import java.util.WeakHashMap; import org.apache.tools.ant.input.DefaultInputHandler; import org.apache.tools.ant.input.InputHandler; import org.apache.tools.ant.helper.DefaultExecutor; @@ -157,11 +160,11 @@ */ private ClassLoader coreLoader = null; - /** Records the latest task to be executed on a thread (Thread to Task). */ - private Hashtable threadTasks = new Hashtable(); + /** Records the latest task to be executed on a thread. */ + private Map/**/ threadTasks = Collections.synchronizedMap(new WeakHashMap()); - /** Records the latest task to be executed on a thread Group. */ - private Hashtable threadGroupTasks = new Hashtable(); + /** Records the latest task to be executed on a thread group. */ + private Map/**/ threadGroupTasks = Collections.synchronizedMap(new WeakHashMap()); /** * Called to handle any input requests. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org