incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1069133 - /incubator/bval/sandbox/lang3-work/bval-jsr303d/src/main/java/org/apache/bval/jsr303/dynamic/DynamicMetaGraphManagerImpl.java
Date Wed, 09 Feb 2011 21:58:54 GMT
Author: mbenson
Date: Wed Feb  9 21:58:53 2011
New Revision: 1069133

URL: http://svn.apache.org/viewvc?rev=1069133&view=rev
Log:
reuse full path object

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=1069133&r1=1069132&r2=1069133&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  9 21:58:53 2011
@@ -476,11 +476,11 @@ final class DynamicMetaGraphManagerImpl 
         Class<?> rawType = rootType;
         Type type = rawType;
         Object bean = rootBean;
+        PathImpl path = fullPath;
 
         while (true) {
-            PathImpl path = buildPath(nodes);
             result.add(Pair.<PathImpl, Class<?>> of(path, rawType));
-            if (path.isRootPath()) {
+            if (path.isRootPath() || nodes.isEmpty()) {
                 break;
             }
             // handle the property:
@@ -504,10 +504,8 @@ final class DynamicMetaGraphManagerImpl 
                 if (node.getName() != null) {
                     // substitute a name-only node and repeat the loop:
                     nodes.add(0, new NodeImpl(node.getName()));
-                    continue;
                 }
-            }
-            if (node.getName() != null) {
+            } else if (node.getName() != null) {
                 PropertyAccess access = new PropertyAccess(rawType, node.getName());
                 if (bean != null) {
                     bean = access.get(bean);
@@ -515,6 +513,7 @@ final class DynamicMetaGraphManagerImpl 
                 rawType = TypeUtils.getRawType(access.getJavaType(), type);
                 type = access.getJavaType();
             }
+            path = buildPath(nodes);
         }
         return result;
     }



Mime
View raw message