Skip to content

Commit

Permalink
HV-822 added one more test case. Rebased to master
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta authored and gsmet committed Nov 29, 2016
1 parent 3694cb4 commit 6669e2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Expand Up @@ -15,7 +15,7 @@
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;

import org.hibernate.validator.ap.checks.ConstraintCheckError;
import org.hibernate.validator.ap.checks.ConstraintCheckIssue;
import org.hibernate.validator.ap.util.AnnotationApiHelper;
import org.hibernate.validator.ap.util.CollectionHelper;

Expand All @@ -36,14 +36,14 @@ protected boolean canCheckThisAnnotation(AnnotationMirror annotation) {
}

@Override
protected Set<ConstraintCheckError> doCheck(Element element, AnnotationMirror annotation) {
protected Set<ConstraintCheckIssue> doCheck(Element element, AnnotationMirror annotation) {
List<? extends AnnotationValue> annotationValue = annotationApiHelper.getAnnotationArrayValue( annotation, "groups" );
Set<ConstraintCheckError> issues = CollectionHelper.newHashSet();
Set<ConstraintCheckIssue> issues = CollectionHelper.newHashSet();

for ( AnnotationValue value : annotationValue ) {
TypeMirror typeValue = (TypeMirror) value.getValue();
if ( !TypeKind.DECLARED.equals( typeValue.getKind() ) || !( (DeclaredType) typeValue ).asElement().getKind().isInterface() ) {
issues.add( new ConstraintCheckError(
issues.add( ConstraintCheckIssue.error(
element, annotation, "INVALID_GROUPS_VALUE_ANNOTATION_PARAMETERS"
) );
}
Expand Down
Expand Up @@ -144,4 +144,11 @@ public boolean isValid(String value, ConstraintValidatorContext context) {
}
}

public static class Case4 {

@Size(message = "Something is wrong. Really wrong.")
private String strin1;

}

}

0 comments on commit 6669e2e

Please sign in to comment.