Skip to content

Commit

Permalink
WW-3714 Move new Result class into result package
Browse files Browse the repository at this point in the history
  • Loading branch information
kusalk committed Nov 2, 2024
1 parent 2203617 commit d351843
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/com/opensymphony/xwork2/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
/**
* {@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 {
Expand All @@ -33,7 +33,7 @@ default void execute(org.apache.struts2.ActionInvocation invocation) throws Exce

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;
}
Expand All @@ -42,9 +42,9 @@ static Result adapt(org.apache.struts2.Result actualResult) {

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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public Result buildResult(ResultConfig resultConfig, Map<String, Object> extraCo

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import com.opensymphony.xwork2.ActionChainResult;
import org.apache.struts2.interceptor.PreResultListener;
import org.apache.struts2.result.Result;
import org.apache.struts2.util.ValueStack;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public Result buildResult(ResultConfig resultConfig, Map<String, Object> extraCo
}
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void allowlist() throws Exception {
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")
Expand Down Expand Up @@ -98,7 +98,7 @@ public void allowlist_1only() throws Exception {
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")
Expand Down Expand Up @@ -129,7 +129,7 @@ public void allowlist_2only() throws Exception {
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")
Expand Down

0 comments on commit d351843

Please sign in to comment.