Skip to content
Permalink
Browse files
ignore group conversions without cascade on property getters
  • Loading branch information
mbenson committed Oct 16, 2018
1 parent 99c0079 commit cc8a72c72011ae51cedd99e1a61b273aa506ec43
Showing 1 changed file with 5 additions and 0 deletions.
@@ -19,6 +19,7 @@
package org.apache.bval.jsr.descriptor;

import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.AnnotatedType;
import java.lang.reflect.Constructor;
@@ -293,6 +294,10 @@ Set<GroupConversion> getGroupConversions() {
final Set<GroupConversion> groupConversions = builder.getGroupConversions(meta);
if (!groupConversions.isEmpty()) {
if (!isCascaded()) {
// ignore group conversions without cascade on property getters:
if (meta.getElementType() == ElementType.METHOD && Methods.isGetter((Method) meta.getHost())) {
return Collections.emptySet();
}
Exceptions.raise(ConstraintDeclarationException::new, "@%s declared without @%s on %s",
ConvertGroup.class.getSimpleName(), Valid.class.getSimpleName(), meta.describeHost());
}

0 comments on commit cc8a72c

Please sign in to comment.