bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1642846 - in /bval/branches/bval-11: bval-jsr/src/main/java/org/apache/bval/cdi/BValExtension.java pom.xml
Date Tue, 02 Dec 2014 12:04:29 GMT
Author: rmannibucau
Date: Tue Dec  2 12:04:29 2014
New Revision: 1642846

URL: http://svn.apache.org/r1642846
Log:
using released API + don't fail on a not loadable CDI bean (NoClassDefFoundError)

Modified:
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/cdi/BValExtension.java
    bval/branches/bval-11/pom.xml

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/cdi/BValExtension.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/cdi/BValExtension.java?rev=1642846&r1=1642845&r2=1642846&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/cdi/BValExtension.java (original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/cdi/BValExtension.java Tue
Dec  2 12:04:29 2014
@@ -161,19 +161,23 @@ public class BValExtension implements Ex
         if (!javaClass.isInterface() && !Modifier.isFinal(modifiers) && !Modifier.isAbstract(modifiers))
{
             try {
                 ensureFactoryValidator();
-                final BeanDescriptor classConstraints = validator.getConstraintsForClass(javaClass);
-                if (annotatedType.isAnnotationPresent(ValidateOnExecution.class)
-                    || hasValidationAnnotation(annotatedType.getMethods())
-                    || hasValidationAnnotation(annotatedType.getConstructors())
-                    || (validBean && classConstraints != null && classConstraints.isBeanConstrained())
-                    || (validConstructors && classConstraints != null &&
!classConstraints.getConstrainedConstructors().isEmpty())
-                    || (validBusinessMethods && classConstraints != null &&
!classConstraints.getConstrainedMethods(MethodType.NON_GETTER).isEmpty())
-                    || (validGetterMethods && classConstraints != null &&
!classConstraints.getConstrainedMethods(MethodType.GETTER).isEmpty())) {
-                    // TODO: keep track of bValAnnotatedType and remove @BValBinding in
-                    // ProcessBean event if needed cause here we can't really add @ValidateOnExecution
-                    // through an extension
-                    final BValAnnotatedType<A> bValAnnotatedType = new BValAnnotatedType<A>(annotatedType);
-                    pat.setAnnotatedType(bValAnnotatedType);
+                try {
+                    final BeanDescriptor classConstraints = validator.getConstraintsForClass(javaClass);
+                    if (annotatedType.isAnnotationPresent(ValidateOnExecution.class)
+                            || hasValidationAnnotation(annotatedType.getMethods())
+                            || hasValidationAnnotation(annotatedType.getConstructors())
+                            || (validBean && classConstraints != null &&
classConstraints.isBeanConstrained())
+                            || (validConstructors && classConstraints != null &&
!classConstraints.getConstrainedConstructors().isEmpty())
+                            || (validBusinessMethods && classConstraints != null
&& !classConstraints.getConstrainedMethods(MethodType.NON_GETTER).isEmpty())
+                            || (validGetterMethods && classConstraints != null &&
!classConstraints.getConstrainedMethods(MethodType.GETTER).isEmpty())) {
+                        // TODO: keep track of bValAnnotatedType and remove @BValBinding
in
+                        // ProcessBean event if needed cause here we can't really add @ValidateOnExecution
+                        // through an extension
+                        final BValAnnotatedType<A> bValAnnotatedType = new BValAnnotatedType<A>(annotatedType);
+                        pat.setAnnotatedType(bValAnnotatedType);
+                    }
+                } catch (final NoClassDefFoundError ncdfe) {
+                    // skip
                 }
             } catch (final ValidationException ve) {
                 LOGGER.log(Level.FINEST, ve.getMessage(), ve);

Modified: bval/branches/bval-11/pom.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/pom.xml?rev=1642846&r1=1642845&r2=1642846&view=diff
==============================================================================
--- bval/branches/bval-11/pom.xml (original)
+++ bval/branches/bval-11/pom.xml Tue Dec  2 12:04:29 2014
@@ -287,7 +287,7 @@
             <dependency>
                 <groupId>org.apache.geronimo.specs</groupId>
                 <artifactId>geronimo-validation_1.1_spec</artifactId>
-                <version>1.0-SNAPSHOT</version>
+                <version>1.0-alpha-1</version>
             </dependency>
             <!-- Optional profile to use Spec RI API -->
             <dependency>



Mime
View raw message