bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1385328 - /bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
Date Sun, 16 Sep 2012 17:48:11 GMT
Author: mbenson
Date: Sun Sep 16 17:48:11 2012
New Revision: 1385328

URL: http://svn.apache.org/viewvc?rev=1385328&view=rev
Log:
code audit & get to the point

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

Modified: bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java?rev=1385328&r1=1385327&r2=1385328&view=diff
==============================================================================
--- bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
(original)
+++ bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ApacheValidatorFactory.java
Sun Sep 16 17:48:11 2012
@@ -35,7 +35,6 @@ import javax.validation.Validation;
 import javax.validation.ValidationException;
 import javax.validation.Validator;
 import javax.validation.ValidatorFactory;
-import javax.validation.bootstrap.ProviderSpecificBootstrap;
 import javax.validation.spi.ConfigurationState;
 
 import org.apache.bval.jsr303.xml.AnnotationIgnores;
@@ -65,6 +64,7 @@ public class ApacheValidatorFactory impl
     private final AnnotationIgnores annotationIgnores = new AnnotationIgnores();
     private final ConstraintCached constraintsCache = new ConstraintCached();
     private final Map<Class<?>, Class<?>[]> defaultSequences;
+
     /**
      * access strategies for properties with cascade validation @Valid support
      */
@@ -78,11 +78,9 @@ public class ApacheValidatorFactory impl
      */
     public static synchronized ApacheValidatorFactory getDefault() {
         if (DEFAULT_FACTORY == null) {
-            ProviderSpecificBootstrap<ApacheValidatorConfiguration> provider =
-                    Validation.byProvider(ApacheValidationProvider.class);
-            ApacheValidatorConfiguration configuration = provider.configure();
             DEFAULT_FACTORY =
-                    (ApacheValidatorFactory) configuration.buildValidatorFactory();
+                Validation.byProvider(ApacheValidationProvider.class).configure().buildValidatorFactory()
+                    .unwrap(ApacheValidatorFactory.class);
         }
         return DEFAULT_FACTORY;
     }



Mime
View raw message