mirror of
https://github.com/apache/struts.git
synced 2026-08-06 23:27:07 +00:00
fixed some generics related warnings and did a little re-formatting
This commit is contained in:
+3
-2
@@ -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 {
|
||||
|
||||
+7
-5
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user