struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnenn...@apache.org
Subject [01/10] struts git commit: fixed some generics related warnings and did a little re-formatting
Date Fri, 12 Jun 2015 08:53:31 GMT
Repository: struts
Updated Branches:
  refs/heads/master fa9cac703 -> 48b064083


fixed some generics related warnings and did a little re-formatting

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

Branch: refs/heads/master
Commit: f03969dad8c66500a4d8a70ce9f675e401f14d64
Parents: 850da63
Author: cnenning <cnenning@apache.org>
Authored: Wed Jun 10 14:27:17 2015 +0200
Committer: cnenning <cnenning@apache.org>
Committed: Wed Jun 10 14:27:17 2015 +0200

----------------------------------------------------------------------
 .../interceptor/BeanValidationInterceptor.java          |  5 +++--
 .../interceptor/DefaultBeanValidationManager.java       | 12 +++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/f03969da/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java
----------------------------------------------------------------------
diff --git a/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java
b/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java
index 162e8e6..1088889 100644
--- a/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java
+++ b/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java
@@ -109,7 +109,8 @@ public class BeanValidationInterceptor extends MethodFilterInterceptor
{
 
         if (action instanceof ModelDriven) {
             LOG.trace("Performing validation on model..");
-            constraintViolations = validator.validate(((ModelDriven) action).getModel());
+            Object model = (Object)((ModelDriven<?>) action).getModel();
+            constraintViolations = validator.validate(model);
         } else {
             LOG.trace("Performing validation on action..");
             constraintViolations = validator.validate(action);
@@ -173,7 +174,7 @@ public class BeanValidationInterceptor extends MethodFilterInterceptor
{
     /**
      * This is copied from DefaultActionInvocation
      */
-    protected Method getActionMethod(Class actionClass, String methodName) throws NoSuchMethodException
{
+    protected Method getActionMethod(Class<?> actionClass, String methodName) throws
NoSuchMethodException {
         Method method;
 
         try {

http://git-wip-us.apache.org/repos/asf/struts/blob/f03969da/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 f03e19e..81aebf8 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
@@ -55,7 +55,7 @@ public class DefaultBeanValidationManager
 
     private static final Logger LOG = LogManager.getLogger(DefaultBeanValidationManager.class);
 
-    protected Class<? extends ValidationProvider> providerClass;
+    protected Class<? extends ValidationProvider<? extends Configuration<?>>>
providerClass;
 
     private ValidatorFactory validationFactory;
 
@@ -68,7 +68,8 @@ public class DefaultBeanValidationManager
 
         if (StringUtils.isNotBlank(providerClassName)) {
             try {
-                this.providerClass = (Class<? extends ValidationProvider>) Class.forName(providerClassName);
+                this.providerClass =
+                    (Class<? extends ValidationProvider<? extends Configuration<?>>>)
Class.forName(providerClassName);
                 LOG.info(this.providerClass.getName() + " validator found");
             } catch (ClassNotFoundException e) {
                 LOG.error("Unable to find any bean validator implementation for " + providerClassName);
@@ -80,9 +81,10 @@ public class DefaultBeanValidationManager
             LOG.info("********** No bean validator class defined - Falling back to default
provider **********");
         }
 
-        Configuration configuration =
-                (this.providerClass != null ? Validation.byProvider(this.providerClass).configure()
-                        : Validation.byDefaultProvider().configure());
+        Configuration<? extends Configuration<?>> configuration =
+                this.providerClass != null
+                    ? Validation.byProvider(this.providerClass).configure()
+                    : Validation.byDefaultProvider().configure();
         if (BooleanUtils.toBoolean(ignoreXMLConfiguration)) {
             configuration.ignoreXmlConfiguration();
             LOG.info("XML configurations will be ignore by Validator, to enable XML based
validation, set struts.beanValidation.ignoreXMLConfiguration to false.");


Mime
View raw message