The following issues were found
src/test/java/com/alibaba/json/bvt/CastTest.java
7 issues
Line: 28
text = JSON.toJSONString(list);
System.out.println(text);
}
JSONArray array = JSON.parseArray(text);
// Body body = array.getObject(1, Body.class);
Reported by PMD.
Line: 14
public class CastTest extends TestCase {
public void test_0() throws Exception {
String text;
{
List<Object> list = new ArrayList<Object>();
list.add(new Header());
Reported by PMD.
Line: 14
public class CastTest extends TestCase {
public void test_0() throws Exception {
String text;
{
List<Object> list = new ArrayList<Object>();
list.add(new Header());
Reported by PMD.
Line: 31
System.out.println(text);
}
JSONArray array = JSON.parseArray(text);
// Body body = array.getObject(1, Body.class);
// Assert.assertEquals(1, body.getItems().size());
// Assert.assertEquals("张三", body.getName());
Reported by PMD.
Line: 43
}
public static class Body {
private String name;
public Body(){
Reported by PMD.
Line: 6
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import junit.framework.TestCase;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
Reported by PMD.
Line: 31
System.out.println(text);
}
JSONArray array = JSON.parseArray(text);
// Body body = array.getObject(1, Body.class);
// Assert.assertEquals(1, body.getItems().size());
// Assert.assertEquals("张三", body.getName());
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_yaoming.java
7 issues
Line: 13
public class Bug_for_yaoming extends TestCase {
public void test_bug() throws Exception {
SimpleHttpReuslt v = new SimpleHttpReuslt();
v.setErrorMessage(new ArrayList<ErrorMessage>());
v.getErrorMessage().add(new ErrorMessage());
String text = JSON.toJSONString(v);
text = "{\"content\":{\"versionModelList\":[{\"version\":\"260\",\"currentVersion\":true,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375850777000},{\"version\":\"247\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375634817000},{\"version\":\"246\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375613193000},{\"version\":\"245\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375591593000},{\"version\":\"244\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375569999000},{\"version\":\"243\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375548418000}],\"exceptionCode\":0},\"hasError\":false}";
Reported by PMD.
Line: 13
public class Bug_for_yaoming extends TestCase {
public void test_bug() throws Exception {
SimpleHttpReuslt v = new SimpleHttpReuslt();
v.setErrorMessage(new ArrayList<ErrorMessage>());
v.getErrorMessage().add(new ErrorMessage());
String text = JSON.toJSONString(v);
text = "{\"content\":{\"versionModelList\":[{\"version\":\"260\",\"currentVersion\":true,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375850777000},{\"version\":\"247\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375634817000},{\"version\":\"246\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375613193000},{\"version\":\"245\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375591593000},{\"version\":\"244\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375569999000},{\"version\":\"243\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375548418000}],\"exceptionCode\":0},\"hasError\":false}";
Reported by PMD.
Line: 17
SimpleHttpReuslt v = new SimpleHttpReuslt();
v.setErrorMessage(new ArrayList<ErrorMessage>());
v.getErrorMessage().add(new ErrorMessage());
String text = JSON.toJSONString(v);
text = "{\"content\":{\"versionModelList\":[{\"version\":\"260\",\"currentVersion\":true,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375850777000},{\"version\":\"247\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375634817000},{\"version\":\"246\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375613193000},{\"version\":\"245\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375591593000},{\"version\":\"244\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375569999000},{\"version\":\"243\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375548418000}],\"exceptionCode\":0},\"hasError\":false}";
JSON.parseObject(text, SimpleHttpReuslt.class);
}
public static class SimpleHttpReuslt {
Reported by PMD.
Line: 22
JSON.parseObject(text, SimpleHttpReuslt.class);
}
public static class SimpleHttpReuslt {
private String content;
private Boolean hasError;
private List<ErrorMessage> errorMessage;
Reported by PMD.
Line: 25
public static class SimpleHttpReuslt {
private String content;
private Boolean hasError;
private List<ErrorMessage> errorMessage;
public String getContent() {
return content;
}
Reported by PMD.
Line: 52
this.errorMessage = errorMessage;
}
public static class ErrorMessage {
private String field;
private String code;
private String msg;
Reported by PMD.
Line: 17
SimpleHttpReuslt v = new SimpleHttpReuslt();
v.setErrorMessage(new ArrayList<ErrorMessage>());
v.getErrorMessage().add(new ErrorMessage());
String text = JSON.toJSONString(v);
text = "{\"content\":{\"versionModelList\":[{\"version\":\"260\",\"currentVersion\":true,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375850777000},{\"version\":\"247\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375634817000},{\"version\":\"246\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375613193000},{\"version\":\"245\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375591593000},{\"version\":\"244\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130186\",\"appIdentifier\":\"parent\",\"uploadTime\":1375569999000},{\"version\":\"243\",\"currentVersion\":false,\"versionComment\":\"testVersion\",\"warSize\":\"43130185\",\"appIdentifier\":\"parent\",\"uploadTime\":1375548418000}],\"exceptionCode\":0},\"hasError\":false}";
JSON.parseObject(text, SimpleHttpReuslt.class);
}
public static class SimpleHttpReuslt {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/CastTest2.java
7 issues
Line: 30
text = JSON.toJSONString(list);
System.out.println(text);
}
JSONArray array = JSON.parseArray(text);
Body body = array.getObject(1, Body.class);
Reported by PMD.
Line: 16
public class CastTest2 extends TestCase {
public void test_0() throws Exception {
String text;
{
List<Object> list = new ArrayList<Object>();
list.add(new Header());
Reported by PMD.
Line: 35
JSONArray array = JSON.parseArray(text);
Body body = array.getObject(1, Body.class);
Assert.assertEquals("张三", body.getName());
Assert.assertEquals(1, body.getItems().size());
}
Reported by PMD.
Line: 37
Body body = array.getObject(1, Body.class);
Assert.assertEquals("张三", body.getName());
Assert.assertEquals(1, body.getItems().size());
}
public static class Header {
Reported by PMD.
Line: 38
Body body = array.getObject(1, Body.class);
Assert.assertEquals("张三", body.getName());
Assert.assertEquals(1, body.getItems().size());
}
public static class Header {
}
Reported by PMD.
Line: 38
Body body = array.getObject(1, Body.class);
Assert.assertEquals("张三", body.getName());
Assert.assertEquals(1, body.getItems().size());
}
public static class Header {
}
Reported by PMD.
Line: 45
}
public static class Body {
private String name;
public Body(){
Reported by PMD.
src/test/java/com/alibaba/json/bvt/builder/BuilderTest1.java
7 issues
Line: 12
public class BuilderTest1 extends TestCase {
public void test_create() throws Exception {
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
Reported by PMD.
Line: 15
public void test_create() throws Exception {
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
@JSONType(builder=VOBuilder.class)
public static class VO {
Reported by PMD.
Line: 16
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
Reported by PMD.
Line: 21
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
private String name;
public int getId() {
return id;
}
Reported by PMD.
Line: 22
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
private String name;
public int getId() {
return id;
}
Reported by PMD.
Line: 35
public static class VOBuilder {
private VO vo = new VO();
public VO create() {
return vo;
}
Reported by PMD.
Line: 35
public static class VOBuilder {
private VO vo = new VO();
public VO create() {
return vo;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Issue_for_zuojing.java
7 issues
Line: 12
* Created by wenshao on 15/02/2017.
*/
public class Issue_for_zuojing extends TestCase {
public void test_for_zuojing() throws Exception {
String rowData = "[{\"@type\":\"java.util.HashMap\",\"end_date\":{\"@type\":\"java.sql.Date\",\"val\":1490803200000},\"gmt_create\":{\"@type\":\"java.sql.Timestamp\",\"val\":1487139144000},\"arr_city\":\"FOC\",\"agent\n" +
"_id\":4765L,\"auto_book\":0B,\"sale_rebase\":12,\"channel\":1B,\"dep_city\":\"BJS\",\"gmt_modified\":{\"@type\":\"java.sql.Timestamp\",\"val\":1487139144000},\"is_support_share\":1B,\"sale_retenti\n" +
"on\":430S,\"invoice_type\":5B,\"id\":12675100456,\"start_date\":{\"@type\":\"java.sql.Date\",\"val\":1485878400000},\"pat\":1B,\"agent_sub_nick\":\"辰\",\"travel_start_date\":{\"@type\"\n" +
":\"java.sql.Date\",\"val\":1485878400000},\"policy_type\":2B,\"travel_end_date\":{\"@type\":\"java.sql.Date\",\"val\":1490803200000},\"flights_limit_type\":1B,\"officeid\":\"WNZ159\",\"future_tic\n" +
"ket\":0B,\"fare_id\":80L,\"source_id\":4653492L,\"source_code\":32B,\"agent_sub_id\":2752916259,\"flights_limit\":\"1100-1999,4000-4999,8200-8230,8960\"},{\"$ref\":\"$[0]\"}]";
Reported by PMD.
Line: 12
* Created by wenshao on 15/02/2017.
*/
public class Issue_for_zuojing extends TestCase {
public void test_for_zuojing() throws Exception {
String rowData = "[{\"@type\":\"java.util.HashMap\",\"end_date\":{\"@type\":\"java.sql.Date\",\"val\":1490803200000},\"gmt_create\":{\"@type\":\"java.sql.Timestamp\",\"val\":1487139144000},\"arr_city\":\"FOC\",\"agent\n" +
"_id\":4765L,\"auto_book\":0B,\"sale_rebase\":12,\"channel\":1B,\"dep_city\":\"BJS\",\"gmt_modified\":{\"@type\":\"java.sql.Timestamp\",\"val\":1487139144000},\"is_support_share\":1B,\"sale_retenti\n" +
"on\":430S,\"invoice_type\":5B,\"id\":12675100456,\"start_date\":{\"@type\":\"java.sql.Date\",\"val\":1485878400000},\"pat\":1B,\"agent_sub_nick\":\"辰\",\"travel_start_date\":{\"@type\"\n" +
":\"java.sql.Date\",\"val\":1485878400000},\"policy_type\":2B,\"travel_end_date\":{\"@type\":\"java.sql.Date\",\"val\":1490803200000},\"flights_limit_type\":1B,\"officeid\":\"WNZ159\",\"future_tic\n" +
"ket\":0B,\"fare_id\":80L,\"source_id\":4653492L,\"source_code\":32B,\"agent_sub_id\":2752916259,\"flights_limit\":\"1100-1999,4000-4999,8200-8230,8960\"},{\"$ref\":\"$[0]\"}]";
Reported by PMD.
Line: 19
":\"java.sql.Date\",\"val\":1485878400000},\"policy_type\":2B,\"travel_end_date\":{\"@type\":\"java.sql.Date\",\"val\":1490803200000},\"flights_limit_type\":1B,\"officeid\":\"WNZ159\",\"future_tic\n" +
"ket\":0B,\"fare_id\":80L,\"source_id\":4653492L,\"source_code\":32B,\"agent_sub_id\":2752916259,\"flights_limit\":\"1100-1999,4000-4999,8200-8230,8960\"},{\"$ref\":\"$[0]\"}]";
List row = JSON.parseObject(rowData,List.class);
assertEquals(2, row.size());
assertSame(row.get(0), row.get(1));
}
}
Reported by PMD.
Line: 19
":\"java.sql.Date\",\"val\":1485878400000},\"policy_type\":2B,\"travel_end_date\":{\"@type\":\"java.sql.Date\",\"val\":1490803200000},\"flights_limit_type\":1B,\"officeid\":\"WNZ159\",\"future_tic\n" +
"ket\":0B,\"fare_id\":80L,\"source_id\":4653492L,\"source_code\":32B,\"agent_sub_id\":2752916259,\"flights_limit\":\"1100-1999,4000-4999,8200-8230,8960\"},{\"$ref\":\"$[0]\"}]";
List row = JSON.parseObject(rowData,List.class);
assertEquals(2, row.size());
assertSame(row.get(0), row.get(1));
}
}
Reported by PMD.
Line: 20
"ket\":0B,\"fare_id\":80L,\"source_id\":4653492L,\"source_code\":32B,\"agent_sub_id\":2752916259,\"flights_limit\":\"1100-1999,4000-4999,8200-8230,8960\"},{\"$ref\":\"$[0]\"}]";
List row = JSON.parseObject(rowData,List.class);
assertEquals(2, row.size());
assertSame(row.get(0), row.get(1));
}
}
Reported by PMD.
Line: 20
"ket\":0B,\"fare_id\":80L,\"source_id\":4653492L,\"source_code\":32B,\"agent_sub_id\":2752916259,\"flights_limit\":\"1100-1999,4000-4999,8200-8230,8960\"},{\"$ref\":\"$[0]\"}]";
List row = JSON.parseObject(rowData,List.class);
assertEquals(2, row.size());
assertSame(row.get(0), row.get(1));
}
}
Reported by PMD.
Line: 20
"ket\":0B,\"fare_id\":80L,\"source_id\":4653492L,\"source_code\":32B,\"agent_sub_id\":2752916259,\"flights_limit\":\"1100-1999,4000-4999,8200-8230,8960\"},{\"$ref\":\"$[0]\"}]";
List row = JSON.parseObject(rowData,List.class);
assertEquals(2, row.size());
assertSame(row.get(0), row.get(1));
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/IntArrayFieldTest_primitive.java
7 issues
Line: 12
public class IntArrayFieldTest_primitive extends TestCase {
public void test_array() throws Exception {
Assert.assertEquals("[1]", JSON.toJSONString(new int[] { 1 }));
}
public void test_codec_null() throws Exception {
Reported by PMD.
Line: 17
}
public void test_codec_null() throws Exception {
V0 v = new V0();
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
Reported by PMD.
Line: 28
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_codec_null_1() throws Exception {
V0 v = new V0();
Reported by PMD.
Line: 31
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_codec_null_1() throws Exception {
V0 v = new V0();
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
Reported by PMD.
Line: 46
private int[] value;
public int[] getValue() {
return value;
}
public void setValue(int[] value) {
this.value = value;
}
Reported by PMD.
Line: 49
return value;
}
public void setValue(int[] value) {
this.value = value;
}
}
}
Reported by PMD.
Line: 49
return value;
}
public void setValue(int[] value) {
this.value = value;
}
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Issue569.java
7 issues
Line: 15
* Created by wenshao on 02/07/2017.
*/
public class Issue569 extends TestCase {
public void test_for_issue() throws Exception {
String jsonString = "{\"backingMap\":{\"a\":{\"b\":{}}}}";
Type type = new TypeReference<MyTable<String, String, MyValue>>() {}.getType();
MyTable<String, String, MyValue> table = JSON.parseObject(jsonString, type);
Map<String, MyValue> valueMap = table.backingMap.get("a");
Reported by PMD.
Line: 15
* Created by wenshao on 02/07/2017.
*/
public class Issue569 extends TestCase {
public void test_for_issue() throws Exception {
String jsonString = "{\"backingMap\":{\"a\":{\"b\":{}}}}";
Type type = new TypeReference<MyTable<String, String, MyValue>>() {}.getType();
MyTable<String, String, MyValue> table = JSON.parseObject(jsonString, type);
Map<String, MyValue> valueMap = table.backingMap.get("a");
Reported by PMD.
Line: 20
Type type = new TypeReference<MyTable<String, String, MyValue>>() {}.getType();
MyTable<String, String, MyValue> table = JSON.parseObject(jsonString, type);
Map<String, MyValue> valueMap = table.backingMap.get("a");
assertNotNull(valueMap);
MyValue value = valueMap.get("b");
assertNotNull(value);
}
Reported by PMD.
Line: 21
MyTable<String, String, MyValue> table = JSON.parseObject(jsonString, type);
Map<String, MyValue> valueMap = table.backingMap.get("a");
assertNotNull(valueMap);
MyValue value = valueMap.get("b");
assertNotNull(value);
}
Reported by PMD.
Line: 23
Map<String, MyValue> valueMap = table.backingMap.get("a");
assertNotNull(valueMap);
MyValue value = valueMap.get("b");
assertNotNull(value);
}
public static class MyTable<R, C, V> implements Serializable {
private Map<R, Map<C, V>> backingMap;
Reported by PMD.
Line: 24
assertNotNull(valueMap);
MyValue value = valueMap.get("b");
assertNotNull(value);
}
public static class MyTable<R, C, V> implements Serializable {
private Map<R, Map<C, V>> backingMap;
Reported by PMD.
Line: 27
assertNotNull(value);
}
public static class MyTable<R, C, V> implements Serializable {
private Map<R, Map<C, V>> backingMap;
public Map<R, Map<C, V>> getBackingMap() {
return backingMap;
}
Reported by PMD.
src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectK1.java
7 issues
Line: 9
import java.util.List;
public class ObjectK1 {
private int a = 0;
private boolean b = false;
Reported by PMD.
Line: 12
public class ObjectK1 {
private int a = 0;
private boolean b = false;
private int c = 0;
Reported by PMD.
Line: 14
private int a = 0;
private boolean b = false;
private int c = 0;
private int d = 0;
Reported by PMD.
Line: 16
private boolean b = false;
private int c = 0;
private int d = 0;
private int e = 0;
Reported by PMD.
Line: 18
private int c = 0;
private int d = 0;
private int e = 0;
private List<CommonObject> f;
Reported by PMD.
Line: 20
private int d = 0;
private int e = 0;
private List<CommonObject> f;
private List<ObjectK1_A> g;
Reported by PMD.
Line: 31
private int h = 0;
private List<ObjectK1_C> i;
public int getA() {
return a;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_318.java
7 issues
Line: 17
public class Bug_for_issue_318 extends TestCase {
public void test_for_issue() throws Exception {
Person o1 = new Person("zhangsan", 20);
Person o2 = new Person("liuXX", 30);
Person o3 = new Person("Test", 10);
List<Person> users = new ArrayList<Person>();
Reported by PMD.
Line: 59
//
// System.out.println(JSON.toJSONString(target));
Assert.assertNotNull(target.getUsers().get(0));
Assert.assertNotNull(target.getManagers().get(0));
}
private static class Person {
private String name;
Reported by PMD.
Line: 59
//
// System.out.println(JSON.toJSONString(target));
Assert.assertNotNull(target.getUsers().get(0));
Assert.assertNotNull(target.getManagers().get(0));
}
private static class Person {
private String name;
Reported by PMD.
Line: 60
// System.out.println(JSON.toJSONString(target));
Assert.assertNotNull(target.getUsers().get(0));
Assert.assertNotNull(target.getManagers().get(0));
}
private static class Person {
private String name;
private Integer age;
Reported by PMD.
Line: 60
// System.out.println(JSON.toJSONString(target));
Assert.assertNotNull(target.getUsers().get(0));
Assert.assertNotNull(target.getManagers().get(0));
}
private static class Person {
private String name;
private Integer age;
Reported by PMD.
Line: 63
Assert.assertNotNull(target.getManagers().get(0));
}
private static class Person {
private String name;
private Integer age;
public Person(){}
Reported by PMD.
Line: 88
}
}
private static class PersonAll {
private Map<String, List<Person>> userMap = new HashMap<String, List<Person>>();
private Integer count;
private List<Person> users;
private List<Person> managers;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_330.java
7 issues
Line: 14
public class Bug_for_issue_330 extends TestCase {
public void test_for_issue() throws Exception {
String jsonContent = "{\"data\":{\"content\":\"xxx\",\"hour\":1}}";
StatusBean<WorkBean> bean = JSONObject.parseObject(jsonContent,
new TypeReference<StatusBean<WorkBean>>() {
});
Reported by PMD.
Line: 21
});
Assert.assertNotNull(bean.getData());
Assert.assertEquals(1, bean.getData().getHour());
Assert.assertEquals("xxx", bean.getData().getContent());
}
public static class StatusBean<T> {
Reported by PMD.
Line: 22
Assert.assertNotNull(bean.getData());
Assert.assertEquals(1, bean.getData().getHour());
Assert.assertEquals("xxx", bean.getData().getContent());
}
public static class StatusBean<T> {
private int code;
Reported by PMD.
Line: 25
Assert.assertEquals("xxx", bean.getData().getContent());
}
public static class StatusBean<T> {
private int code;
private String msg;
private T data;
Reported by PMD.
Line: 57
}
public static class WorkBean {
private int hour;
private String content;
public int getHour() {
Reported by PMD.
Line: 5
import org.junit.Assert;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
import junit.framework.TestCase;
Reported by PMD.
Line: 8
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
import junit.framework.TestCase;
public class Bug_for_issue_330 extends TestCase {
Reported by PMD.