Skip to content

Commit

Permalink
HV-1049 Ignoring annotations from "jdk.internal" package
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Jan 26, 2016
1 parent be6a126 commit f9522b3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.validation.GroupSequence;
import javax.validation.ParameterNameProvider;
import javax.validation.Valid;
Expand Down Expand Up @@ -564,6 +565,13 @@ private List<ConstraintDescriptorImpl<?>> findClassLevelConstraints(Class<?> bea
protected <A extends Annotation> List<ConstraintDescriptorImpl<?>> findConstraintAnnotations(Member member,
A annotation,
ElementType type) {
// HV-1049 Methods of java.lang.Object (and potentially other JDK classes) are annotated with annotations such
// as jdk.internal.HotSpotIntrinsicCandidate on JDK 9; They cannot be constraint annotation so skip them right
// here, as for the proper check we'd need package access permission for "jdk.internal"
if ( annotation.annotationType().getPackage().getName().equals( "jdk.internal" ) ) {
return Collections.emptyList();
}

List<ConstraintDescriptorImpl<?>> constraintDescriptors = newArrayList();

List<Annotation> constraints = newArrayList();
Expand Down

0 comments on commit f9522b3

Please sign in to comment.