myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r960100 - in /myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage: AbstractApplicationScopeAwareStorageManager.java DefaultPropertyStorage.java
Date Fri, 02 Jul 2010 20:50:05 GMT
Author: gpetracek
Date: Fri Jul  2 20:50:05 2010
New Revision: 960100

URL: http://svn.apache.org/viewvc?rev=960100&view=rev
Log:
sync with branch

Modified:
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/AbstractApplicationScopeAwareStorageManager.java
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorage.java

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/AbstractApplicationScopeAwareStorageManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/AbstractApplicationScopeAwareStorageManager.java?rev=960100&r1=960099&r2=960100&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/AbstractApplicationScopeAwareStorageManager.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/AbstractApplicationScopeAwareStorageManager.java
Fri Jul  2 20:50:05 2010
@@ -23,7 +23,7 @@ import static org.apache.myfaces.extensi
 
 import javax.faces.context.FacesContext;
 import java.util.Map;
-import java.util.HashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * generic storage manager implementation which stores the storage implementations in the
application scope
@@ -39,10 +39,13 @@ public abstract class AbstractApplicatio
         Map applicationMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
         Map<String, T> storageMap;
 
-        if(!applicationMap.containsKey(getStorageManagerKey()))
+        synchronized (this)
         {
-            storageMap = new HashMap<String, T>();
-            applicationMap.put(getStorageManagerKey(), storageMap);
+            if(!applicationMap.containsKey(getStorageManagerKey()))
+            {
+                storageMap = new ConcurrentHashMap<String, T>();
+                applicationMap.put(getStorageManagerKey(), storageMap);
+            }
         }
 
         return (Map<String, T>)applicationMap.get(getStorageManagerKey());

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorage.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorage.java?rev=960100&r1=960099&r2=960100&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorage.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultPropertyStorage.java
Fri Jul  2 20:50:05 2010
@@ -71,22 +71,12 @@ public class DefaultPropertyStorage impl
     public Field getField(Class targetClass, String property)
     {
         Map<String, Field> fieldMap = getFieldMapForClass(targetClass);
-
-        if(fieldMap == null)
-        {
-            return null;
-        }
         return fieldMap.get(property);
     }
 
     public Method getMethod(Class targetClass, String property)
     {
         Map<String, Method> methodMap = getMethodMapForClass(targetClass);
-
-        if(methodMap == null)
-        {
-            return null;
-        }
         return methodMap.get(property);
     }
 



Mime
View raw message