incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1137074 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java
Date Fri, 17 Jun 2011 23:20:30 GMT
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



Mime
View raw message