mirror of
https://github.com/apache/struts.git
synced 2026-08-05 22:56:59 +00:00
WW-3714 Move new Result class into result package
This commit is contained in:
@@ -21,10 +21,10 @@ package com.opensymphony.xwork2;
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated since 6.7.0, use {@link org.apache.struts2.Result} instead.
|
||||
* @deprecated since 6.7.0, use {@link org.apache.struts2.result.Result} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface Result extends org.apache.struts2.Result {
|
||||
public interface Result extends org.apache.struts2.result.Result {
|
||||
|
||||
@Override
|
||||
default void execute(org.apache.struts2.ActionInvocation invocation) throws Exception {
|
||||
@@ -33,7 +33,7 @@ public interface Result extends org.apache.struts2.Result {
|
||||
|
||||
void execute(ActionInvocation invocation) throws Exception;
|
||||
|
||||
static Result adapt(org.apache.struts2.Result actualResult) {
|
||||
static Result adapt(org.apache.struts2.result.Result actualResult) {
|
||||
if (actualResult instanceof Result) {
|
||||
return (Result) actualResult;
|
||||
}
|
||||
@@ -42,9 +42,9 @@ public interface Result extends org.apache.struts2.Result {
|
||||
|
||||
class LegacyAdapter implements Result {
|
||||
|
||||
private final org.apache.struts2.Result adaptee;
|
||||
private final org.apache.struts2.result.Result adaptee;
|
||||
|
||||
private LegacyAdapter(org.apache.struts2.Result adaptee) {
|
||||
private LegacyAdapter(org.apache.struts2.result.Result adaptee) {
|
||||
this.adaptee = adaptee;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ public class DefaultResultFactory implements ResultFactory {
|
||||
|
||||
if (o instanceof Result) {
|
||||
result = (Result) o;
|
||||
} else if (o instanceof org.apache.struts2.Result) {
|
||||
result = Result.adapt((org.apache.struts2.Result) o);
|
||||
} else if (o instanceof org.apache.struts2.result.Result) {
|
||||
result = Result.adapt((org.apache.struts2.result.Result) o);
|
||||
}
|
||||
if (result == null) {
|
||||
throw new ConfigurationException("Class [" + resultClassName + "] does not implement Result", resultConfig);
|
||||
|
||||
@@ -20,6 +20,7 @@ package org.apache.struts2;
|
||||
|
||||
import com.opensymphony.xwork2.ActionChainResult;
|
||||
import org.apache.struts2.interceptor.PreResultListener;
|
||||
import org.apache.struts2.result.Result;
|
||||
import org.apache.struts2.util.ValueStack;
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,8 +61,8 @@ public class StrutsResultFactory implements ResultFactory {
|
||||
}
|
||||
if (o instanceof Result) {
|
||||
result = (Result) o;
|
||||
} else if (o instanceof org.apache.struts2.Result) {
|
||||
result = Result.adapt((org.apache.struts2.Result) o);
|
||||
} else if (o instanceof org.apache.struts2.result.Result) {
|
||||
result = Result.adapt((org.apache.struts2.result.Result) o);
|
||||
}
|
||||
if (result == null) {
|
||||
throw new ConfigurationException("Class [" + resultClassName + "] does not implement Result", resultConfig);
|
||||
|
||||
@@ -27,9 +27,9 @@ import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.struts2.ActionInvocation;
|
||||
import org.apache.struts2.Result;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.Unchainable;
|
||||
import org.apache.struts2.result.Result;
|
||||
import org.apache.struts2.util.ValueStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
+4
-1
@@ -16,7 +16,10 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import org.apache.struts2.Action;
|
||||
import org.apache.struts2.ActionInvocation;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
+3
-3
@@ -66,7 +66,7 @@ public class ConfigurationProviderOgnlAllowlistTest extends XWorkJUnit4TestCase
|
||||
Class.forName("com.opensymphony.xwork2.SimpleAction"),
|
||||
Class.forName("org.apache.struts2.interceptor.Interceptor"),
|
||||
Class.forName("org.apache.struts2.interceptor.ConditionalInterceptor"),
|
||||
Class.forName("org.apache.struts2.Result"),
|
||||
Class.forName("org.apache.struts2.result.Result"),
|
||||
Class.forName("org.apache.struts2.Action"),
|
||||
Class.forName("org.apache.struts2.Validateable"),
|
||||
Class.forName("org.apache.struts2.interceptor.ValidationAware")
|
||||
@@ -98,7 +98,7 @@ public class ConfigurationProviderOgnlAllowlistTest extends XWorkJUnit4TestCase
|
||||
Class.forName("com.opensymphony.xwork2.SimpleAction"),
|
||||
Class.forName("org.apache.struts2.interceptor.Interceptor"),
|
||||
Class.forName("org.apache.struts2.interceptor.ConditionalInterceptor"),
|
||||
Class.forName("org.apache.struts2.Result"),
|
||||
Class.forName("org.apache.struts2.result.Result"),
|
||||
Class.forName("org.apache.struts2.Action"),
|
||||
Class.forName("org.apache.struts2.Validateable"),
|
||||
Class.forName("org.apache.struts2.interceptor.ValidationAware")
|
||||
@@ -129,7 +129,7 @@ public class ConfigurationProviderOgnlAllowlistTest extends XWorkJUnit4TestCase
|
||||
Class.forName("com.opensymphony.xwork2.Result"),
|
||||
Class.forName("org.apache.struts2.interceptor.Interceptor"),
|
||||
Class.forName("org.apache.struts2.interceptor.ConditionalInterceptor"),
|
||||
Class.forName("org.apache.struts2.Result"),
|
||||
Class.forName("org.apache.struts2.result.Result"),
|
||||
Class.forName("org.apache.struts2.Action"),
|
||||
Class.forName("org.apache.struts2.Validateable"),
|
||||
Class.forName("org.apache.struts2.interceptor.ValidationAware")
|
||||
|
||||
Reference in New Issue
Block a user