Skip to content
Permalink
Browse files
remove unnecessary method
  • Loading branch information
mbenson committed Oct 16, 2018
1 parent 6fed619 commit 61709b499139ff6f85fad76c5bb362c3fc38afe1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
@@ -49,7 +49,6 @@

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 @@ private <A extends Annotation, T> A createConstraint(final ConstraintType constr
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()) {
@@ -310,15 +310,6 @@ private static Annotation[] getDeclaredConstraints(AnnotatedElement e) {
.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;

0 comments on commit 61709b4

Please sign in to comment.