incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1066679 - /incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/jsr303/dynamic/DynamicMetaGraphManagerImpl.java
Date Wed, 02 Feb 2011 23:03:36 GMT
Author: mbenson
Date: Wed Feb  2 23:03:36 2011
New Revision: 1066679

URL: http://svn.apache.org/viewvc?rev=1066679&view=rev
Log:
avoid MetaBeanFinder call if possible

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/jsr303/dynamic/DynamicMetaGraphManagerImpl.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/jsr303/dynamic/DynamicMetaGraphManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/jsr303/dynamic/DynamicMetaGraphManagerImpl.java?rev=1066679&r1=1066678&r2=1066679&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/jsr303/dynamic/DynamicMetaGraphManagerImpl.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/jsr303/dynamic/DynamicMetaGraphManagerImpl.java
Wed Feb  2 23:03:36 2011
@@ -219,20 +219,21 @@ final class DynamicMetaGraphManagerImpl 
          * {@inheritDoc}
          */
         public MetaBean getMetaBean(Class<?> type) {
-            final MetaBean initial = metaBeanFinder.findForClass(type);
-
+            final MetaBean initial;
             final PathImpl path;
             final Object rootBean;
             final MetaBean rootMetaBean;
 
             DynamicValidationState validationState = currentValidationState.get();
             if (validationState == null) {
+                initial = metaBeanFinder.findForClass(type);
                 path = PathImpl.create(null);
                 rootBean = null;
                 rootMetaBean = initial;
             } else {
                 rootMetaBean = validationState.getRootMetaBean();
                 path = validationState.getPropertyPath();
+                initial = path.isRootPath() ? rootMetaBean : metaBeanFinder.findForClass(type);
                 rootBean = validationState.getRootBean();
             }
             try {



Mime
View raw message