incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1138580 - /incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/provider/src/main/java/org/apache/bval/jsr303/dynamic/NestedValidator.java
Date Wed, 22 Jun 2011 18:50:04 GMT
Author: mbenson
Date: Wed Jun 22 18:50:04 2011
New Revision: 1138580

URL: http://svn.apache.org/viewvc?rev=1138580&view=rev
Log:
use every available means to find the real value

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

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/provider/src/main/java/org/apache/bval/jsr303/dynamic/NestedValidator.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/provider/src/main/java/org/apache/bval/jsr303/dynamic/NestedValidator.java?rev=1138580&r1=1138579&r2=1138580&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/provider/src/main/java/org/apache/bval/jsr303/dynamic/NestedValidator.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/provider/src/main/java/org/apache/bval/jsr303/dynamic/NestedValidator.java
Wed Jun 22 18:50:04 2011
@@ -32,7 +32,7 @@ import org.apache.bval.jsr303.util.PathN
 import org.apache.bval.jsr303.util.ValidationContextTraversal;
 import org.apache.bval.model.MetaBean;
 import org.apache.bval.model.MetaProperty;
-import org.apache.bval.util.AccessStrategy;
+import org.apache.bval.util.PropertyAccess;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.Validate;
@@ -192,7 +192,7 @@ public class NestedValidator extends Dyn
                         propertyMetaBean.setBeanClass(prop.getTypeClass());
                         prop.setMetaBean(propertyMetaBean);
                     }
-                    result.moveDown(prop, new AccessStrategy() {
+                    result.moveDown(prop, new PropertyAccess(prop.getParentMetaBean().getBeanClass(),
prop.getName()) {
 
                         @Override
                         public String getPropertyName() {
@@ -206,12 +206,15 @@ public class NestedValidator extends Dyn
 
                         @Override
                         public ElementType getElementType() {
-                            return ElementType.LOCAL_VARIABLE;
+                            return object == null ? super.getElementType() : ElementType.LOCAL_VARIABLE;
                         }
 
                         @Override
-                        public Object get(Object arg0) {
-                            return object;
+                        public Object get(Object bean) {
+                            if (object != null) {
+                                return object;
+                            }
+                            return bean == null ? null : super.get(bean);
                         }
                     });
                 } else {



Mime
View raw message