db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1348316 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
Date Sat, 09 Jun 2012 03:45:16 GMT
Author: tfischer
Date: Sat Jun  9 03:45:15 2012
New Revision: 1348316

URL: http://svn.apache.org/viewvc?rev=1348316&view=rev
Log:
fix synchronization issue found by findbugs

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java?rev=1348316&r1=1348315&r2=1348316&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
Sat Jun  9 03:45:15 2012
@@ -626,7 +626,7 @@ public class TorqueInstance
      * @throws TorqueException Any exceptions caught during processing will be
      *         rethrown wrapped into a TorqueException.
      */
-    protected void initManagerMappings(Configuration conf)
+    protected synchronized void initManagerMappings(Configuration conf)
             throws TorqueException
     {
         int pref = Torque.MANAGER_PREFIX.length();
@@ -828,18 +828,15 @@ public class TorqueInstance
         }
 
         // shut down the cache managers
-        synchronized (managers)
+        for (Iterator<Map.Entry<String, AbstractBaseManager<?>>> it
+                = managers.entrySet().iterator(); it.hasNext();)
         {
-            for (Iterator<Map.Entry<String, AbstractBaseManager<?>>> it
-                    = managers.entrySet().iterator(); it.hasNext();)
-            {
-                Map.Entry<String, AbstractBaseManager<?>> mentry
-                        = it.next();
+            Map.Entry<String, AbstractBaseManager<?>> mentry
+                    = it.next();
 
-                AbstractBaseManager<?> manager = mentry.getValue();
-                manager.dispose();
-                it.remove();
-            }
+            AbstractBaseManager<?> manager = mentry.getValue();
+            manager.dispose();
+            it.remove();
         }
 
         // shut down the data source factories



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


Mime
View raw message