harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r556788 - in /harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans: Beans.java Introspector.java PropertyEditorManager.java
Date Tue, 17 Jul 2007 01:26:30 GMT
Author: tonywu
Date: Mon Jul 16 18:26:29 2007
New Revision: 556788

URL: http://svn.apache.org/viewvc?view=rev&rev=556788
Log:
optimize for multi-threads

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java?view=diff&rev=556788&r1=556787&r2=556788
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java Mon
Jul 16 18:26:29 2007
@@ -116,10 +116,12 @@
         guiAvailable = isGuiAvailable;
     }
 
-    public static synchronized void setDesignTime(boolean isDesignTime)
+    public static void setDesignTime(boolean isDesignTime)
             throws SecurityException {
         checkPropertiesAccess();
-        designTime = isDesignTime;
+        synchronized(Beans.class){
+            designTime = isDesignTime;
+        }
     }
 
     public static synchronized boolean isGuiAvailable() {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java?view=diff&rev=556788&r1=556787&r2=556788
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
Mon Jul 16 18:26:29 2007
@@ -83,14 +83,15 @@
         return getBeanInfo(beanClass, stopClass, false, false);
     }
 
-    public static synchronized void setBeanInfoSearchPath(String[] searchPath) {
+    public static void setBeanInfoSearchPath(String[] searchPath) {
         SecurityManager sm = System.getSecurityManager();
 
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        
-        path = searchPath;
+        synchronized(Introspector.class) {
+            path = searchPath;
+        }
     }
 
     public static synchronized String[] getBeanInfoSearchPath() {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java?view=diff&rev=556788&r1=556787&r2=556788
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java
Mon Jul 16 18:26:29 2007
@@ -99,7 +99,7 @@
         return editor;
     }
 
-    public static synchronized void setEditorSearchPath(String[] apath) {
+    public static void setEditorSearchPath(String[] apath) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             sm.checkPropertiesAccess();
@@ -107,7 +107,9 @@
         if(apath == null){
             apath = new String[0];
         }
-        path = apath;
+        synchronized(PropertyEditorManager.class){
+            path = apath;
+        }
     }
 
     public static synchronized String[] getEditorSearchPath() {



Mime
View raw message