bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1504137 - in /bval/branches/bval-11: bval-jsr303/pom.xml bval-jsr303/src/main/java/org/apache/bval/cdi/BValInterceptor.java bval-tck11/work-tests-suite.xml
Date Wed, 17 Jul 2013 13:48:08 GMT
Author: rmannibucau
Date: Wed Jul 17 13:48:08 2013
New Revision: 1504137

URL: http://svn.apache.org/r1504137
Log:
adding @Priority on BValInterceptor

Modified:
    bval/branches/bval-11/bval-jsr303/pom.xml
    bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/cdi/BValInterceptor.java
    bval/branches/bval-11/bval-tck11/work-tests-suite.xml

Modified: bval/branches/bval-11/bval-jsr303/pom.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/pom.xml?rev=1504137&r1=1504136&r2=1504137&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/pom.xml (original)
+++ bval/branches/bval-11/bval-jsr303/pom.xml Wed Jul 17 13:48:08 2013
@@ -138,6 +138,14 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-el_2.2_spec</artifactId>
             <version>1.0.2</version>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-annotation_1.2_spec</artifactId>
+            <version>1.0.MR2-SNAPSHOT</version>
+            <scope>provided</scope>
             <optional>true</optional>
         </dependency>
         <!-- TODO: get spec v1.2 to replace JBoss spec jar

Modified: bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/cdi/BValInterceptor.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/cdi/BValInterceptor.java?rev=1504137&r1=1504136&r2=1504137&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/cdi/BValInterceptor.java
(original)
+++ bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/cdi/BValInterceptor.java
Wed Jul 17 13:48:08 2013
@@ -21,6 +21,7 @@ package org.apache.bval.cdi;
 import org.apache.bval.jsr303.util.ClassHelper;
 import org.apache.bval.jsr303.util.Proxies;
 
+import javax.annotation.Priority;
 import javax.inject.Inject;
 import javax.interceptor.AroundConstruct;
 import javax.interceptor.AroundInvoke;
@@ -49,6 +50,7 @@ import java.util.concurrent.CopyOnWriteA
 
 @Interceptor
 @BValBinding
+@Priority(4800) // TODO: maybe add it through ASM to be compliant with CDI 1.0 containers
using simply this class as a template to generate another one for CDI 1.1 impl
 public class BValInterceptor {
     private Collection<ExecutableType> classConfiguration = null;
     private final Map<Method, Boolean> methodConfiguration = new ConcurrentHashMap<Method,
Boolean>();
@@ -60,18 +62,18 @@ public class BValInterceptor {
     @Inject
     private BValExtension globalConfiguration;
 
-    private ExecutableValidator executableValidator;
+    private ExecutableValidator executableValidator = null;
 
-    @AroundConstruct // TODO: maybe add it through ASM to be compliant with CDI 1.0 containers
using simply this class as a template for the one created with ASM
+    @AroundConstruct // TODO: see previous one
     public Object construct(final InvocationContext context) throws Exception {
         final Constructor constructor = context.getConstructor();
-        final Class<?> targetClass = Proxies.classFor(context.getTarget().getClass());
+        final Class<?> targetClass = constructor.getDeclaringClass();
         if (!isConstructorValidated(targetClass, constructor)) {
             return context.proceed();
         }
 
         final ConstructorDescriptor constraints = validator.getConstraintsForClass(targetClass).getConstraintsForConstructor(constructor.getParameterTypes());
-        if (constraints == null) {
+        if (constraints == null) { // surely implicit constructor
             return context.proceed();
         }
 

Modified: bval/branches/bval-11/bval-tck11/work-tests-suite.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-tck11/work-tests-suite.xml?rev=1504137&r1=1504136&r2=1504137&view=diff
==============================================================================
--- bval/branches/bval-11/bval-tck11/work-tests-suite.xml (original)
+++ bval/branches/bval-11/bval-tck11/work-tests-suite.xml Wed Jul 17 13:48:08 2013
@@ -21,9 +21,9 @@ think to add -Dvalidation.provider=org.a
 <suite name="tmp" verbose="1">
   <test name="tmp">
     <classes>
-      <class name="org.hibernate.beanvalidation.tck.tests.integration.cdi.executable.ExecutableValidationTest">
+      <class name="org.hibernate.beanvalidation.tck.tests.integration.cdi.executable.priority.ValidationInterceptorPriorityTest">
         <methods>
-          <include name="testConstructorValidationInvokesParameterAndReturnValueValidationUsingDefaultGroup"
/>
+
         </methods>
       </class>
     </classes>



Mime
View raw message