incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1137068 - /incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/provider/src/main/java/org/apache/bval/jsr303/dynamic/NestedValidator.java
Date Fri, 17 Jun 2011 23:16:43 GMT
Author: mbenson
Date: Fri Jun 17 23:16:43 2011
New Revision: 1137068

URL: http://svn.apache.org/viewvc?rev=1137068&view=rev
Log:
if we're just always going to use a Dynamic version of the root MetaBean, just store it that
way and reuse

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=1137068&r1=1137067&r2=1137068&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
Fri Jun 17 23:16:43 2011
@@ -46,7 +46,7 @@ import org.apache.commons.lang3.Validate
  */
 @SuppressWarnings({ "rawtypes", "unchecked" })
 public class NestedValidator extends DynamicClassValidator {
-    private final MetaBean rootBean;
+    private final DynamicMetaBean rootBean;
     private final String path;
 
     /**
@@ -63,7 +63,8 @@ public class NestedValidator extends Dyn
         super(context);
         Validate.notNull(context, "context");
         Validate.notNull(rootType, "rootType");
-        this.rootBean = getMetaBeanFinder().findForClass(rootType);
+        this.rootBean = new DynamicMetaBean(getMetaBeanFinder());
+        this.rootBean.setBeanClass(rootType);
         this.path = path;
     }
 
@@ -99,7 +100,9 @@ public class NestedValidator extends Dyn
                 if (prop != null) {
                     if (prop.getMetaBean() == null) {
                         // should we do this here, or is there a better place?
-                        prop.setMetaBean(new DynamicMetaBean(getMetaBeanFinder()));
+                        DynamicMetaBean propertyMetaBean = new DynamicMetaBean(getMetaBeanFinder());
+                        propertyMetaBean.setBeanClass(prop.getTypeClass());
+                        prop.setMetaBean(propertyMetaBean);
                     }
                     result.moveDown(prop, new AccessStrategy() {
 



Mime
View raw message