bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1658397 - /bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java
Date Mon, 09 Feb 2015 13:46:50 GMT
Author: rmannibucau
Date: Mon Feb  9 13:46:50 2015
New Revision: 1658397

URL: http://svn.apache.org/r1658397
Log:
ensure we can call proxy constructor even with java 8

Modified:
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java?rev=1658397&r1=1658396&r2=1658397&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java
Mon Feb  9 13:46:50 2015
@@ -22,11 +22,6 @@ import org.apache.commons.weaver.privili
 import org.apache.commons.weaver.privilizer.Privilizing;
 import org.apache.commons.weaver.privilizer.Privilizing.CallTo;
 
-import javax.validation.Payload;
-import javax.validation.Valid;
-import javax.validation.ValidationException;
-import javax.validation.groups.ConvertGroup;
-
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationHandler;
@@ -36,6 +31,10 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import javax.validation.Payload;
+import javax.validation.Valid;
+import javax.validation.ValidationException;
+import javax.validation.groups.ConvertGroup;
 
 /**
  * Description: Holds the information and creates an annotation proxy during xml
@@ -210,6 +209,7 @@ final public class AnnotationProxyBuilde
     private A doCreateAnnotation(final Class<A> proxyClass, final InvocationHandler
handler) {
         try {
             Constructor<A> constructor = proxyClass.getConstructor(InvocationHandler.class);
+            Reflection.setAccessible(constructor, true); // java 8
             return constructor.newInstance(handler);
         } catch (Exception e) {
             throw new ValidationException("Unable to create annotation for configured constraint",
e);



Mime
View raw message