harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r1002506 - /harmony/enhanced/java/trunk/classlib/modules/security/src/main/java/common/java/security/Permissions.java
Date Wed, 29 Sep 2010 08:01:04 GMT
Author: regisxu
Date: Wed Sep 29 08:01:03 2010
New Revision: 1002506

URL: http://svn.apache.org/viewvc?rev=1002506&view=rev
Log:
Apply fix for HARMONY-6661: Synchonrize on mutable field in Permissions.java

readObject() is only reachable by one thread, so remove unnecessary
"synchronized" block.

Modified:
    harmony/enhanced/java/trunk/classlib/modules/security/src/main/java/common/java/security/Permissions.java

Modified: harmony/enhanced/java/trunk/classlib/modules/security/src/main/java/common/java/security/Permissions.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/security/src/main/java/common/java/security/Permissions.java?rev=1002506&r1=1002505&r2=1002506&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/security/src/main/java/common/java/security/Permissions.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/security/src/main/java/common/java/security/Permissions.java
Wed Sep 29 08:01:03 2010
@@ -214,16 +214,14 @@ public final class Permissions extends P
         ObjectInputStream.GetField fields = in.readFields();
         Map perms = (Map)fields.get("perms", null); //$NON-NLS-1$
         klasses = new HashMap();
-        synchronized (klasses) {
-            for (Iterator iter = perms.entrySet().iterator(); iter.hasNext();) {
-                Map.Entry entry = (Map.Entry)  iter.next();
-                Class key = (Class) entry.getKey();
-                PermissionCollection pc = (PermissionCollection) entry.getValue();
-                if (key != pc.elements().nextElement().getClass()) {
-                    throw new InvalidObjectException(Messages.getString("security.22"));
//$NON-NLS-1$
-                }
-                klasses.put(key, pc);
+        for (Iterator iter = perms.entrySet().iterator(); iter.hasNext();) {
+            Map.Entry entry = (Map.Entry)  iter.next();
+            Class key = (Class) entry.getKey();
+            PermissionCollection pc = (PermissionCollection) entry.getValue();
+            if (key != pc.elements().nextElement().getClass()) {
+                throw new InvalidObjectException(Messages.getString("security.22")); //$NON-NLS-1$
             }
+            klasses.put(key, pc);
         }
         allEnabled = fields.get("allPermission", null) != null; //$NON-NLS-1$
         if (allEnabled && !klasses.containsKey(AllPermission.class)) {



Mime
View raw message