myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r933690 - in /myfaces/extensions/validator/branches/branch_for_jsf_1_1: core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/ validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/valid...
Date Tue, 13 Apr 2010 15:56:32 GMT
Author: gpetracek
Date: Tue Apr 13 15:56:31 2010
New Revision: 933690

URL: http://svn.apache.org/viewvc?rev=933690&view=rev
Log:
EXTVAL-80 improve caching

Modified:
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.java
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.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/metadata/extractor/DefaultComponentMetaDataExtractor.java?rev=933690&r1=933689&r2=933690&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultComponentMetaDataExtractor.java
Tue Apr 13 15:56:31 2010
@@ -142,7 +142,7 @@ public class DefaultComponentMetaDataExt
         return getPropertyStorage().containsField(entity, property);
     }
 
-    private void tryToCachedField(Class entity, String property, Field field)
+    private void tryToCacheField(Class entity, String property, Field field)
     {
         PropertyStorage propertyStorage = getPropertyStorage();
         if (!propertyStorage.containsField(entity, property))
@@ -161,7 +161,7 @@ public class DefaultComponentMetaDataExt
         return getPropertyStorage().containsMethod(entity, property);
     }
 
-    private void tryToCachedMethod(Class entity, String property, Method method)
+    private void tryToCacheMethod(Class entity, String property, Method method)
     {
         PropertyStorage propertyStorage = getPropertyStorage();
         if (!propertyStorage.containsMethod(entity, property))
@@ -217,9 +217,13 @@ public class DefaultComponentMetaDataExt
 
         if (method != null)
         {
-            tryToCachedMethod(entity, property, method);
+            tryToCacheMethod(entity, property, method);
             addAnnotationToAnnotationEntries(Arrays.asList(method.getAnnotations()), propertyInformation);
         }
+        else
+        {
+            tryToCacheMethod(entity, property, null);
+        }
     }
 
     private Method tryToGetReadMethod(Class entity, String property)
@@ -322,9 +326,13 @@ public class DefaultComponentMetaDataExt
 
         if (field != null)
         {
-            tryToCachedField(entity, property, field);
+            tryToCacheField(entity, property, field);
             addAnnotationToAnnotationEntries(Arrays.asList(field.getAnnotations()), propertyInformation);
         }
+        else
+        {
+            tryToCacheField(entity, property, null);
+        }
     }
 
     private Field getDeclaredField(Class entity, String property) throws NoSuchFieldException

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java?rev=933690&r1=933689&r2=933690&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/ExtValBeanValidationContext.java
Tue Apr 13 15:56:31 2010
@@ -52,13 +52,13 @@ public class ExtValBeanValidationContext
 
     private static final String KEY = ExtValBeanValidationContext.class.getName() + ":KEY";
 
-    private MessageInterpolator defaultMessageInterpolator;
+    protected MessageInterpolator defaultMessageInterpolator;
 
-    private MessageResolver messageResolver;
+    protected MessageResolver messageResolver;
 
-    private GroupStorage groupStorage;
+    protected GroupStorage groupStorage;
 
-    private ModelValidationStorage modelValidationStorage;
+    protected ModelValidationStorage modelValidationStorage;
 
     protected ExtValBeanValidationContext()
     {
@@ -135,19 +135,19 @@ public class ExtValBeanValidationContext
         return this.modelValidationStorage.getModelValidationEntriesToValidate();
     }
 
-    private void initGroupStorage()
+    protected void initGroupStorage()
     {
         this.groupStorage = ExtValUtils
                 .getStorage(GroupStorage.class, BeanValidation.class.getName());
     }
 
-    private void initModelValidationStorage()
+    protected void initModelValidationStorage()
     {
         this.modelValidationStorage = ExtValUtils.
                 getStorage(ModelValidationStorage.class, ModelValidation.class.getName());
     }
 
-    private void initMessageInterpolator()
+    protected void initMessageInterpolator()
     {
         Object foundBean = ExtValUtils.getELHelper().getBean(MessageInterpolator.class.getName().replace(".",
"_"));
 
@@ -162,7 +162,7 @@ public class ExtValBeanValidationContext
         }
     }
 
-    private void initMessageResolver()
+    protected void initMessageResolver()
     {
         this.messageResolver = ExtValUtils.getMessageResolverForValidationStrategy(getBeanValidationStrategy());
     }



Mime
View raw message