Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
import ognl.Ognl;
import ognl.OgnlContext;
import com.opensymphony.xwork2.util.OgnlValueStack;
import java.io.Serializable;
public class OGNLDebug {
public static void main(String[] argv)
{ Result result = new Result(); OgnlValueStack stack = new OgnlValueStack(); stack.push(result); stack.setValue("example.param", "0"); stack.setValue("brokenExample.param", "0"); System.out.println("example.param: " + result.getExample().getParam() ); System.out.println("brokenExample.param: " + result.getBrokenExample().getParam() ); }}
class Result {
private Example example = new Example();
private BrokenExample brokenExample = new BrokenExample();
public Result() {
}
public Example getExample()
{ return example; }public void setExample(Example example)
{ this.example = example; }public BrokenExample getBrokenExample()
{ return brokenExample; }public void setBrokenExample(BrokenExample brokenExample)
{ this.brokenExample = brokenExample; }}
class Example {
private Integer param;
public Integer getParam()
{ return param; }public void setParam(Integer param) { this.param = param; }
}
interface Cracker<T extends Serializable>{ T getParam(); void setParam(T param); }
class BrokenExample implements Cracker<Integer>{
private Integer param;
public Integer getParam() { return param; }
public void setParam(Integer param)
{ this.param = param; }}
Expected result
example.param: 0
brokenExample.param: 0
Actual result:
example.param: 0
brokenExample.param : null
Attachments
Issue Links
- duplicates
-
OGNL-80 CastCastException when setting properties on objects that use generics in superclass properties
- Resolved