struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject struts git commit: Remove provider class generic to fix compile error which breaks the build
Date Sun, 14 Jun 2015 11:51:23 GMT
Repository: struts
Updated Branches:
  refs/heads/master 48b064083 -> 9e95d7929


Remove provider class generic to fix compile error which breaks the build


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/9e95d792
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/9e95d792
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/9e95d792

Branch: refs/heads/master
Commit: 9e95d79294a82268f49cc345c9069e800c00d80f
Parents: 48b0640
Author: Johannes Geppert <jogep@apache.org>
Authored: Sun Jun 14 13:51:26 2015 +0200
Committer: Johannes Geppert <jogep@apache.org>
Committed: Sun Jun 14 13:51:26 2015 +0200

----------------------------------------------------------------------
 .../DefaultBeanValidationManager.java           | 25 +++++++++-----------
 1 file changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/9e95d792/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/DefaultBeanValidationManager.java
----------------------------------------------------------------------
diff --git a/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/DefaultBeanValidationManager.java
b/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/DefaultBeanValidationManager.java
index c54cca8..69707bf 100644
--- a/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/DefaultBeanValidationManager.java
+++ b/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/DefaultBeanValidationManager.java
@@ -22,7 +22,6 @@ package org.apache.struts.beanvalidation.validation.interceptor;
 
 import com.opensymphony.xwork2.ObjectFactory;
 import com.opensymphony.xwork2.inject.Inject;
-
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.logging.log4j.LogManager;
@@ -33,7 +32,6 @@ import javax.validation.Configuration;
 import javax.validation.Validation;
 import javax.validation.Validator;
 import javax.validation.ValidatorFactory;
-import javax.validation.spi.ValidationProvider;
 
 /**
  * <p>
@@ -52,29 +50,28 @@ import javax.validation.spi.ValidationProvider;
  * </ul>
  * </p>
  */
-public class DefaultBeanValidationManager
-        implements BeanValidationManager {
+public class DefaultBeanValidationManager implements BeanValidationManager {
 
     private static final Logger LOG = LogManager.getLogger(DefaultBeanValidationManager.class);
 
-    protected Class<? extends ValidationProvider<? extends Configuration<?>>>
providerClass;
+    protected Class providerClass;
 
     private ValidatorFactory validationFactory;
 
     @Inject
     public DefaultBeanValidationManager(
-                @Inject(value = ValidatorConstants.PROVIDER_CLASS, required = false) String
providerClassName,
-                @Inject(value = ValidatorConstants.IGNORE_XMLCONFIGURAITION, required = false)String
ignoreXMLConfiguration,
-                @Inject(required = true) ObjectFactory objectFactory) {
+            @Inject(value = ValidatorConstants.PROVIDER_CLASS, required = false) String providerClassName,
+            @Inject(value = ValidatorConstants.IGNORE_XMLCONFIGURAITION, required = false)
String ignoreXMLConfiguration,
+            @Inject(required = true) ObjectFactory objectFactory) {
         super();
         LOG.info("Initializing bean validation factory to get a validator");
 
         if (StringUtils.isNotBlank(providerClassName)) {
             try {
-            	this.providerClass = objectFactory.getClassInstance(providerClassName);
-                LOG.info(this.providerClass.getName() + " validator found");
+                this.providerClass = objectFactory.getClassInstance(providerClassName);
+                LOG.info("{} validator found", this.providerClass.getName());
             } catch (ClassNotFoundException e) {
-                LOG.error("Unable to find any bean validator implementation for " + providerClassName);
+                LOG.error("Unable to find any bean validator implementation for class: {}",
providerClassName);
                 LOG.error("Unable to load bean validation provider class", e);
             }
 
@@ -83,10 +80,10 @@ public class DefaultBeanValidationManager
             LOG.warn("********** No bean validator class defined - Falling back to default
provider **********");
         }
 
-        Configuration<? extends Configuration<?>> configuration =
+        Configuration configuration =
                 this.providerClass != null
-                    ? Validation.byProvider(this.providerClass).configure()
-                    : Validation.byDefaultProvider().configure();
+                        ? Validation.byProvider(this.providerClass).configure()
+                        : Validation.byDefaultProvider().configure();
         if (BooleanUtils.toBoolean(ignoreXMLConfiguration)) {
             configuration.ignoreXmlConfiguration();
             LOG.info("XML configurations will be ignored by Validator, to enable XML based
validation, set struts.beanValidation.ignoreXMLConfiguration to false.");


Mime
View raw message