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 2018/03/30 17:45:00 UTC

[2/5] bval git commit: remove redundant member

remove redundant member


Project: http://git-wip-us.apache.org/repos/asf/bval/repo
Commit: http://git-wip-us.apache.org/repos/asf/bval/commit/c45b174c
Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/c45b174c
Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/c45b174c

Branch: refs/heads/bv2
Commit: c45b174c4dc4d14aaae00661c0d148f0a9f90925
Parents: 99f0f96
Author: Matt Benson <mb...@apache.org>
Authored: Fri Mar 30 12:33:40 2018 -0500
Committer: Matt Benson <mb...@apache.org>
Committed: Fri Mar 30 12:33:40 2018 -0500

----------------------------------------------------------------------
 .../apache/bval/jsr/descriptor/PropertyD.java    | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bval/blob/c45b174c/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java b/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java
index 69a482e..4b1d5f9 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/PropertyD.java
@@ -45,19 +45,19 @@ public abstract class PropertyD<E extends AnnotatedElement> extends CascadableCo
 
         @Override
         public String getPropertyName() {
-            return host.getName();
+            return getTarget().getName();
         }
 
         @Override
         public Object getValue(Object parent) throws Exception {
-            final boolean mustUnset = Reflection.setAccessible(host, true);
+            final boolean mustUnset = Reflection.setAccessible(getTarget(), true);
             try {
-                return host.get(parent);
+                return getTarget().get(parent);
             } catch (IllegalAccessException e) {
                 throw new IllegalArgumentException(e);
             } finally {
                 if (mustUnset) {
-                    Reflection.setAccessible(host, false);
+                    Reflection.setAccessible(getTarget(), false);
                 }
             }
         }
@@ -71,29 +71,26 @@ public abstract class PropertyD<E extends AnnotatedElement> extends CascadableCo
 
         @Override
         public String getPropertyName() {
-            return Methods.propertyName(host);
+            return Methods.propertyName(getTarget());
         }
 
         @Override
         public Object getValue(Object parent) throws Exception {
-            final boolean mustUnset = Reflection.setAccessible(host, true);
+            final boolean mustUnset = Reflection.setAccessible(getTarget(), true);
             try {
-                return host.invoke(parent);
+                return getTarget().invoke(parent);
             } catch (IllegalAccessException | InvocationTargetException e) {
                 throw new IllegalArgumentException(e);
             } finally {
                 if (mustUnset) {
-                    Reflection.setAccessible(host, false);
+                    Reflection.setAccessible(getTarget(), false);
                 }
             }
         }
     }
 
-    protected final E host;
-
     protected PropertyD(MetadataReader.ForContainer<E> reader, BeanD<?> parent) {
         super(reader, parent);
-        this.host = reader.meta.getHost();
     }
 
     public final Stream<GraphContext> read(GraphContext context) {