bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject [37/50] bval git commit: remove unnecessary method
Date Tue, 16 Oct 2018 17:31:41 GMT
remove unnecessary method


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

Branch: refs/heads/bv2
Commit: 61709b499139ff6f85fad76c5bb362c3fc38afe1
Parents: 6fed619
Author: Matt Benson <mbenson@apache.org>
Authored: Wed Apr 4 11:43:15 2018 -0500
Committer: Matt Benson <mbenson@apache.org>
Committed: Tue Oct 16 12:28:20 2018 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/bval/jsr/metadata/XmlBuilder.java  | 4 +---
 .../java/org/apache/bval/jsr/util/AnnotationsManager.java   | 9 ---------
 2 files changed, 1 insertion(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bval/blob/61709b49/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/XmlBuilder.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/XmlBuilder.java b/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/XmlBuilder.java
index 0cfdb6c..b68457a 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/XmlBuilder.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/XmlBuilder.java
@@ -49,7 +49,6 @@ import javax.xml.bind.JAXBElement;
 
 import org.apache.bval.jsr.ConstraintAnnotationAttributes;
 import org.apache.bval.jsr.groups.GroupConversion;
-import org.apache.bval.jsr.util.AnnotationsManager;
 import org.apache.bval.jsr.util.ToUnmodifiable;
 import org.apache.bval.jsr.xml.AnnotationProxyBuilder;
 import org.apache.bval.jsr.xml.AnnotationType;
@@ -549,8 +548,7 @@ public class XmlBuilder {
         annoBuilder.setGroups(getGroups(constraint.getGroups()));
         annoBuilder.setPayload(getPayload(constraint.getPayload()));
 
-        if (AnnotationsManager.declaresAttribute(annotationClass,
-            ConstraintAnnotationAttributes.VALIDATION_APPLIES_TO.getAttributeName())) {
+        if (ConstraintAnnotationAttributes.VALIDATION_APPLIES_TO.analyze(annotationClass).isValid())
{
             annoBuilder.setValidationAppliesTo(target);
         }
         for (final ElementType elementType : constraint.getElement()) {

http://git-wip-us.apache.org/repos/asf/bval/blob/61709b49/bval-jsr/src/main/java/org/apache/bval/jsr/util/AnnotationsManager.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/util/AnnotationsManager.java b/bval-jsr/src/main/java/org/apache/bval/jsr/util/AnnotationsManager.java
index f0aa3a8..1995c52 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/util/AnnotationsManager.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/util/AnnotationsManager.java
@@ -310,15 +310,6 @@ public class AnnotationsManager {
             .toArray(Annotation[]::new);
     }
 
-    public static boolean declaresAttribute(Class<? extends Annotation> annotationType,
String name) {
-        try {
-            annotationType.getDeclaredMethod(name);
-            return true;
-        } catch (NoSuchMethodException | SecurityException e) {
-            return false;
-        }
-    }
-
     private final ApacheValidatorFactory validatorFactory;
     private final LRUCache<Class<? extends Annotation>, Composition> compositions;
 


Mime
View raw message