mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
WW-5411 Delete misc deprecated methods from 6.4.0
This commit is contained in:
@@ -310,13 +310,6 @@ public final class StrutsConstants {
|
||||
*/
|
||||
public static final String STRUTS_OGNL_BEANINFO_CACHE_MAXSIZE = "struts.ognl.beanInfoCacheMaxSize";
|
||||
|
||||
/**
|
||||
* @since 6.0.0
|
||||
* @deprecated since 6.4.0, use {@link StrutsConstants#STRUTS_OGNL_BEANINFO_CACHE_TYPE} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String STRUTS_OGNL_BEANINFO_CACHE_LRU_MODE = "struts.ognl.beanInfoCacheLRUMode";
|
||||
|
||||
/**
|
||||
* Logs properties that are not found (very verbose)
|
||||
* @since 6.0.0
|
||||
@@ -372,13 +365,6 @@ public final class StrutsConstants {
|
||||
*/
|
||||
public static final String STRUTS_OGNL_EXPRESSION_CACHE_MAXSIZE = "struts.ognl.expressionCacheMaxSize";
|
||||
|
||||
/**
|
||||
* @since 6.0.0
|
||||
* @deprecated since 6.4.0, use {@link StrutsConstants#STRUTS_OGNL_EXPRESSION_CACHE_TYPE} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String STRUTS_OGNL_EXPRESSION_CACHE_LRU_MODE = "struts.ognl.expressionCacheLRUMode";
|
||||
|
||||
/**
|
||||
* Enables evaluation of OGNL expressions
|
||||
* @since 6.0.0
|
||||
|
||||
@@ -331,14 +331,6 @@ public class Dispatcher {
|
||||
multipartSaveDir = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 6.4.0, no replacement.
|
||||
*/
|
||||
@Deprecated(since = "6.4.0", forRemoval = true)
|
||||
public void setMultipartHandler(String val) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Inject(value = StrutsConstants.STRUTS_MULTIPART_ENABLED, required = false)
|
||||
public void setMultipartSupportEnabled(String multipartSupportEnabled) {
|
||||
this.multipartSupportEnabled = Boolean.parseBoolean(multipartSupportEnabled);
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ import java.util.Map;
|
||||
* <p>
|
||||
* The best way to add behavior to this interceptor is to utilize the {@link ParameterNameAware} interface in your
|
||||
* actions. However, if you wish to apply a global rule that isn't implemented in your action, then you could extend
|
||||
* this interceptor and override the {@link #acceptableName(String)} method.
|
||||
* this interceptor and override the {@link #isAcceptableName(String)} method.
|
||||
* </p>
|
||||
*
|
||||
* <!-- END SNIPPET: extending -->
|
||||
|
||||
+3
-25
@@ -195,7 +195,7 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
|
||||
Map<String, Object> contextMap = actionContext.getContextMap();
|
||||
batchApplyReflectionContextState(contextMap, true);
|
||||
try {
|
||||
setParameters(action, actionContext.getValueStack(), parameters);
|
||||
applyParameters(action, actionContext.getValueStack(), parameters);
|
||||
} finally {
|
||||
batchApplyReflectionContextState(contextMap, false);
|
||||
}
|
||||
@@ -226,14 +226,6 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
|
||||
protected void addParametersToContext(ActionContext ac, Map<String, ?> newParams) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 6.4.0, use {@link #applyParameters}
|
||||
*/
|
||||
@Deprecated
|
||||
protected void setParameters(final Object action, ValueStack stack, HttpParameters parameters) {
|
||||
applyParameters(action, stack, parameters);
|
||||
}
|
||||
|
||||
protected void applyParameters(final Object action, ValueStack stack, HttpParameters parameters) {
|
||||
Map<String, Parameter> acceptableParameters = toAcceptableParameters(parameters, action);
|
||||
|
||||
@@ -328,7 +320,7 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
|
||||
* @return true if parameter is accepted
|
||||
*/
|
||||
protected boolean isAcceptableParameter(String name, Object action) {
|
||||
return acceptableName(name) && isAcceptableParameterNameAware(name, action) && isParameterAnnotatedAndAllowlist(name, action);
|
||||
return isAcceptableName(name) && isAcceptableParameterNameAware(name, action) && isParameterAnnotatedAndAllowlist(name, action);
|
||||
}
|
||||
|
||||
protected boolean isAcceptableParameterNameAware(String name, Object action) {
|
||||
@@ -517,7 +509,7 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
|
||||
* @return true if parameter is accepted
|
||||
*/
|
||||
protected boolean isAcceptableParameterValue(Parameter param, Object action) {
|
||||
return isAcceptableParameterValueAware(param, action) && acceptableValue(param.getName(), param.getValue());
|
||||
return isAcceptableParameterValueAware(param, action) && isAcceptableValue(param.getName(), param.getValue());
|
||||
}
|
||||
|
||||
protected boolean isAcceptableParameterValueAware(Parameter param, Object action) {
|
||||
@@ -544,13 +536,6 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
|
||||
.collect(joining());
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 6.4.0, use {@link #isAcceptableName}
|
||||
*/
|
||||
protected boolean acceptableName(String name) {
|
||||
return isAcceptableName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the name passed is:
|
||||
* * Within the max length of a parameter name
|
||||
@@ -579,13 +564,6 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
|
||||
return DMI_IGNORED_PATTERN.matcher(name).matches();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 6.4.0, use {@link #isAcceptableValue}
|
||||
*/
|
||||
protected boolean acceptableValue(String name, String value) {
|
||||
return isAcceptableValue(name, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates:
|
||||
* * Value is null/blank
|
||||
|
||||
+15
-15
@@ -91,7 +91,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
put("test%test", "test%test");
|
||||
}
|
||||
};
|
||||
pi.setParameters(a, stack, HttpParameters.create(parameters).build());
|
||||
pi.applyParameters(a, stack, HttpParameters.create(parameters).build());
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
|
||||
// when
|
||||
ValidateAction action = new ValidateAction();
|
||||
pi.setParameters(action, vs, HttpParameters.create(params).build());
|
||||
pi.applyParameters(action, vs, HttpParameters.create(params).build());
|
||||
|
||||
// then
|
||||
assertEquals(3, action.getActionErrors().size());
|
||||
@@ -161,7 +161,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
|
||||
// when
|
||||
ValidateAction action = new ValidateAction();
|
||||
pi.setParameters(action, vs, HttpParameters.create(params).build());
|
||||
pi.applyParameters(action, vs, HttpParameters.create(params).build());
|
||||
|
||||
// then
|
||||
assertEquals(0, action.getActionMessages().size());
|
||||
@@ -201,7 +201,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
|
||||
// when
|
||||
ValidateAction action = new ValidateAction();
|
||||
pi.setParameters(action, vs, HttpParameters.create(params).build());
|
||||
pi.applyParameters(action, vs, HttpParameters.create(params).build());
|
||||
|
||||
// then
|
||||
assertEquals(3, action.getActionErrors().size());
|
||||
@@ -321,7 +321,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
|
||||
// when
|
||||
ValidateAction action = new ValidateAction();
|
||||
pi.setParameters(action, vs, HttpParameters.create(params).build());
|
||||
pi.applyParameters(action, vs, HttpParameters.create(params).build());
|
||||
|
||||
// then
|
||||
assertEquals(0, action.getActionMessages().size());
|
||||
@@ -436,7 +436,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
parameters.put("huuhaa", "");
|
||||
|
||||
Action action = new SimpleAction();
|
||||
parametersInterceptor.setParameters(action, stack, HttpParameters.create(parameters).build());
|
||||
parametersInterceptor.applyParameters(action, stack, HttpParameters.create(parameters).build());
|
||||
assertEquals(1, actual.size());
|
||||
}
|
||||
|
||||
@@ -630,7 +630,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
parameters.put("user.name", "Superman");
|
||||
|
||||
Action action = new SimpleAction();
|
||||
pi.setParameters(action, stack, HttpParameters.create(parameters).build());
|
||||
pi.applyParameters(action, stack, HttpParameters.create(parameters).build());
|
||||
|
||||
assertEquals("ordered should be false by default", false, pi.isOrdered());
|
||||
assertEquals(2, actual.size());
|
||||
@@ -657,7 +657,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
parameters.put("user.name", "Superman");
|
||||
|
||||
Action action = new SimpleAction();
|
||||
pi.setParameters(action, stack, HttpParameters.create(parameters).build());
|
||||
pi.applyParameters(action, stack, HttpParameters.create(parameters).build());
|
||||
|
||||
assertEquals(true, pi.isOrdered());
|
||||
assertEquals(3, actual.size());
|
||||
@@ -697,7 +697,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
put("fooKey", "fooValue");
|
||||
}
|
||||
};
|
||||
pi.setParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
pi.applyParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@@ -728,7 +728,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
};
|
||||
|
||||
// when
|
||||
interceptor.setParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
interceptor.applyParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
|
||||
// then
|
||||
assertEquals(expected, actual);
|
||||
@@ -755,7 +755,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
};
|
||||
|
||||
// when
|
||||
interceptor.setParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
interceptor.applyParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
|
||||
// then
|
||||
assertEquals(expected, actual);
|
||||
@@ -807,7 +807,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
put("fooKey2", "");
|
||||
}
|
||||
};
|
||||
pi.setParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
pi.applyParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
put("fooKey2", "");
|
||||
}
|
||||
};
|
||||
pi.setParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
pi.applyParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@@ -883,7 +883,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
put("fooKey2", "");
|
||||
}
|
||||
};
|
||||
pi.setParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
pi.applyParameters(new NoParametersAction(), stack, HttpParameters.create(parameters).build());
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@@ -927,7 +927,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
put("fooKey3", "");
|
||||
}
|
||||
};
|
||||
pi.setParameters(a, stack, HttpParameters.create(parameters).build());
|
||||
pi.applyParameters(a, stack, HttpParameters.create(parameters).build());
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user