Skip to content

Commit

Permalink
WW-5468 Remove unneeded annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
kusalk committed Oct 14, 2024
1 parent a57f51c commit 58e19dd
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public String execute() throws Exception {
}

@Override
public Object getModel() {
public Gangster getModel() {
return new Gangster();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ public String getFoo() {
/**
* @return the model to be pushed onto the ValueStack after the Action itself
*/
@StrutsParameter(depth = 2)
@Override
public Object getModel() {
public TestBean getModel() {
return model;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ public String getFoo() {
/**
* @return the model to be pushed onto the ValueStack after the Action itself
*/
@StrutsParameter(depth = 2)
@Override
public Object getModel() {
public AnnotatedTestBean getModel() {
return model;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected void tearDown() throws Exception {
}


public class ModelDrivenAction extends ActionSupport implements ModelDriven {
public class ModelDrivenAction extends ActionSupport implements ModelDriven<Object> {

@Override
public Object getModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package com.opensymphony.xwork2.test;

import com.opensymphony.xwork2.ModelDrivenAction;
import org.apache.struts2.interceptor.parameter.StrutsParameter;


/**
Expand All @@ -35,9 +34,8 @@ public class ModelDrivenAction2 extends ModelDrivenAction {
/**
* @return the model to be pushed onto the ValueStack after the Action itself
*/
@StrutsParameter(depth = 3)
@Override
public Object getModel() {
public TestBean2 getModel() {
return model;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package com.opensymphony.xwork2.test;

import com.opensymphony.xwork2.ModelDrivenAnnotationAction;
import org.apache.struts2.interceptor.parameter.StrutsParameter;


/**
Expand All @@ -36,9 +35,8 @@ public class ModelDrivenAnnotationAction2 extends ModelDrivenAnnotationAction {
/**
* @return the model to be pushed onto the ValueStack after the Action itself
*/
@StrutsParameter(depth = 3)
@Override
public Object getModel() {
public AnnotationTestBean2 getModel() {
return model;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package com.opensymphony.xwork2.test.subtest;

import com.opensymphony.xwork2.ModelDrivenAction;
import com.opensymphony.xwork2.TestBean;

/**
* Extends ModelDrivenAction to return a null model.
Expand All @@ -31,7 +32,7 @@ public class NullModelDrivenAction extends ModelDrivenAction {
* @return the model to be pushed onto the ValueStack instead of the Action itself
*/
@Override
public Object getModel() {
public TestBean getModel() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package com.opensymphony.xwork2.validator;

import com.opensymphony.xwork2.ModelDriven;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import com.opensymphony.xwork2.TestBean;


/**
Expand All @@ -33,9 +33,8 @@ public class VisitorValidatorModelAction extends VisitorValidatorTestAction impl
/**
* @return the model to be pushed onto the ValueStack instead of the Action itself
*/
@StrutsParameter(depth = 2)
@Override
public Object getModel() {
public TestBean getModel() {
return getBean();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import org.apache.struts.beanvalidation.models.Person;
import org.apache.struts2.interceptor.parameter.StrutsParameter;

import jakarta.validation.Valid;
import org.apache.struts.beanvalidation.models.Person;

public class ModelDrivenAction extends ActionSupport implements ModelDriven<Person>, ModelDrivenActionInterface {

@Valid
private final Person model = new Person();

@StrutsParameter(depth = 2)
@Override
public Person getModel() {
return model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import jakarta.validation.Valid;
import org.apache.struts.beanvalidation.constraints.ValidationGroup;
import org.apache.struts.beanvalidation.models.Person;
import org.apache.struts2.interceptor.parameter.StrutsParameter;

import jakarta.validation.Valid;

public class ValidateGroupAction extends ActionSupport implements ModelDriven<Person> {

@Valid
private final Person model = new Person();

@StrutsParameter(depth = 2)
@Override
public Person getModel() {
return model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import jakarta.servlet.http.HttpServletResponse;
import junit.framework.TestCase;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.ognl.StrutsOgnlGuard;
import org.apache.struts2.result.HttpHeaderResult;
import org.springframework.mock.web.MockHttpServletRequest;
Expand Down Expand Up @@ -298,7 +297,6 @@ static class RestAction extends RestActionSupport implements ModelDriven<List<St

List<String> model;

@StrutsParameter(depth = 1)
@Override
public List<String> getModel() {
return model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ public String getFoo() {
/**
* @return the model to be pushed onto the ValueStack after the Action itself
*/
@StrutsParameter(depth = 2)
@Override
public Object getModel() {
public TestBean getModel() {
return model;
}
}

0 comments on commit 58e19dd

Please sign in to comment.