ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r669416 - /ant/core/trunk/src/main/org/apache/tools/ant/Project.java
Date Thu, 19 Jun 2008 08:09:39 GMT
Author: bodewig
Date: Thu Jun 19 01:09:39 2008
New Revision: 669416

URL: http://svn.apache.org/viewvc?rev=669416&view=rev
Log:
remove synchronization in addReference since getReferences hands out an un-synchronized table
anyway

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/Project.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Project.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Project.java?rev=669416&r1=669415&r2=669416&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Project.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Project.java Thu Jun 19 01:09:39 2008
@@ -1904,19 +1904,17 @@
      * @param value The value of the reference.
      */
     public void addReference(String referenceName, Object value) {
-        synchronized (references) {
-            Object old = ((AntRefTable) references).getReal(referenceName);
-            if (old == value) {
-                // no warning, this is not changing anything
-                return;
-            }
-            if (old != null && !(old instanceof UnknownElement)) {
-                log("Overriding previous definition of reference to " + referenceName,
-                    MSG_VERBOSE);
-            }
-            log("Adding reference: " + referenceName, MSG_DEBUG);
-            references.put(referenceName, value);
+        Object old = ((AntRefTable) references).getReal(referenceName);
+        if (old == value) {
+            // no warning, this is not changing anything
+            return;
+        }
+        if (old != null && !(old instanceof UnknownElement)) {
+            log("Overriding previous definition of reference to " + referenceName,
+                MSG_VERBOSE);
         }
+        log("Adding reference: " + referenceName, MSG_DEBUG);
+        references.put(referenceName, value);
     }
 
     /**



Mime
View raw message