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/02/17 18:46:50 UTC

svn commit: r1071724 - /incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/IntrospectorMetaBeanFactory.java

Author: mbenson
Date: Thu Feb 17 17:46:49 2011
New Revision: 1071724

URL: http://svn.apache.org/viewvc?rev=1071724&view=rev
Log:
pass existing MetaProperty to buildMetaProperty in case an overriding subclass wants to implement a noop on a particular property; this means that IntrospectorMetaBeanFactory won't just blow away MetaProperties that might theoretically have been introduced by a MetaBeanFactory that has already run, which is even more important in the context of subclasses because they obviously can't all run first.  :P

Modified:
    incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/IntrospectorMetaBeanFactory.java

Modified: incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/IntrospectorMetaBeanFactory.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/IntrospectorMetaBeanFactory.java?rev=1071724&r1=1071723&r2=1071724&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/IntrospectorMetaBeanFactory.java (original)
+++ incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/IntrospectorMetaBeanFactory.java Thu Feb 17 17:46:49 2011
@@ -49,7 +49,7 @@ public final class IntrospectorMetaBeanF
         }
         for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
             if (!(pd instanceof IndexedPropertyDescriptor || pd.getName().equals("class"))) {
-                MetaProperty metaProp = buildMetaProperty(pd);
+                MetaProperty metaProp = buildMetaProperty(pd, meta.getProperty(pd.getName()));
                 meta.putProperty(pd.getName(), metaProp);
             }
         }
@@ -61,7 +61,19 @@ public final class IntrospectorMetaBeanF
      * @param pd
      * @return MetaProperty
      */
+    @Deprecated
     protected MetaProperty buildMetaProperty(PropertyDescriptor pd) {
+        return buildMetaProperty(pd, null);
+    }
+
+    /**
+     * Create a {@link MetaProperty} from the specified {@link PropertyDescriptor}.
+     * 
+     * @param pd
+     * @param existing
+     * @return MetaProperty
+     */
+    protected MetaProperty buildMetaProperty(PropertyDescriptor pd, MetaProperty existing) {
         MetaProperty meta = new MetaProperty();
         meta.setName(pd.getName());
         meta.setType(determineGenericPropertyType(pd));