Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fixed gereric base class, for issue 604. #604
- Loading branch information
Showing
4 changed files
with
62 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/test/java/com/alibaba/json/bvt/serializer/GenericTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
package com.alibaba.json.bvt.serializer; | |||
|
|||
import java.io.Serializable; | |||
|
|||
import com.alibaba.fastjson.JSON; | |||
|
|||
import junit.framework.TestCase; | |||
|
|||
public class GenericTypeTest extends TestCase { | |||
|
|||
public void test_gerneric() throws Exception { | |||
MyResultResult result = new MyResultResult(); | |||
JSON.toJSONString(result); | |||
} | |||
|
|||
public static class MyResultResult extends BaseResult<String> { | |||
} | |||
|
|||
public static class BaseResult<T> implements Serializable { | |||
private T data; | |||
public T getData() { | |||
return data; | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
package com.alibaba.json.bvtVO.bbc; | |||
|
|||
|
|||
import java.io.Serializable; | |||
|
|||
public class BaseResult<T> implements Serializable { | |||
private T data; | |||
public T getData() { | |||
return data; | |||
} | |||
public void setData(T data) { | |||
this.data = data; | |||
} | |||
|
|||
|
|||
public BaseResult() { | |||
|
|||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
package com.alibaba.json.bvtVO.bbc; | |||
|
|||
|
|||
public class MyResultResult extends BaseResult<String> { | |||
|
|||
public MyResultResult(){ | |||
|
|||
} | |||
} |