struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [3/9] struts git commit: Minor code improvements's in the xwork-core module
Date Mon, 15 Jun 2015 17:38:04 GMT
http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java
index dbd8975..dc8d856 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java
@@ -15,25 +15,7 @@
  */
 package com.opensymphony.xwork2.validator;
 
-import com.opensymphony.xwork2.validator.annotations.ConditionalVisitorFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.ConversionErrorFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.CustomValidator;
-import com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.EmailValidator;
-import com.opensymphony.xwork2.validator.annotations.ExpressionValidator;
-import com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator;
-import com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.RegexFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
-import com.opensymphony.xwork2.validator.annotations.ShortRangeFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.UrlValidator;
-import com.opensymphony.xwork2.validator.annotations.Validation;
-import com.opensymphony.xwork2.validator.annotations.ValidationParameter;
-import com.opensymphony.xwork2.validator.annotations.Validations;
-import com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator;
+import com.opensymphony.xwork2.validator.annotations.*;
 import org.apache.commons.lang3.StringUtils;
 
 import java.lang.annotation.Annotation;
@@ -41,12 +23,7 @@ import java.lang.reflect.Method;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -70,7 +47,7 @@ public class AnnotationValidationConfigurationBuilder {
 
     private List<ValidatorConfig> processAnnotations(Object o) {
 
-        List<ValidatorConfig> result = new ArrayList<ValidatorConfig>();
+        List<ValidatorConfig> result = new ArrayList<>();
 
         String fieldName = null;
         String methodName = null;
@@ -96,7 +73,6 @@ public class AnnotationValidationConfigurationBuilder {
                 // Process collection of custom validations
                 if (a instanceof Validations) {
                     processValidationAnnotation(a, fieldName, methodName, result);
-
                 }
 
                 // Process single custom validator
@@ -377,7 +353,7 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processExpressionValidatorAnnotation(ExpressionValidator v, String fieldName, String methodName) {
         String validatorType = "expression";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
@@ -398,32 +374,28 @@ public class AnnotationValidationConfigurationBuilder {
 
     private ValidatorConfig processCustomValidatorAnnotation(CustomValidator v, String fieldName, String methodName) {
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
 
         String validatorType = v.type();
-
         validatorFactory.lookupRegisteredValidatorType(validatorType);
 
         Annotation[] recursedAnnotations = v.parameters();
 
         if (recursedAnnotations != null) {
             for (Annotation a2 : recursedAnnotations) {
-
                 if (a2 instanceof ValidationParameter) {
-
                     ValidationParameter parameter = (ValidationParameter) a2;
                     String parameterName = parameter.name();
                     String parameterValue = parameter.value();
                     params.put(parameterName, parameterValue);
                 }
-
             }
         }
 
@@ -440,11 +412,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processRegexFieldValidatorAnnotation(RegexFieldValidator v, String fieldName, String methodName) {
         String validatorType = "regex";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -469,11 +441,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processConditionalVisitorFieldValidatorAnnotation(ConditionalVisitorFieldValidator v, String fieldName, String methodName) {
         String validatorType = "conditionalvisitor";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -496,11 +468,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processVisitorFieldValidatorAnnotation(VisitorFieldValidator v, String fieldName, String methodName) {
         String validatorType = "visitor";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -521,11 +493,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processUrlValidatorAnnotation(UrlValidator v, String fieldName, String methodName) {
         String validatorType = "url";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
         if (StringUtils.isNotEmpty(v.urlRegex())) {
@@ -549,7 +521,7 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processStringLengthFieldValidatorAnnotation(StringLengthFieldValidator v, String fieldName, String methodName) {
         String validatorType = "stringlength";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
@@ -609,11 +581,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processRequiredStringValidatorAnnotation(RequiredStringValidator v, String fieldName, String methodName) {
         String validatorType = "requiredstring";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -633,11 +605,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processRequiredFieldValidatorAnnotation(RequiredFieldValidator v, String fieldName, String methodName) {
         String validatorType = "required";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -655,11 +627,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processIntRangeFieldValidatorAnnotation(IntRangeFieldValidator v, String fieldName, String methodName) {
         String validatorType = "int";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -690,11 +662,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processShortRangeFieldValidatorAnnotation(ShortRangeFieldValidator v, String fieldName, String methodName) {
         String validatorType = "short";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -725,7 +697,7 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processDoubleRangeFieldValidatorAnnotation(DoubleRangeFieldValidator v, String fieldName, String methodName) {
         String validatorType = "double";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
@@ -775,11 +747,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processFieldExpressionValidatorAnnotation(FieldExpressionValidator v, String fieldName, String methodName) {
         String validatorType = "fieldexpression";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -799,11 +771,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processEmailValidatorAnnotation(EmailValidator v, String fieldName, String methodName) {
         String validatorType = "email";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -821,7 +793,7 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processDateRangeFieldValidatorAnnotation(DateRangeFieldValidator v, String fieldName, String methodName) {
         String validatorType = "date";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
@@ -858,11 +830,11 @@ public class AnnotationValidationConfigurationBuilder {
     private ValidatorConfig processConversionErrorFieldValidatorAnnotation(ConversionErrorFieldValidator v, String fieldName, String methodName) {
         String validatorType = "conversion";
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
 
         if (fieldName != null) {
             params.put("fieldName", fieldName);
-        } else if (v.fieldName() != null && v.fieldName().length() > 0) {
+        } else if (StringUtils.isNotEmpty(v.fieldName())) {
             params.put("fieldName", v.fieldName());
         }
 
@@ -880,7 +852,7 @@ public class AnnotationValidationConfigurationBuilder {
 
     public List<ValidatorConfig> buildAnnotationClassValidatorConfigs(Class aClass) {
 
-        List<ValidatorConfig> result = new ArrayList<ValidatorConfig>();
+        List<ValidatorConfig> result = new ArrayList<>();
 
         List<ValidatorConfig> temp = processAnnotations(aClass);
         if (temp != null) {

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
index f139401..d9d7401 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
@@ -22,9 +22,8 @@ import com.opensymphony.xwork2.XWorkConstants;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.util.ClassLoaderUtil;
 import com.opensymphony.xwork2.util.ValueStack;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.LogManager;
-import com.opensymphony.xwork2.validator.validators.VisitorFieldValidator;
+import org.apache.logging.log4j.Logger;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -98,7 +97,7 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
         List<ValidatorConfig> cfgs = validatorCache.get(validatorKey);
 
         // create clean instances of the validators for the caller's use
-        ArrayList<Validator> validators = new ArrayList<Validator>(cfgs.size());
+        ArrayList<Validator> validators = new ArrayList<>(cfgs.size());
         for (ValidatorConfig cfg : cfgs) {
             if (method == null || method.equals(cfg.getParams().get("methodName"))) {
                 Validator validator = validatorFactory.getValidator(cfg);
@@ -131,9 +130,7 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
         try {
                 validator.setValidatorContext(validatorContext);
 
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Running validator: " + validator + " for object " + object + " and method " + method);
-                }
+            LOG.debug("Running validator: {} for object {} and method {}", validator, object, method);
 
                 FieldValidator fValidator = null;
                 String fullFieldName = null;
@@ -143,10 +140,7 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
                     fullFieldName = fValidator.getValidatorContext().getFullFieldName(fValidator.getFieldName());
 
                     if ((shortcircuitedFields != null) && shortcircuitedFields.contains(fullFieldName)) {
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("Short-circuited, skipping");
-                        }
-
+                        LOG.debug("Short-circuited, skipping");
                         continue;
                     }
                 }
@@ -160,7 +154,7 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
                             Collection<String> fieldErrors = validatorContext.getFieldErrors().get(fullFieldName);
 
                             if (fieldErrors != null) {
-                                errs = new ArrayList<String>(fieldErrors);
+                                errs = new ArrayList<>(fieldErrors);
                             }
                         }
                     } else if (validatorContext.hasActionErrors()) {
@@ -178,12 +172,10 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
                             Collection<String> errCol = validatorContext.getFieldErrors().get(fullFieldName);
 
                             if ((errCol != null) && !errCol.equals(errs)) {
-                                if (LOG.isDebugEnabled()) {
-                                    LOG.debug("Short-circuiting on field validation");
-                                }
+                                LOG.debug("Short-circuiting on field validation");
 
                                 if (shortcircuitedFields == null) {
-                                    shortcircuitedFields = new TreeSet<String>();
+                                    shortcircuitedFields = new TreeSet<>();
                                 }
 
                                 shortcircuitedFields.add(fullFieldName);
@@ -193,14 +185,10 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
                         Collection<String> errCol = validatorContext.getActionErrors();
 
                         if ((errCol != null) && !errCol.equals(errs)) {
-                            if (LOG.isDebugEnabled()) {
-                                LOG.debug("Short-circuiting");
-                            }
-
+                            LOG.debug("Short-circuiting");
                             break;
                         }
                     }
-
                     continue;
                 }
 
@@ -281,7 +269,7 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
      * @return a list of validator configs for the given class and context.
      */
     private List<ValidatorConfig> buildValidatorConfigs(Class clazz, String context, boolean checkFile, Set<String> checked) {
-        List<ValidatorConfig> validatorConfigs = new ArrayList<ValidatorConfig>();
+        List<ValidatorConfig> validatorConfigs = new ArrayList<>();
 
         if (checked == null) {
             checked = new TreeSet<String>();
@@ -329,22 +317,12 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
         List<ValidatorConfig> retList = Collections.emptyList();
         URL fileUrl = ClassLoaderUtil.getResource(fileName, clazz);
         if ((checkFile && fileManager.fileNeedsReloading(fileUrl)) || !validatorFileCache.containsKey(fileName)) {
-            InputStream is = null;
-
-            try {
-                is = fileManager.loadFile(fileUrl);
-
+            try (InputStream is = fileManager.loadFile(fileUrl)) {
                 if (is != null) {
-                    retList = new ArrayList<ValidatorConfig>(validatorFileParser.parseActionValidatorConfigs(validatorFactory, is, fileName));
-                }
-            } finally {
-                if (is != null) {
-                    try {
-                        is.close();
-                    } catch (IOException e) {
-                        LOG.error("Unable to close input stream for " + fileName, e);
-                    }
+                    retList = new ArrayList<>(validatorFileParser.parseActionValidatorConfigs(validatorFactory, is, fileName));
                 }
+            } catch (IOException e) {
+                LOG.error("Caught exception while loading file {}", fileName, e);
             }
 
             validatorFileCache.put(fileName, retList);

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultValidatorFactory.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultValidatorFactory.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultValidatorFactory.java
index 7c96ae3..9f8a1b9 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultValidatorFactory.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DefaultValidatorFactory.java
@@ -21,8 +21,8 @@ import com.opensymphony.xwork2.XWorkException;
 import com.opensymphony.xwork2.config.ConfigurationException;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.util.ClassLoaderUtil;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.io.File;
 import java.io.FilenameFilter;
@@ -30,12 +30,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
@@ -49,7 +44,7 @@ import java.util.zip.ZipInputStream;
  */
 public class DefaultValidatorFactory implements ValidatorFactory {
 
-    protected Map<String, String> validators = new HashMap<String, String>();
+    protected Map<String, String> validators = new HashMap<>();
     private static Logger LOG = LogManager.getLogger(DefaultValidatorFactory.class);
     protected ObjectFactory objectFactory;
     protected ValidatorFileParser validatorFileParser;
@@ -88,10 +83,7 @@ public class DefaultValidatorFactory implements ValidatorFactory {
     }
 
     public void registerValidator(String name, String className) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Registering validator of class " + className + " with name " + name);
-        }
-
+        LOG.debug("Registering validator of class {} with name {}", className, name);
         validators.put(name, className);
     }
 
@@ -107,11 +99,9 @@ public class DefaultValidatorFactory implements ValidatorFactory {
     }
 
     private void parseValidators() {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Loading validator definitions.");
-        }
+        LOG.debug("Loading validator definitions.");
 
-        List<File> files = new ArrayList<File>();
+        List<File> files = new ArrayList<>();
         try {
             // Get custom validator configurations via the classpath
             Iterator<URL> urls = ClassLoaderUtil.getResources("", DefaultValidatorFactory.class, false);
@@ -137,7 +127,7 @@ public class DefaultValidatorFactory implements ValidatorFactory {
                                     files.addAll(Arrays.asList(ff));
                                 }
                             } catch (SecurityException se) {
-                                LOG.error("Security Exception while accessing directory '" + f + "'", se);
+                                LOG.error("Security Exception while accessing directory '{}'", f, se);
                             }
 
                         } else {
@@ -158,9 +148,7 @@ public class DefaultValidatorFactory implements ValidatorFactory {
                                 ZipEntry zipEntry = zipInputStream.getNextEntry();
                                 while (zipEntry != null) {
                                     if (zipEntry.getName().endsWith("-validators.xml")) {
-                                        if (LOG.isTraceEnabled()) {
-                                            LOG.trace("Adding validator " + zipEntry.getName());
-                                        }
+                                        LOG.trace("Adding validator {}", zipEntry.getName());
                                         files.add(new File(zipEntry.getName()));
                                     }
                                     zipEntry = zipInputStream.getNextEntry();

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
index c47d277..5b11921 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java
@@ -17,8 +17,8 @@ package com.opensymphony.xwork2.validator;
 
 import com.opensymphony.xwork2.*;
 import com.opensymphony.xwork2.util.ValueStack;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.*;
 
@@ -299,15 +299,15 @@ public class DelegatingValidatorContext implements ValidatorContext {
         }
 
         public void addActionError(String anErrorMessage) {
-            log.error("Validation error: " + anErrorMessage);
+            log.error("Validation error: {}", anErrorMessage);
         }
 
         public void addActionMessage(String aMessage) {
-            log.info("Validation Message: " + aMessage);
+            log.info("Validation Message: {}", aMessage);
         }
 
         public void addFieldError(String fieldName, String errorMessage) {
-            log.error("Validation error for " + fieldName + ":" + errorMessage);
+            log.error("Validation error for {}:{}", fieldName, errorMessage);
         }
 
         public boolean hasActionErrors() {

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidationInterceptor.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidationInterceptor.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidationInterceptor.java
index 84788ca..bbb25ed 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidationInterceptor.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidationInterceptor.java
@@ -21,8 +21,8 @@ import com.opensymphony.xwork2.Validateable;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
 import com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * <!-- START SNIPPET: description -->
@@ -210,8 +210,7 @@ public class ValidationInterceptor extends MethodFilterInterceptor {
         String method = proxy.getMethod();
 
         if (log.isDebugEnabled()) {
-            log.debug("Validating "
-                    + invocation.getProxy().getNamespace() + "/" + invocation.getProxy().getActionName() + " with method "+ method +".");
+            log.debug("Validating {}/{} with method {}.", invocation.getProxy().getNamespace(), invocation.getProxy().getActionName(), method);
         }
         
 
@@ -228,21 +227,15 @@ public class ValidationInterceptor extends MethodFilterInterceptor {
             Exception exception = null; 
             
             Validateable validateable = (Validateable) action;
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Invoking validate() on action "+validateable);
-            }
-            
+            LOG.debug("Invoking validate() on action {}", validateable);
+
             try {
-                PrefixMethodInvocationUtil.invokePrefixMethod(
-                                invocation, 
-                                new String[] { VALIDATE_PREFIX, ALT_VALIDATE_PREFIX });
+                PrefixMethodInvocationUtil.invokePrefixMethod(invocation, new String[]{VALIDATE_PREFIX, ALT_VALIDATE_PREFIX});
             }
             catch(Exception e) {
                 // If any exception occurred while doing reflection, we want 
                 // validate() to be executed
-                if (LOG.isWarnEnabled()) {
-                    LOG.warn("an exception occured while executing the prefix method", e);
-                }
+                LOG.warn("an exception occured while executing the prefix method", e);
                 exception = e;
             }
             
@@ -261,7 +254,6 @@ public class ValidationInterceptor extends MethodFilterInterceptor {
     @Override
     protected String doIntercept(ActionInvocation invocation) throws Exception {
         doBeforeInvocation(invocation);
-        
         return invocation.invoke();
     }
     

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidatorConfig.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidatorConfig.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidatorConfig.java
index 085607a..490f34e 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidatorConfig.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/ValidatorConfig.java
@@ -45,12 +45,12 @@ public class ValidatorConfig extends Located {
      */
     protected ValidatorConfig(String validatorType) {
         this.type = validatorType;
-        params = new LinkedHashMap<String, Object>();
+        params = new LinkedHashMap<>();
     }
 
     protected ValidatorConfig(ValidatorConfig orig) {
         this.type = orig.type;
-        this.params = new LinkedHashMap<String,Object>(orig.params);
+        this.params = new LinkedHashMap<>(orig.params);
         this.defaultMessage = orig.defaultMessage;
         this.messageKey = orig.messageKey;
         this.shortCircuit = orig.shortCircuit;

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConditionalVisitorFieldValidator.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConditionalVisitorFieldValidator.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConditionalVisitorFieldValidator.java
index e62e66c..4c83bb6 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConditionalVisitorFieldValidator.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConditionalVisitorFieldValidator.java
@@ -75,7 +75,7 @@ public class ConditionalVisitorFieldValidator extends VisitorFieldValidator {
         if ((obj != null) && (obj instanceof Boolean)) {
             answer = (Boolean) obj;
         } else {
-            log.warn("Got result of " + obj + " when trying to get Boolean.");
+            log.warn("Got result of {} when trying to get Boolean.", obj);
         }
 
         return answer;

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConversionErrorFieldValidator.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConversionErrorFieldValidator.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConversionErrorFieldValidator.java
index b1deb59..4fe0ea3 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConversionErrorFieldValidator.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ConversionErrorFieldValidator.java
@@ -18,13 +18,14 @@ package com.opensymphony.xwork2.validator.validators;
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
 import com.opensymphony.xwork2.validator.ValidationException;
+import org.apache.commons.lang3.StringUtils;
 
 import java.util.Map;
 
 
 /**
  * <!-- START SNIPPET: javadoc -->
- * Field Validator that checks if a conversion error occured for this field.
+ * Field Validator that checks if a conversion error occurred for this field.
  * <!-- END SNIPPET: javadoc -->
  * <p/>
  * <!-- START SNIPPET: parameters -->
@@ -72,7 +73,7 @@ public class ConversionErrorFieldValidator extends RepopulateConversionErrorFiel
         Map<String, Object> conversionErrors = context.getConversionErrors();
         
         if (conversionErrors.containsKey(fullFieldName)) {
-            if ((defaultMessage == null) || ("".equals(defaultMessage.trim()))) {
+            if (StringUtils.isBlank(defaultMessage)) {
                 defaultMessage = XWorkConverter.getConversionErrorMessage(fullFieldName, context.getValueStack());
             }
             

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldExpressionValidator.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldExpressionValidator.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldExpressionValidator.java
index a9d7116..197314b 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldExpressionValidator.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/FieldExpressionValidator.java
@@ -87,7 +87,7 @@ public class FieldExpressionValidator extends FieldValidatorSupport {
         if ((obj != null) && (obj instanceof Boolean)) {
             answer = (Boolean) obj;
         } else {
-            log.warn("Got result of " + obj + " when trying to get Boolean.");
+            log.warn("Got result of {} when trying to get Boolean.", obj);
         }
 
         if (!answer.booleanValue()) {

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RepopulateConversionErrorFieldValidatorSupport.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RepopulateConversionErrorFieldValidatorSupport.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RepopulateConversionErrorFieldValidatorSupport.java
index b6f7014..6dcb60f 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RepopulateConversionErrorFieldValidatorSupport.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/RepopulateConversionErrorFieldValidatorSupport.java
@@ -19,10 +19,10 @@ import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.interceptor.PreResultListener;
 import com.opensymphony.xwork2.util.ValueStack;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
 import com.opensymphony.xwork2.validator.ValidationException;
 import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -173,9 +173,7 @@ public abstract class RepopulateConversionErrorFieldValidatorSupport extends Fie
                     doExprOverride = true;
                     fakeParams.put(fullFieldName, escape(tmpValue[0]));
                 } else {
-                    if (LOG.isWarnEnabled()) {
-                        LOG.warn("value is an empty array of String or with first element in it as null [" + value + "], will not repopulate conversion error ");
-                    }
+                    LOG.warn("value is an empty array of String or with first element in it as null [{}], will not repopulate conversion error", value);
                 }
             } else if (value instanceof String) {
                 String tmpValue = (String) value;
@@ -183,9 +181,7 @@ public abstract class RepopulateConversionErrorFieldValidatorSupport extends Fie
                 fakeParams.put(fullFieldName, escape(tmpValue));
             } else {
                 // opps... it should be 
-                if (LOG.isWarnEnabled()) {
-                    LOG.warn("conversion error value is not a String or array of String but instead is [" + value + "], will not repopulate conversion error");
-                }
+                LOG.warn("conversion error value is not a String or array of String but instead is [{}], will not repopulate conversion error", value);
             }
 
             if (doExprOverride) {

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java
index 5587248..47916d0 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/StringLengthFieldValidator.java
@@ -144,7 +144,7 @@ public class StringLengthFieldValidator extends FieldValidatorSupport {
         String fieldName = getFieldName();
         String val = (String) getFieldValue(fieldName, object);
 
-        if (val == null || val.length() <= 0) {
+        if (StringUtils.isEmpty(val)) {
             // use a required validator for these
             return;
         }

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java
index 9dd3f50..1ca43b0 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/ValidatorSupport.java
@@ -17,14 +17,10 @@ package com.opensymphony.xwork2.validator.validators;
 
 import com.opensymphony.xwork2.util.TextParseUtil;
 import com.opensymphony.xwork2.util.ValueStack;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
-import com.opensymphony.xwork2.validator.DelegatingValidatorContext;
-import com.opensymphony.xwork2.validator.ShortCircuitableValidator;
-import com.opensymphony.xwork2.validator.ValidationException;
-import com.opensymphony.xwork2.validator.Validator;
-import com.opensymphony.xwork2.validator.ValidatorContext;
+import com.opensymphony.xwork2.validator.*;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -84,7 +80,7 @@ public abstract class ValidatorSupport implements Validator, ShortCircuitableVal
             }
             List<Object> parsedMessageParameters = null;
             if (messageParameters != null) {
-                parsedMessageParameters = new ArrayList<Object>();
+                parsedMessageParameters = new ArrayList<>();
                 for (String messageParameter : messageParameters) {
                     if (messageParameter != null) {
                         try {
@@ -93,7 +89,7 @@ public abstract class ValidatorSupport implements Validator, ShortCircuitableVal
                         } catch (Exception e) {
                             // if there's an exception in parsing, we'll just treat the expression itself as the
                             // parameter
-                            log.warn("exception while parsing message parameter [" + messageParameter + "]", e);
+                            log.warn("exception while parsing message parameter [{}]", messageParameter, e);
                             parsedMessageParameters.add(messageParameter);
                         }
                     }
@@ -101,7 +97,6 @@ public abstract class ValidatorSupport implements Validator, ShortCircuitableVal
             }
 
             message = validatorContext.getText(messageKey, defaultMessage, parsedMessageParameters);
-
         } else {
             message = defaultMessage;
         }

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java
index dc7632f..fb5a538 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java
@@ -40,13 +40,13 @@ public class ActionContextTest extends XWorkTestCase {
         super.setUp();
         ValueStack valueStack = container.getInstance(ValueStackFactory.class).createValueStack();
         Map<String, Object> extraContext = valueStack.getContext();
-        Map<String, Object> application = new HashMap<String, Object>();
+        Map<String, Object> application = new HashMap<>();
         application.put(APPLICATION_KEY, APPLICATION_KEY);
 
-        Map<String, Object> session = new HashMap<String, Object>();
+        Map<String, Object> session = new HashMap<>();
         session.put(SESSION_KEY, SESSION_KEY);
 
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
         params.put(PARAMETERS_KEY, PARAMETERS_KEY);
         extraContext.put(ActionContext.APPLICATION, application);
         extraContext.put(ActionContext.SESSION, session);
@@ -76,19 +76,19 @@ public class ActionContextTest extends XWorkTestCase {
     }
 
     public void testApplication() {
-        Map<String, Object> app = new HashMap<String, Object>();
+        Map<String, Object> app = new HashMap<>();
         context.setApplication(app);
         assertEquals(app, context.getApplication());
     }
 
     public void testContextMap() {
-        Map<String, Object> map = new HashMap<String, Object>();
+        Map<String, Object> map = new HashMap<>();
         context.setContextMap(map);
         assertEquals(map, context.getContextMap());
     }
 
     public void testParameters() {
-        Map<String, Object> param = new HashMap<String, Object>();
+        Map<String, Object> param = new HashMap<>();
         context.setParameters(param);
         assertEquals(param, context.getParameters());
     }
@@ -98,7 +98,7 @@ public class ActionContextTest extends XWorkTestCase {
         assertNotNull(errors);
         assertEquals(0, errors.size());
 
-        Map<String, Object> errors2 = new HashMap<String, Object>();
+        Map<String, Object> errors2 = new HashMap<>();
         context.setConversionErrors(errors);
         assertEquals(errors2, context.getConversionErrors());
     }

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/ActionInvocationTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/ActionInvocationTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/ActionInvocationTest.java
index 29c40ea..58d02dd 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/ActionInvocationTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/ActionInvocationTest.java
@@ -76,10 +76,10 @@ public class ActionInvocationTest extends XWorkTestCase {
     }
 
     public void testSimple() {
-        HashMap<String, Object> params = new HashMap<String, Object>();
+        HashMap<String, Object> params = new HashMap<>();
         params.put("blah", "this is blah");
 
-        HashMap<String, Object> extraContext = new HashMap<String, Object>();
+        HashMap<String, Object> extraContext = new HashMap<>();
         extraContext.put(ActionContext.PARAMETERS, params);
 
         try {

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/ActionNestingTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/ActionNestingTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/ActionNestingTest.java
index ff8b8ed..ee996e5 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/ActionNestingTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/ActionNestingTest.java
@@ -87,7 +87,7 @@ public class ActionNestingTest extends XWorkTestCase {
         ValueStack stack = ActionContext.getContext().getValueStack();
         assertEquals(VALUE, stack.findValue(KEY));
 
-        HashMap<String, Object> extraContext = new HashMap<String, Object>();
+        HashMap<String, Object> extraContext = new HashMap<>();
         extraContext.put(ActionContext.VALUE_STACK, stack);
 
         ActionProxy proxy = actionProxyFactory.createActionProxy(NAMESPACE, STACK_ACTION_NAME, extraContext);

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java
index 06e7f06..98a5dac 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java
@@ -223,7 +223,7 @@ public class ActionSupportTest extends XWorkTestCase {
         ActionContext.getContext().setLocale(new Locale("da"));
         MyActionSupport mas = new MyActionSupport();
 
-        List<Object> args = new ArrayList<Object>();
+        List<Object> args = new ArrayList<>();
         args.add("Santa");
         args.add("loud");
         assertEquals("Hello World", mas.getText("hello", "this is default", args)); // no args in bundle
@@ -273,7 +273,7 @@ public class ActionSupportTest extends XWorkTestCase {
 
         ValueStack stack = ActionContext.getContext().getValueStack();
 
-        List<Object> args = new ArrayList<Object>();
+        List<Object> args = new ArrayList<>();
         args.add("Santa");
         args.add("loud");
         assertEquals("Hello World", mas.getText("hello", "this is default", args, stack)); // no args in bundle

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java
index 59045f8..73d10a8 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java
@@ -52,7 +52,7 @@ public class ChainResultTest extends XWorkTestCase {
 
         String expectedActionName = "testActionName";
         String expectedNamespace = "testNamespace";
-        Map<String, Object> values = new HashMap<String, Object>();
+        Map<String, Object> values = new HashMap<>();
         values.put("actionName", expectedActionName);
         values.put("namespace", expectedNamespace);
 

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultActionInvocationTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultActionInvocationTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultActionInvocationTest.java
index 4291538..23e1904 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultActionInvocationTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultActionInvocationTest.java
@@ -27,7 +27,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
      * @throws Exception when action throws exception
      */
     public void testInvoke() throws Exception {
-        List<InterceptorMapping> interceptorMappings = new ArrayList<InterceptorMapping>();
+        List<InterceptorMapping> interceptorMappings = new ArrayList<>();
         MockInterceptor mockInterceptor1 = new MockInterceptor();
         mockInterceptor1.setFoo("test1");
         mockInterceptor1.setExpectedFoo("test1");

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java
index 509a7e7..37d6dce 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java
@@ -53,7 +53,7 @@ public class DefaultTextProviderTest extends TestCase {
     }
 
     public void testGetTextsWithListArgs() throws Exception {
-        List<Object> args = new ArrayList<Object>();
+        List<Object> args = new ArrayList<>();
         args.add("Santa");
         args.add("loud");
         assertEquals("Hello World", tp.getText("hello", "this is default", args)); // no args in bundle
@@ -95,7 +95,7 @@ public class DefaultTextProviderTest extends TestCase {
     }
 
     public void testGetTextsWithListAndStack() throws Exception {
-        List<Object> args = new ArrayList<Object>();
+        List<Object> args = new ArrayList<>();
         args.add("Santa");
         args.add("loud");
         assertEquals("Hello World", tp.getText("hello", "this is default", args, null)); // no args in bundle

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/GenericsBean.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/GenericsBean.java b/xwork-core/src/test/java/com/opensymphony/xwork2/GenericsBean.java
index 9ea3f2d..b1d432b 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/GenericsBean.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/GenericsBean.java
@@ -14,8 +14,8 @@ import java.util.Map;
 public class GenericsBean {
     private List<Double> blubb;
     private List<Double> getterList;
-    private Map<Double, Integer> genericMap = new HashMap<Double, Integer>();
-    private Map<Double, List<Integer>> extendedMap = new HashMap<Double, List<Integer>>();
+    private Map<Double, Integer> genericMap = new HashMap<>();
+    private Map<Double, List<Integer>> extendedMap = new HashMap<>();
 
     /**
      * @return Returns the doubles.
@@ -41,7 +41,7 @@ public class GenericsBean {
 
     public List<Double> getGetterList() {
         if ( getterList == null ) {
-            getterList = new ArrayList<Double>(1);
+            getterList = new ArrayList<>(1);
             getterList.add(42.42);
         }
         return getterList;

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/ProxyInvocationTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/ProxyInvocationTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/ProxyInvocationTest.java
index 74935e2..0e7e208 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/ProxyInvocationTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/ProxyInvocationTest.java
@@ -32,9 +32,9 @@ public class ProxyInvocationTest extends XWorkTestCase {
      * Needed for the creation of the action proxy
      */
     private Map<String, Object> createDummyContext() {
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
         params.put("blah", "this is blah");
-        Map<String, Object> extraContext = new HashMap<String, Object>();
+        Map<String, Object> extraContext = new HashMap<>();
         extraContext.put(ActionContext.PARAMETERS, params);
         return extraContext;
     }

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAction.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAction.java b/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAction.java
index 6a180a1..d563ebf 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAction.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAction.java
@@ -32,7 +32,7 @@ public class SimpleAction extends ActionSupport {
     public static final String COMMAND_RETURN_CODE = "com.opensymphony.xwork2.SimpleAction.CommandInvoked";
 
 
-    private ArrayList someList = new ArrayList();
+    private ArrayList<String> someList = new ArrayList<>();
     private Date date = new Date();
     private Properties settings = new Properties();
     private String blah;
@@ -45,12 +45,12 @@ public class SimpleAction extends ActionSupport {
     private long longFoo;
     private short shortFoo;
     private double percentage;
-    private Map<Integer,String> indexedProps = new HashMap<Integer,String>();
+    private Map<Integer, String> indexedProps = new HashMap<>();
 
     private String aliasSource;
     private String aliasDest;
-    private Map<String,String> protectedMap = new HashMap<String,String>();
-    private Map<String,String> existingMap = new HashMap<String,String>();
+    private Map<String, String> protectedMap = new HashMap<>();
+    private Map<String, String> existingMap = new HashMap<>();
     
     public static boolean resultCalled;
 
@@ -122,9 +122,7 @@ public class SimpleAction extends ActionSupport {
     }
 
     public boolean[] getBools() {
-        boolean[] b = new boolean[]{true, false, false, true};
-
-        return b;
+        return new boolean[]{true, false, false, true};
     }
 
     public void setDate(Date date) {
@@ -177,11 +175,11 @@ public class SimpleAction extends ActionSupport {
     }
 
 
-    public void setSomeList(ArrayList someList) {
+    public void setSomeList(ArrayList<String> someList) {
         this.someList = someList;
     }
 
-    public ArrayList getSomeList() {
+    public ArrayList<String> getSomeList() {
         return someList;
     }
     

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAnnotationAction.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAnnotationAction.java b/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAnnotationAction.java
index 79df77d..35f0f55 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAnnotationAction.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/SimpleAnnotationAction.java
@@ -36,7 +36,7 @@ public class SimpleAnnotationAction extends ActionSupport {
 
     //~ Instance fields ////////////////////////////////////////////////////////
 
-    private ArrayList<String> someList = new ArrayList<String>();
+    private ArrayList<String> someList = new ArrayList<>();
     private Date date = new Date();
     private Properties settings = new Properties();
     private String blah;

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/StubValueStack.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/StubValueStack.java b/xwork-core/src/test/java/com/opensymphony/xwork2/StubValueStack.java
index 8432f2a..1856c7c 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/StubValueStack.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/StubValueStack.java
@@ -25,7 +25,7 @@ import java.util.Map;
  * Stub value stack for testing
  */
 public class StubValueStack implements ValueStack {
-    Map<String, Object> ctx = new HashMap<String, Object>();
+    Map<String, Object> ctx = new HashMap<>();
     CompoundRoot root = new CompoundRoot();
     
     public Map<String, Object> getContext() {

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/TextProviderSupportTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/TextProviderSupportTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/TextProviderSupportTest.java
index 2c0b377..cb360f7 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/TextProviderSupportTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/TextProviderSupportTest.java
@@ -54,7 +54,7 @@ public class TextProviderSupportTest extends XWorkTestCase {
     }
 
     public void testGetTextsWithListArgs() throws Exception {
-        List<Object> args = new ArrayList<Object>();
+        List<Object> args = new ArrayList<>();
         args.add("Santa");
         args.add("loud");
         assertEquals("Hello World", tp.getText("hello", "this is default", args)); // no args in bundle

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/UnknownHandlerManagerMock.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/UnknownHandlerManagerMock.java b/xwork-core/src/test/java/com/opensymphony/xwork2/UnknownHandlerManagerMock.java
index b27024a..d439eda 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/UnknownHandlerManagerMock.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/UnknownHandlerManagerMock.java
@@ -9,7 +9,7 @@ import java.util.ArrayList;
 public class UnknownHandlerManagerMock extends DefaultUnknownHandlerManager {
     public void addUnknownHandler(UnknownHandler uh) {
         if (this.unknownHandlers == null)
-            this.unknownHandlers = new ArrayList<UnknownHandler>();
+            this.unknownHandlers = new ArrayList<>();
         this.unknownHandlers.add(uh);
     }
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/VoidResult.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/VoidResult.java b/xwork-core/src/test/java/com/opensymphony/xwork2/VoidResult.java
index afc3f4f..ccb9ba4 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/VoidResult.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/VoidResult.java
@@ -25,11 +25,7 @@ public class VoidResult implements Result {
             return true;
         }
 
-        if (!(o instanceof VoidResult)) {
-            return false;
-        }
-
-        return true;
+        return o instanceof VoidResult;
     }
 
     public void execute(ActionInvocation invocation) throws Exception {

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/ConfigurationTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/ConfigurationTest.java
index 5178bea..f6b9c19 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/ConfigurationTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/ConfigurationTest.java
@@ -61,10 +61,10 @@ public class ConfigurationTest extends XWorkTestCase {
     }
 
     public void testDefaultNamespace() {
-        HashMap<String, String> params = new HashMap<String, String>();
+        HashMap<String, String> params = new HashMap<>();
         params.put("blah", "this is blah");
 
-        HashMap<String, Object> extraContext = new HashMap<String, Object>();
+        HashMap<String, Object> extraContext = new HashMap<>();
         extraContext.put(ActionContext.PARAMETERS, params);
 
         try {

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcherTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcherTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcherTest.java
index 6616413..e6de0b9 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcherTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcherTest.java
@@ -133,9 +133,9 @@ public class ActionConfigMatcherTest extends XWorkTestCase {
     }
 
     private Map<String,ActionConfig> buildActionConfigMap() {
-        Map<String, ActionConfig> map = new HashMap<String,ActionConfig>();
+        Map<String, ActionConfig> map = new HashMap<>();
 
-        HashMap params = new HashMap();
+        HashMap<String, String> params = new HashMap<>();
         params.put("first", "{1}");
         params.put("second", "{2}");
 
@@ -143,7 +143,7 @@ public class ActionConfigMatcherTest extends XWorkTestCase {
                 .methodName("do{2}")
                 .addParams(params)
                 .addExceptionMapping(new ExceptionMappingConfig.Builder("foo{1}", "java.lang.{2}Exception", "success{1}")
-                    .addParams(new HashMap(params))
+                        .addParams(new HashMap<>(params))
                     .build())
                 .addInterceptor(new InterceptorMapping(null, null))
                 .addResultConfig(new ResultConfig.Builder("success{1}", "foo.{2}").addParams(params).build())

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/NamespaceMatcherTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/NamespaceMatcherTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/NamespaceMatcherTest.java
index 1616704..e70f18d 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/NamespaceMatcherTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/impl/NamespaceMatcherTest.java
@@ -24,7 +24,7 @@ import java.util.Set;
 public class NamespaceMatcherTest extends TestCase {
 
     public void testMatch() {
-        Set<String> names = new HashSet<String>();
+        Set<String> names = new HashSet<>();
         names.add("/bar");
         names.add("/foo/*/bar");
         names.add("/foo/*");

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/MockConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/MockConfigurationProvider.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/MockConfigurationProvider.java
index 0d45304..22d748b 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/MockConfigurationProvider.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/MockConfigurationProvider.java
@@ -15,19 +15,11 @@
  */
 package com.opensymphony.xwork2.config.providers;
 
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionChainResult;
-import com.opensymphony.xwork2.ModelDrivenAction;
-import com.opensymphony.xwork2.ObjectFactory;
-import com.opensymphony.xwork2.SimpleAction;
+import com.opensymphony.xwork2.*;
 import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.ConfigurationException;
 import com.opensymphony.xwork2.config.ConfigurationProvider;
-import com.opensymphony.xwork2.config.entities.ActionConfig;
-import com.opensymphony.xwork2.config.entities.InterceptorConfig;
-import com.opensymphony.xwork2.config.entities.InterceptorMapping;
-import com.opensymphony.xwork2.config.entities.PackageConfig;
-import com.opensymphony.xwork2.config.entities.ResultConfig;
+import com.opensymphony.xwork2.config.entities.*;
 import com.opensymphony.xwork2.inject.ContainerBuilder;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor;
@@ -37,11 +29,7 @@ import com.opensymphony.xwork2.mock.MockResult;
 import com.opensymphony.xwork2.util.location.LocatableProperties;
 import com.opensymphony.xwork2.validator.ValidationInterceptor;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
@@ -90,11 +78,11 @@ public class MockConfigurationProvider implements ConfigurationProvider {
     public void loadPackages() {
         
         PackageConfig.Builder defaultPackageContext = new PackageConfig.Builder("defaultPackage");
-        Map<String, String> params = new HashMap<String, String>();
+        Map<String, String> params = new HashMap<>();
         params.put("bar", "5");
 
-        Map<String, ResultConfig> results = new HashMap<String, ResultConfig>();
-        Map<String, String> successParams = new HashMap<String, String>();
+        Map<String, ResultConfig> results = new HashMap<>();
+        Map<String, String> successParams = new HashMap<>();
         successParams.put("actionName", "bar");
         results.put("success", new ResultConfig.Builder("success", ActionChainResult.class.getName()).addParams(successParams).build());
 
@@ -103,12 +91,12 @@ public class MockConfigurationProvider implements ConfigurationProvider {
             .build();
         defaultPackageContext.addActionConfig(FOO_ACTION_NAME, fooActionConfig);
 
-        results = new HashMap<String, ResultConfig>();
-        successParams = new HashMap<String, String>();
+        results = new HashMap<>();
+        successParams = new HashMap<>();
         successParams.put("actionName", "bar");
         results.put("success", new ResultConfig.Builder("success", ActionChainResult.class.getName()).addParams(successParams).build());
 
-        List<InterceptorMapping> interceptors = new ArrayList<InterceptorMapping>();
+        List<InterceptorMapping> interceptors = new ArrayList<>();
         interceptors.add(new InterceptorMapping("params", new ParametersInterceptor()));
 
         ActionConfig paramInterceptorActionConfig = new ActionConfig.Builder("defaultPackage", PARAM_INTERCEPTOR_ACTION_NAME, SimpleAction.class.getName())
@@ -117,7 +105,7 @@ public class MockConfigurationProvider implements ConfigurationProvider {
             .build();
         defaultPackageContext.addActionConfig(PARAM_INTERCEPTOR_ACTION_NAME, paramInterceptorActionConfig);
 
-        interceptors = new ArrayList<InterceptorMapping>();
+        interceptors = new ArrayList<>();
         interceptors.add(new InterceptorMapping("model", 
                 objectFactory.buildInterceptor(new InterceptorConfig.Builder("model", ModelDrivenInterceptor.class.getName()).build(), EMPTY_STRING_MAP)));
         interceptors.add(new InterceptorMapping("params",
@@ -132,15 +120,15 @@ public class MockConfigurationProvider implements ConfigurationProvider {
         //List paramFilterInterceptor=new ArrayList();
         //paramFilterInterceptor.add(new ParameterFilterInterC)
         //ActionConfig modelParamFilterActionConfig = new ActionConfig(null, ModelDrivenAction.class, null, null, interceptors);
-        
 
-        results = new HashMap<String, ResultConfig>();
-        successParams = new HashMap<String, String>();
+
+        results = new HashMap<>();
+        successParams = new HashMap<>();
         successParams.put("actionName", "bar");
         results.put("success", new ResultConfig.Builder("success", ActionChainResult.class.getName()).addParams(successParams).build());
         results.put(Action.ERROR, new ResultConfig.Builder(Action.ERROR, MockResult.class.getName()).build());
 
-        interceptors = new ArrayList<InterceptorMapping>();
+        interceptors = new ArrayList<>();
         interceptors.add(new InterceptorMapping("staticParams", 
                 objectFactory.buildInterceptor(new InterceptorConfig.Builder("model", StaticParametersInterceptor.class.getName()).build(), EMPTY_STRING_MAP)));
         interceptors.add(new InterceptorMapping("model", 
@@ -151,7 +139,7 @@ public class MockConfigurationProvider implements ConfigurationProvider {
                 objectFactory.buildInterceptor(new InterceptorConfig.Builder("model", ValidationInterceptor.class.getName()).build(), EMPTY_STRING_MAP)));
 
         //Explicitly set an out-of-range date for DateRangeValidatorTest
-        params = new HashMap<String, String>();
+        params = new HashMap<>();
         ActionConfig validationActionConfig = new ActionConfig.Builder("defaultPackage", VALIDATION_ACTION_NAME, SimpleAction.class.getName())
             .addInterceptors(interceptors)
             .addParams(params)
@@ -164,7 +152,7 @@ public class MockConfigurationProvider implements ConfigurationProvider {
                 new ActionConfig.Builder(validationActionConfig).name(VALIDATION_SUBPROPERTY_NAME).build());
 
 
-        params = new HashMap<String, String>();
+        params = new HashMap<>();
         ActionConfig percentageActionConfig = new ActionConfig.Builder("defaultPackage", "percentage", SimpleAction.class.getName())
                 .addParams(params)
                 .addResultConfigs(results)

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderActionsTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderActionsTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderActionsTest.java
index 64c0052..2181181 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderActionsTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderActionsTest.java
@@ -59,8 +59,8 @@ public class XmlConfigurationProviderActionsTest extends ConfigurationTestBase {
                 .addParams(params).build();
 
         // foo action is a little more complex, two params, a result and an interceptor stack
-        results = new HashMap<String, ResultConfig>();
-        params = new HashMap<String, String>();
+        results = new HashMap<>();
+        params = new HashMap<>();
         params.put("foo", "18");
         params.put("bar", "24");
         results.put("success", new ResultConfig.Builder("success", MockResult.class.getName()).build());
@@ -75,7 +75,7 @@ public class XmlConfigurationProviderActionsTest extends ConfigurationTestBase {
                 .build();
 
         // wildcard action is simple wildcard example
-        results = new HashMap<String, ResultConfig>();
+        results = new HashMap<>();
         results.put("*", new ResultConfig.Builder("*", MockResult.class.getName()).build());
 
         ActionConfig wildcardAction = new ActionConfig.Builder("", "WildCard", SimpleAction.class.getName())
@@ -87,7 +87,7 @@ public class XmlConfigurationProviderActionsTest extends ConfigurationTestBase {
         params = new HashMap<String, String>();
         params.put("foo", "18");
         params.put("bar", "24");
-        results = new HashMap<String, ResultConfig>();
+        results = new HashMap<>();
         results.put("success", new ResultConfig.Builder("success", MockResult.class.getName()).build());
 
         ExceptionMappingConfig exceptionConfig = new ExceptionMappingConfig.Builder("runtime", "java.lang.RuntimeException", "exception")
@@ -102,12 +102,12 @@ public class XmlConfigurationProviderActionsTest extends ConfigurationTestBase {
                 .build();
 
         // TestInterceptorParam action tests that an interceptor worked
-        HashMap<String, String> interceptorParams = new HashMap<String, String>();
+        HashMap<String, String> interceptorParams = new HashMap<>();
         interceptorParams.put("expectedFoo", "expectedFooValue");
         interceptorParams.put("foo", MockInterceptor.DEFAULT_FOO_VALUE);
 
         InterceptorConfig mockInterceptorConfig = new InterceptorConfig.Builder("test", MockInterceptor.class.getName()).build();
-        interceptors = new ArrayList<InterceptorMapping>();
+        interceptors = new ArrayList<>();
         interceptors.add(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptorConfig, interceptorParams)));
 
         ActionConfig intAction = new ActionConfig.Builder("", "TestInterceptorParam", SimpleAction.class.getName())
@@ -115,10 +115,10 @@ public class XmlConfigurationProviderActionsTest extends ConfigurationTestBase {
                 .build();
 
         // TestInterceptorParamOverride action tests that an interceptor with a param override worked
-        interceptorParams = new HashMap<String, String>();
+        interceptorParams = new HashMap<>();
         interceptorParams.put("expectedFoo", "expectedFooValue");
         interceptorParams.put("foo", "foo123");
-        interceptors = new ArrayList<InterceptorMapping>();
+        interceptors = new ArrayList<>();
         interceptors.add(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptorConfig, interceptorParams)));
 
         ActionConfig intOverAction = new ActionConfig.Builder("", "TestInterceptorParamOverride", SimpleAction.class.getName())
@@ -205,10 +205,10 @@ public class XmlConfigurationProviderActionsTest extends ConfigurationTestBase {
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        params = new HashMap<String, String>();
-        results = new HashMap<String, ResultConfig>();
-        interceptors = new ArrayList<InterceptorMapping>();
-        exceptionMappings = new ArrayList<ExceptionMappingConfig>();
+        params = new HashMap<>();
+        results = new HashMap<>();
+        interceptors = new ArrayList<>();
+        exceptionMappings = new ArrayList<>();
         this.objectFactory = container.getInstance(ObjectFactory.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderAllowedMethodsTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderAllowedMethodsTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderAllowedMethodsTest.java
index af45ac2..6a55e75 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderAllowedMethodsTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderAllowedMethodsTest.java
@@ -1,18 +1,10 @@
 package com.opensymphony.xwork2.config.providers;
 
-import com.opensymphony.xwork2.ActionChainResult;
-import com.opensymphony.xwork2.SimpleAction;
 import com.opensymphony.xwork2.config.ConfigurationException;
 import com.opensymphony.xwork2.config.ConfigurationProvider;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
-import com.opensymphony.xwork2.config.entities.ExceptionMappingConfig;
 import com.opensymphony.xwork2.config.entities.PackageConfig;
-import com.opensymphony.xwork2.config.entities.ResultConfig;
-import com.opensymphony.xwork2.mock.MockResult;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderExceptionMappingsTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderExceptionMappingsTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderExceptionMappingsTest.java
index 6f2af5c..232efd3 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderExceptionMappingsTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderExceptionMappingsTest.java
@@ -26,16 +26,16 @@ public class XmlConfigurationProviderExceptionMappingsTest extends Configuration
         final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-exception-mappings.xml";
         ConfigurationProvider provider = buildConfigurationProvider(filename);
 
-        List<ExceptionMappingConfig> exceptionMappings = new ArrayList<ExceptionMappingConfig>();
-        HashMap<String, String> parameters = new HashMap<String, String>();
-        HashMap<String, ResultConfig> results = new HashMap<String, ResultConfig>();
+        List<ExceptionMappingConfig> exceptionMappings = new ArrayList<>();
+        HashMap<String, String> parameters = new HashMap<>();
+        HashMap<String, ResultConfig> results = new HashMap<>();
 
         exceptionMappings.add(
                 new ExceptionMappingConfig.Builder("spooky-result", "com.opensymphony.xwork2.SpookyException", "spooky-result")
                     .build());
         results.put("spooky-result", new ResultConfig.Builder("spooky-result", MockResult.class.getName()).build());
 
-        Map<String, String> resultParams = new HashMap<String, String>();
+        Map<String, String> resultParams = new HashMap<>();
         resultParams.put("actionName", "bar.vm");
         results.put("specificLocationResult",
                 new ResultConfig.Builder("specificLocationResult", ActionChainResult.class.getName())

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderInterceptorsTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderInterceptorsTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderInterceptorsTest.java
index 0867171..4f26b5f 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderInterceptorsTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderInterceptorsTest.java
@@ -57,7 +57,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
 
         // setup expectations
         // the test interceptor with a parameter
-        Map<String, String> params = new HashMap<String, String>();
+        Map<String, String> params = new HashMap<>();
         params.put("foo", "expectedFoo");
 
         InterceptorConfig paramsInterceptor = new InterceptorConfig.Builder("test", MockInterceptor.class.getName())
@@ -65,15 +65,15 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
 
         // the default interceptor stack
         InterceptorStackConfig defaultStack = new InterceptorStackConfig.Builder("defaultStack")
-                .addInterceptor(new InterceptorMapping("timer", objectFactory.buildInterceptor(timerInterceptor, new HashMap())))
+                .addInterceptor(new InterceptorMapping("timer", objectFactory.buildInterceptor(timerInterceptor, new HashMap<String, String>())))
                 .addInterceptor(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptor, params)))
                 .build();
 
         // the derivative interceptor stack
         InterceptorStackConfig derivativeStack = new InterceptorStackConfig.Builder("derivativeStack")
-            .addInterceptor(new InterceptorMapping("timer", objectFactory.buildInterceptor(timerInterceptor, new HashMap())))
+                .addInterceptor(new InterceptorMapping("timer", objectFactory.buildInterceptor(timerInterceptor, new HashMap<String, String>())))
             .addInterceptor(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptor, params)))
-            .addInterceptor(new InterceptorMapping("logging", objectFactory.buildInterceptor(loggingInterceptor, new HashMap())))
+                .addInterceptor(new InterceptorMapping("logging", objectFactory.buildInterceptor(loggingInterceptor, new HashMap<String, String>())))
             .build();
 
         // execute the configuration
@@ -103,7 +103,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
 
         // expectations - the inherited interceptor stack
         // default package
-        ArrayList<InterceptorMapping> interceptors = new ArrayList<InterceptorMapping>();
+        ArrayList<InterceptorMapping> interceptors = new ArrayList<>();
         interceptors.add(new InterceptorMapping("logging", objectFactory.buildInterceptor(loggingInterceptor, new HashMap<String, String>())));
 
         ActionConfig actionWithOwnRef = new ActionConfig.Builder("", "ActionWithOwnRef", SimpleAction.class.getName())
@@ -120,7 +120,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
             .addInterceptor(new InterceptorMapping("timer", objectFactory.buildInterceptor(timerInterceptor, new HashMap<String, String>())))
             .build();
 
-        interceptors = new ArrayList<InterceptorMapping>();
+        interceptors = new ArrayList<>();
         interceptors.add(new InterceptorMapping("logging", objectFactory.buildInterceptor(loggingInterceptor, new HashMap<String, String>())));
 
         ActionConfig anotherActionWithOwnRef = new ActionConfig.Builder("", "AnotherActionWithOwnRef", SimpleAction.class.getName())
@@ -170,7 +170,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
 
     public void testInterceptorParamOverriding() throws Exception {
 
-        Map<String, String> params = new HashMap<String, String>();
+        Map<String, String> params = new HashMap<>();
         params.put("foo", "expectedFoo");
         params.put("expectedFoo", "expectedFooValue");
 
@@ -179,7 +179,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
             .addInterceptor(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptor, params)))
             .build();
 
-        ArrayList<InterceptorMapping> interceptors = new ArrayList<InterceptorMapping>();
+        ArrayList<InterceptorMapping> interceptors = new ArrayList<>();
         interceptors.addAll(defaultStack.getInterceptors());
 
         ActionConfig intAction = new ActionConfig.Builder("", "TestInterceptorParam", SimpleAction.class.getName())
@@ -187,7 +187,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
             .build();
 
         // TestInterceptorParamOverride action tests that an interceptor with a param override worked
-        HashMap<String, String> interceptorParams = new HashMap<String, String>();
+        HashMap<String, String> interceptorParams = new HashMap<>();
         interceptorParams.put("expectedFoo", "expectedFooValue2");
         interceptorParams.put("foo", "foo123");
 
@@ -196,7 +196,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
             .addInterceptor(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptor, interceptorParams)))
             .build();
 
-        interceptors = new ArrayList<InterceptorMapping>();
+        interceptors = new ArrayList<>();
 
         interceptors.addAll(defaultStack2.getInterceptors());
 

http://git-wip-us.apache.org/repos/asf/struts/blob/2e9df577/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderResultsTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderResultsTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderResultsTest.java
index 468b8d2..caa9da0 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderResultsTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderResultsTest.java
@@ -42,24 +42,24 @@ public class XmlConfigurationProviderResultsTest extends ConfigurationTestBase {
         final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-results.xml";
         ConfigurationProvider provider = buildConfigurationProvider(filename);
 
-        HashMap<String, String> parameters = new HashMap<String, String>();
-        HashMap<String, ResultConfig> results = new HashMap<String, ResultConfig>();
+        HashMap<String, String> parameters = new HashMap<>();
+        HashMap<String, ResultConfig> results = new HashMap<>();
 
         results.put("chainDefaultTypedResult", new ResultConfig.Builder("chainDefaultTypedResult", ActionChainResult.class.getName()).build());
 
         results.put("mockTypedResult", new ResultConfig.Builder("mockTypedResult", MockResult.class.getName()).build());
 
-        Map<String, String> resultParams = new HashMap<String, String>();
+        Map<String, String> resultParams = new HashMap<>();
         resultParams.put("actionName", "bar.vm");
         results.put("specificLocationResult", new ResultConfig.Builder("specificLocationResult", ActionChainResult.class.getName())
                 .addParams(resultParams).build());
 
-        resultParams = new HashMap<String, String>();
+        resultParams = new HashMap<>();
         resultParams.put("actionName", "foo.vm");
         results.put("defaultLocationResult", new ResultConfig.Builder("defaultLocationResult", ActionChainResult.class.getName())
                 .addParams(resultParams).build());
 
-        resultParams = new HashMap<String, String>();
+        resultParams = new HashMap<>();
         resultParams.put("foo", "bar");
         results.put("noDefaultLocationResult", new ResultConfig.Builder("noDefaultLocationResult", ActionChainResult.class.getName())
                 .addParams(resultParams).build());


Mime
View raw message