You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bval.apache.org by mb...@apache.org on 2011/06/18 01:20:30 UTC

svn commit: r1137074 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java

Author: mbenson
Date: Fri Jun 17 23:20:30 2011
New Revision: 1137074

URL: http://svn.apache.org/viewvc?rev=1137074&view=rev
Log:
only resolve a dynamic metaBean after path navigation if there is no property, i.e. the bean is the tip of the context

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java?rev=1137074&r1=1137073&r2=1137074&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java (original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java Fri Jun 17 23:20:30 2011
@@ -192,10 +192,12 @@ public class ValidationContextTraversal 
     @Override
     protected void complete() {
         super.complete();
-        MetaBean metaBean = validationContext.getMetaBean();
-        if (metaBean instanceof DynamicMetaBean) {
-            Class<?> defaultType = validationContext.getMetaProperty() == null ? rawType : validationContext.getMetaProperty().getParentMetaBean().getBeanClass();
-            validationContext.setMetaBean(metaBean.resolveMetaBean(ObjectUtils.defaultIfNull(validationContext.getBean(), defaultType)));
+        if (validationContext.getMetaProperty() != null) {
+            return;
+        }
+        if (validationContext.getMetaBean() instanceof DynamicMetaBean) {
+            validationContext.setMetaBean(validationContext.getMetaBean().resolveMetaBean(
+                ObjectUtils.defaultIfNull(validationContext.getBean(), rawType)));
         }
     }
 }
\ No newline at end of file