bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject [29/50] bval git commit: remove redundant member
Date Tue, 16 Oct 2018 17:35:30 GMT
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/49c01740
Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/49c01740
Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/49c01740

Branch: refs/heads/master
Commit: 49c01740182303a90b1e27208f175a6a4a4b8b38
Parents: 00f3e45
Author: Matt Benson <mbenson@apache.org>
Authored: Fri Mar 30 12:33:40 2018 -0500
Committer: Matt Benson <mbenson@apache.org>
Committed: Tue Oct 16 12:28:20 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/49c01740/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) {


Mime
View raw message