incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r992349 - in /incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303: ApacheValidatorFactory.java ClassValidator.java
Date Fri, 03 Sep 2010 16:15:49 GMT
Author: mbenson
Date: Fri Sep  3 16:15:49 2010
New Revision: 992349

URL: http://svn.apache.org/viewvc?rev=992349&view=rev
Log:
don't try to instantiate abstract classes

Modified:
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java?rev=992349&r1=992348&r2=992349&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
Fri Sep  3 16:15:49 2010
@@ -30,6 +30,7 @@ import javax.validation.*;
 import javax.validation.bootstrap.ProviderSpecificBootstrap;
 import javax.validation.spi.ConfigurationState;
 import java.lang.annotation.Annotation;
+import java.lang.reflect.Modifier;
 import java.util.*;
 
 /**
@@ -210,7 +211,7 @@ public class ApacheValidatorFactory impl
             @SuppressWarnings("unchecked")
             final T result = (T) this;
             return result;
-        } else if (!type.isInterface()) {
+        } else if (!(type.isInterface() || Modifier.isAbstract(type.getModifiers()))) {
             return SecureActions.newInstance(type);
         } else {
             try {

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java?rev=992349&r1=992348&r2=992349&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ClassValidator.java
Fri Sep  3 16:15:49 2010
@@ -19,6 +19,7 @@
 package org.apache.bval.jsr303;
 
 
+import java.lang.reflect.Modifier;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
@@ -360,7 +361,7 @@ public class ClassValidator implements V
       @SuppressWarnings("unchecked")
       final T result = (T) this;
       return result;
-    } else if (!type.isInterface()) {
+    } else if (!(type.isInterface() || Modifier.isAbstract(type.getModifiers()))) {
       return SecureActions.newInstance(type, new Class[]{ApacheFactoryContext.class},
           new Object[]{factoryContext});
     } else {



Mime
View raw message