bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1614079 - /bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/cdi/BValExtension.java
Date Mon, 28 Jul 2014 17:18:19 GMT
Author: rmannibucau
Date: Mon Jul 28 17:18:18 2014
New Revision: 1614079

URL: http://svn.apache.org/r1614079
Log:
avoid NPE

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

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=1614079&r1=1614078&r2=1614079&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 Mon
Jul 28 17:18:18 2014
@@ -157,10 +157,10 @@ public class BValExtension implements Ex
                 if (annotatedType.isAnnotationPresent(ValidateOnExecution.class)
                     || hasValidationAnnotation(annotatedType.getMethods())
                     || hasValidationAnnotation(annotatedType.getConstructors())
-                    || (validBean && classConstraints.isBeanConstrained())
-                    || (validConstructors && !classConstraints.getConstrainedConstructors().isEmpty())
-                    || (validBusinessMethods && !classConstraints.getConstrainedMethods(MethodType.NON_GETTER).isEmpty())
-                    || (validGetterMethods && !classConstraints.getConstrainedMethods(MethodType.GETTER).isEmpty()))
{
+                    || (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



Mime
View raw message