commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1240646 - /commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
Date Sat, 04 Feb 2012 23:58:15 GMT
Author: simonetripodi
Date: Sat Feb  4 23:58:13 2012
New Revision: 1240646

URL: http://svn.apache.org/viewvc?rev=1240646&view=rev
Log:
this class is a singleton, methods registry is a singleton, no needs to have the methods registry
as a class member

Modified:
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java?rev=1240646&r1=1240645&r2=1240646&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
Sat Feb  4 23:58:13 2012
@@ -40,8 +40,6 @@ import java.util.concurrent.locks.Reentr
 final class PropertyDescriptorsRegistry
 {
 
-    private static final AccessibleObjectsRegistry<Method> METHODS_REGISTRY = AccessibleObjectsRegistry.getMethodsRegistry();
-
     private static final PropertyDescriptorsRegistry INSTANCE = new PropertyDescriptorsRegistry();
 
     public static PropertyDescriptorsRegistry getInstance()
@@ -49,6 +47,8 @@ final class PropertyDescriptorsRegistry
         return INSTANCE;
     }
 
+    private final AccessibleObjectsRegistry<Method> methodsRegistry = AccessibleObjectsRegistry.getMethodsRegistry();
+
     private final ReadWriteLock lock = new ReentrantReadWriteLock();
 
     private final Map<Class<?>, WeakReference<Map<String, PropertyDescriptor>>>
cache =
@@ -103,7 +103,7 @@ final class PropertyDescriptorsRegistry
         }
     }
 
-    private static void makeMethodsAccessible( Class<?> beanType, PropertyDescriptor
propertyDescriptor )
+    private void makeMethodsAccessible( Class<?> beanType, PropertyDescriptor propertyDescriptor
)
         throws IntrospectionException
     {
         // we need to make sure that methods are accessible for anonymous types
@@ -111,13 +111,13 @@ final class PropertyDescriptorsRegistry
         if ( propertyDescriptor.getReadMethod() != null )
         {
             Method readMethod = propertyDescriptor.getReadMethod();
-            readMethod = METHODS_REGISTRY.get( true, beanType, readMethod.getName() );
+            readMethod = methodsRegistry.get( true, beanType, readMethod.getName() );
             propertyDescriptor.setReadMethod( readMethod );
         }
         if ( propertyDescriptor.getWriteMethod() != null )
         {
             Method writeMethod = propertyDescriptor.getWriteMethod();
-            writeMethod = METHODS_REGISTRY.get( true, beanType, writeMethod.getName(), writeMethod.getParameterTypes()
);
+            writeMethod = methodsRegistry.get( true, beanType, writeMethod.getName(), writeMethod.getParameterTypes()
);
             propertyDescriptor.setWriteMethod( writeMethod );
         }
     }



Mime
View raw message