It leads to the following exception with JDK 9: {code} java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.jdk.internal.vm.annotation") at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:471) at java.base/java.security.AccessController.checkPermission(AccessController.java:894) at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:560) at java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1541) at java.base/java.lang.Class.checkPackageAccess(Class.java:2800) at java.base/java.lang.Class.checkMemberAccess(Class.java:2781) at java.base/java.lang.Class.getMethod(Class.java:2056) at org.hibernate.validator.internal.util.privilegedactions.GetMethod.run(GetMethod.java:33) at org.hibernate.validator.internal.util.privilegedactions.GetMethod.run(GetMethod.java:17) at java.base/java.security.AccessController.doPrivileged(Native Method) at org.hibernate.validator.internal.metadata.core.ConstraintHelper.run(ConstraintHelper.java:698) at org.hibernate.validator.internal.metadata.core.ConstraintHelper.isMultiValueConstraint(ConstraintHelper.java:480) {code}
It's typically the case with {{jdk.internal.vm.annotation.Stable}} as we only ignore annotations which have a package name of {{jdk.internal}} whereas we should ignore all annotations which have a package name *starting with* {{jdk.internal}}.
Moreover annotations were ignored only when passing through the {{AnnotationMetaDataProvider#findConstraintAnnotations}} call site whereas {{ConstraintHelper.isMultiValueConstaint}} is called from other call sites.
In passing, we could also ignore the annotation from the {{java.*}} packages as they can't be constraints either. |
|