The following issues were found
src/test/java/com/alibaba/json/bvt/bug/Bug_for_lenolix_7.java
8 issues
Line: 32
user.setGmtModified(new java.sql.Timestamp(new Date().getTime()));
String userJSON = JSON.toJSONString(user, SerializerFeature.WriteClassName, SerializerFeature.WriteMapNullValue);
System.out.println(userJSON);
User returnUser = (User) JSON.parse(userJSON);
}
Reported by PMD.
Line: 15
import junit.framework.TestCase;
public class Bug_for_lenolix_7 extends TestCase {
protected void setUp() throws Exception {
JSON.defaultTimeZone = TimeZone.getTimeZone("Asia/Shanghai");
JSON.defaultLocale = Locale.CHINA;
ParserConfig.global.addAccept("com.alibaba.json.bvt.bug.Bug_for_lenolix_7");
}
Reported by PMD.
Line: 19
JSON.defaultTimeZone = TimeZone.getTimeZone("Asia/Shanghai");
JSON.defaultLocale = Locale.CHINA;
ParserConfig.global.addAccept("com.alibaba.json.bvt.bug.Bug_for_lenolix_7");
}
public void test_for_objectKey() throws Exception {
User user = new User();
user.setId(1);
Reported by PMD.
Line: 22
ParserConfig.global.addAccept("com.alibaba.json.bvt.bug.Bug_for_lenolix_7");
}
public void test_for_objectKey() throws Exception {
User user = new User();
user.setId(1);
user.setName("leno.lix");
user.setIsBoy(true);
user.setBirthDay(new Date());
Reported by PMD.
Line: 22
ParserConfig.global.addAccept("com.alibaba.json.bvt.bug.Bug_for_lenolix_7");
}
public void test_for_objectKey() throws Exception {
User user = new User();
user.setId(1);
user.setName("leno.lix");
user.setIsBoy(true);
user.setBirthDay(new Date());
Reported by PMD.
Line: 34
System.out.println(userJSON);
User returnUser = (User) JSON.parse(userJSON);
}
private static class User implements Serializable {
Reported by PMD.
Line: 38
}
private static class User implements Serializable {
/**
*
*/
Reported by PMD.
Line: 34
System.out.println(userJSON);
User returnUser = (User) JSON.parse(userJSON);
}
private static class User implements Serializable {
Reported by PMD.
src/main/java/com/alibaba/fastjson/parser/deserializer/JSONPDeserializer.java
8 issues
Line: 20
SymbolTable symbolTable = parser.getSymbolTable();
String funcName = lexer.scanSymbolUnQuoted(symbolTable);
lexer.nextToken();
int tok = lexer.token();
if (tok == JSONToken.DOT) {
Reported by PMD.
Line: 21
SymbolTable symbolTable = parser.getSymbolTable();
String funcName = lexer.scanSymbolUnQuoted(symbolTable);
lexer.nextToken();
int tok = lexer.token();
if (tok == JSONToken.DOT) {
String name = lexer.scanSymbolUnQuoted(parser.getSymbolTable());
Reported by PMD.
Line: 23
String funcName = lexer.scanSymbolUnQuoted(symbolTable);
lexer.nextToken();
int tok = lexer.token();
if (tok == JSONToken.DOT) {
String name = lexer.scanSymbolUnQuoted(parser.getSymbolTable());
funcName += ".";
funcName += name;
Reported by PMD.
Line: 28
if (tok == JSONToken.DOT) {
String name = lexer.scanSymbolUnQuoted(parser.getSymbolTable());
funcName += ".";
funcName += name;
lexer.nextToken();
tok = lexer.token();
}
JSONPObject jsonp = new JSONPObject(funcName);
Reported by PMD.
Line: 38
if (tok != JSONToken.LPAREN) {
throw new JSONException("illegal jsonp : " + lexer.info());
}
lexer.nextToken();
for (;;) {
Object arg = parser.parse();
jsonp.addParameter(arg);
tok = lexer.token();
Reported by PMD.
Line: 53
throw new JSONException("illegal jsonp : " + lexer.info());
}
}
tok = lexer.token();
if (tok == JSONToken.SEMI) {
lexer.nextToken();
}
return (T) jsonp;
Reported by PMD.
Line: 5
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONPObject;
import com.alibaba.fastjson.parser.*;
import java.lang.reflect.Type;
/**
* Created by wenshao on 21/02/2017.
Reported by PMD.
Line: 33
tok = lexer.token();
}
JSONPObject jsonp = new JSONPObject(funcName);
if (tok != JSONToken.LPAREN) {
throw new JSONException("illegal jsonp : " + lexer.info());
}
lexer.nextToken();
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_xiedun.java
8 issues
Line: 13
import java.io.FileReader;
public class Bug_for_xiedun extends TestCase {
public void test_for_issue() throws Exception {
// File file = new File("/Users/wenshao/Downloads/json.txt");
//
// BufferedReader reader = new BufferedReader(new FileReader(file));
// char[] buf = new char[20480];
// int readed = reader.read(buf);
Reported by PMD.
Line: 13
import java.io.FileReader;
public class Bug_for_xiedun extends TestCase {
public void test_for_issue() throws Exception {
// File file = new File("/Users/wenshao/Downloads/json.txt");
//
// BufferedReader reader = new BufferedReader(new FileReader(file));
// char[] buf = new char[20480];
// int readed = reader.read(buf);
Reported by PMD.
Line: 3
package com.alibaba.json.bvt.bug;
import com.alibaba.fastjson.JSON;
import junit.framework.TestCase;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.BufferedReader;
import java.io.File;
Reported by PMD.
Line: 5
import com.alibaba.fastjson.JSON;
import junit.framework.TestCase;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
Reported by PMD.
Line: 6
import com.alibaba.fastjson.JSON;
import junit.framework.TestCase;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
Reported by PMD.
Line: 8
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
public class Bug_for_xiedun extends TestCase {
public void test_for_issue() throws Exception {
Reported by PMD.
Line: 9
import org.apache.commons.io.IOUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
public class Bug_for_xiedun extends TestCase {
public void test_for_issue() throws Exception {
// File file = new File("/Users/wenshao/Downloads/json.txt");
Reported by PMD.
Line: 10
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
public class Bug_for_xiedun extends TestCase {
public void test_for_issue() throws Exception {
// File file = new File("/Users/wenshao/Downloads/json.txt");
//
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_xujin_int.java
8 issues
Line: 14
public class Bug_for_xujin_int extends TestCase {
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":1}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
Reported by PMD.
Line: 12
* Created by wenshao on 09/02/2017.
*/
public class Bug_for_xujin_int extends TestCase {
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":1}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
Reported by PMD.
Line: 12
* Created by wenshao on 09/02/2017.
*/
public class Bug_for_xujin_int extends TestCase {
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":1}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
Reported by PMD.
Line: 15
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":1}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
private static final String DEFAULT_ERR_CODE = "xin.unknown.error";
Reported by PMD.
Line: 18
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
private static final String DEFAULT_ERR_CODE = "xin.unknown.error";
private String errorMsg;
private String errorCode;
private int success;
Reported by PMD.
Line: 20
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
private static final String DEFAULT_ERR_CODE = "xin.unknown.error";
private String errorMsg;
private String errorCode;
private int success;
private T module;
Reported by PMD.
Line: 23
private static final String DEFAULT_ERR_CODE = "xin.unknown.error";
private String errorMsg;
private String errorCode;
private int success;
private T module;
public ResultDTO() {
Reported by PMD.
Line: 15
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":1}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
private static final String DEFAULT_ERR_CODE = "xin.unknown.error";
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_yanpei.java
8 issues
Line: 11
import junit.framework.TestCase;
public class Bug_for_yanpei extends TestCase {
public void test_for_sepcial_chars() throws Exception {
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"Halios 1000M \\\"Puck\\\"很微众的品牌,几乎全靠玩家口口相传\"} ";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("Halios 1000M \"Puck\"很微众的品牌,几乎全靠玩家口口相传", obj.get("desc"));;
Reported by PMD.
Line: 14
public void test_for_sepcial_chars() throws Exception {
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"Halios 1000M \\\"Puck\\\"很微众的品牌,几乎全靠玩家口口相传\"} ";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("Halios 1000M \"Puck\"很微众的品牌,几乎全靠玩家口口相传", obj.get("desc"));;
}
}
Reported by PMD.
Line: 14
public void test_for_sepcial_chars() throws Exception {
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"Halios 1000M \\\"Puck\\\"很微众的品牌,几乎全靠玩家口口相传\"} ";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("Halios 1000M \"Puck\"很微众的品牌,几乎全靠玩家口口相传", obj.get("desc"));;
}
}
Reported by PMD.
Line: 15
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"Halios 1000M \\\"Puck\\\"很微众的品牌,几乎全靠玩家口口相传\"} ";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("Halios 1000M \"Puck\"很微众的品牌,几乎全靠玩家口口相传", obj.get("desc"));;
}
}
Reported by PMD.
Line: 15
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"Halios 1000M \\\"Puck\\\"很微众的品牌,几乎全靠玩家口口相传\"} ";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("Halios 1000M \"Puck\"很微众的品牌,几乎全靠玩家口口相传", obj.get("desc"));;
}
}
Reported by PMD.
Line: 15
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"Halios 1000M \\\"Puck\\\"很微众的品牌,几乎全靠玩家口口相传\"} ";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("Halios 1000M \"Puck\"很微众的品牌,几乎全靠玩家口口相传", obj.get("desc"));;
}
}
Reported by PMD.
Line: 16
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("Halios 1000M \"Puck\"很微众的品牌,几乎全靠玩家口口相传", obj.get("desc"));;
}
}
Reported by PMD.
Line: 16
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("Halios 1000M \"Puck\"很微众的品牌,几乎全靠玩家口口相传", obj.get("desc"));;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_yanpei2.java
8 issues
Line: 11
import junit.framework.TestCase;
public class Bug_for_yanpei2 extends TestCase {
public void test_for_sepcial_chars() throws Exception {
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"测试账号\\n测试账号\"}";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("测试账号\n测试账号", obj.get("desc"));;
Reported by PMD.
Line: 14
public void test_for_sepcial_chars() throws Exception {
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"测试账号\\n测试账号\"}";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("测试账号\n测试账号", obj.get("desc"));;
}
}
Reported by PMD.
Line: 14
public void test_for_sepcial_chars() throws Exception {
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"测试账号\\n测试账号\"}";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("测试账号\n测试账号", obj.get("desc"));;
}
}
Reported by PMD.
Line: 15
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"测试账号\\n测试账号\"}";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("测试账号\n测试账号", obj.get("desc"));;
}
}
Reported by PMD.
Line: 15
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"测试账号\\n测试账号\"}";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("测试账号\n测试账号", obj.get("desc"));;
}
}
Reported by PMD.
Line: 15
String text = "{\"answerAllow\":true,\"atUsers\":[],\"desc\":\"测试账号\\n测试账号\"}";
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("测试账号\n测试账号", obj.get("desc"));;
}
}
Reported by PMD.
Line: 16
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("测试账号\n测试账号", obj.get("desc"));;
}
}
Reported by PMD.
Line: 16
JSONObject obj = JSON.parseObject(text);
Assert.assertEquals(true, obj.get("answerAllow"));;
Assert.assertEquals(0, obj.getJSONArray("atUsers").size());;
Assert.assertEquals("测试账号\n测试账号", obj.get("desc"));;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/CurrencyTest4.java
8 issues
Line: 14
public class CurrencyTest4 extends TestCase {
public void test_0() throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("currency", "CNY");
String text = JSON.toJSONString(jsonObject);
Reported by PMD.
Line: 16
public void test_0() throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("currency", "CNY");
String text = JSON.toJSONString(jsonObject);
Currency currency = JSON.parseObject(text, Currency.class);
Reported by PMD.
Line: 22
Currency currency = JSON.parseObject(text, Currency.class);
assertSame(Currency.getInstance("CNY"), currency);
}
public void test_1() throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("currencyCode", "CNY");
Reported by PMD.
Line: 25
assertSame(Currency.getInstance("CNY"), currency);
}
public void test_1() throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("currencyCode", "CNY");
String text = JSON.toJSONString(jsonObject);
Reported by PMD.
Line: 33
Currency currency = JSON.parseObject(text, Currency.class);
assertSame(Currency.getInstance("CNY"), currency);
}
public static class VO {
public Currency value;
Reported by PMD.
Line: 5
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import junit.framework.TestCase;
import java.util.Currency;
import java.util.Locale;
Reported by PMD.
Line: 6
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import junit.framework.TestCase;
import java.util.Currency;
import java.util.Locale;
Reported by PMD.
Line: 10
import junit.framework.TestCase;
import java.util.Currency;
import java.util.Locale;
public class CurrencyTest4 extends TestCase {
public void test_0() throws Exception {
JSONObject jsonObject = new JSONObject();
Reported by PMD.
src/test/java/com/alibaba/json/bvt/SerializeEnumAsJavaBeanTest_manual.java
8 issues
Line: 12
* Created by wenshao on 08/01/2017.
*/
public class SerializeEnumAsJavaBeanTest_manual extends TestCase {
protected void setUp() throws Exception {
SerializeConfig serializeConfig = SerializeConfig.globalInstance;
serializeConfig.configEnumAsJavaBean(OrderType.class);
}
public void test_serializeEnumAsJavaBean() throws Exception {
Reported by PMD.
Line: 14
public class SerializeEnumAsJavaBeanTest_manual extends TestCase {
protected void setUp() throws Exception {
SerializeConfig serializeConfig = SerializeConfig.globalInstance;
serializeConfig.configEnumAsJavaBean(OrderType.class);
}
public void test_serializeEnumAsJavaBean() throws Exception {
String text = JSON.toJSONString(OrderType.PayOrder);
assertEquals("{\"remark\":\"支付订单\",\"value\":1}", text);
Reported by PMD.
Line: 17
serializeConfig.configEnumAsJavaBean(OrderType.class);
}
public void test_serializeEnumAsJavaBean() throws Exception {
String text = JSON.toJSONString(OrderType.PayOrder);
assertEquals("{\"remark\":\"支付订单\",\"value\":1}", text);
}
public void test_field() throws Exception {
Reported by PMD.
Line: 19
public void test_serializeEnumAsJavaBean() throws Exception {
String text = JSON.toJSONString(OrderType.PayOrder);
assertEquals("{\"remark\":\"支付订单\",\"value\":1}", text);
}
public void test_field() throws Exception {
Model model = new Model();
Reported by PMD.
Line: 22
assertEquals("{\"remark\":\"支付订单\",\"value\":1}", text);
}
public void test_field() throws Exception {
Model model = new Model();
model.orderType = OrderType.SettleBill;
String text = JSON.toJSONString(model);
assertEquals("{\"orderType\":{\"remark\":\"结算单\",\"value\":2}}", text);
Reported by PMD.
Line: 27
Model model = new Model();
model.orderType = OrderType.SettleBill;
String text = JSON.toJSONString(model);
assertEquals("{\"orderType\":{\"remark\":\"结算单\",\"value\":2}}", text);
}
public static enum OrderType {
PayOrder(1, "支付订单"), //
SettleBill(2, "结算单");
Reported by PMD.
Line: 44
}
public static class Model {
public OrderType orderType;
}
}
Reported by PMD.
Line: 4
package com.alibaba.json.bvt;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONType;
import com.alibaba.fastjson.serializer.SerializeConfig;
import junit.framework.TestCase;
/**
* Created by wenshao on 08/01/2017.
Reported by PMD.
src/test/java/com/alibaba/json/bvt/SerializeEnumAsJavaBeanTest.java
8 issues
Line: 11
* Created by wenshao on 08/01/2017.
*/
public class SerializeEnumAsJavaBeanTest extends TestCase {
public void test_serializeEnumAsJavaBean() throws Exception {
String text = JSON.toJSONString(OrderType.PayOrder);
assertEquals("{\"remark\":\"支付订单\",\"value\":1}", text);
}
public void test_field() throws Exception {
Reported by PMD.
Line: 13
public class SerializeEnumAsJavaBeanTest extends TestCase {
public void test_serializeEnumAsJavaBean() throws Exception {
String text = JSON.toJSONString(OrderType.PayOrder);
assertEquals("{\"remark\":\"支付订单\",\"value\":1}", text);
}
public void test_field() throws Exception {
Model model = new Model();
model.orderType = OrderType.SettleBill;
Reported by PMD.
Line: 16
assertEquals("{\"remark\":\"支付订单\",\"value\":1}", text);
}
public void test_field() throws Exception {
Model model = new Model();
model.orderType = OrderType.SettleBill;
String text = JSON.toJSONString(model);
assertEquals("{\"orderType\":{\"remark\":\"结算单\",\"value\":2}}", text);
}
Reported by PMD.
Line: 20
Model model = new Model();
model.orderType = OrderType.SettleBill;
String text = JSON.toJSONString(model);
assertEquals("{\"orderType\":{\"remark\":\"结算单\",\"value\":2}}", text);
}
public void test_field_2() throws Exception {
Model model = new Model();
model.orderType = OrderType.SettleBill;
Reported by PMD.
Line: 23
assertEquals("{\"orderType\":{\"remark\":\"结算单\",\"value\":2}}", text);
}
public void test_field_2() throws Exception {
Model model = new Model();
model.orderType = OrderType.SettleBill;
model.orderType1 = OrderType.SettleBill;
String text = JSON.toJSONString(model);
assertEquals("{\"orderType\":{\"remark\":\"结算单\",\"value\":2},\"orderType1\":{\"remark\":\"结算单\",\"value\":2}}", text);
Reported by PMD.
Line: 28
model.orderType = OrderType.SettleBill;
model.orderType1 = OrderType.SettleBill;
String text = JSON.toJSONString(model);
assertEquals("{\"orderType\":{\"remark\":\"结算单\",\"value\":2},\"orderType1\":{\"remark\":\"结算单\",\"value\":2}}", text);
}
@JSONType(serializeEnumAsJavaBean = true)
public static enum OrderType {
PayOrder(1, "支付订单"), //
Reported by PMD.
Line: 46
}
public static class Model {
public OrderType orderType;
public OrderType orderType1;
}
}
Reported by PMD.
Line: 47
public static class Model {
public OrderType orderType;
public OrderType orderType1;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Issue939.java
8 issues
Line: 17
" \"is_stop\":false/*comment*/" +
"}";
Model testUser = JSON.parseObject(jsonString, Model.class);
System.out.println(testUser);
}
public void test_for_issue_true() throws Exception {
String jsonString = "" +
"{" +
Reported by PMD.
Line: 27
" \"is_stop\":true/*comment*/" +
"}";
Model testUser = JSON.parseObject(jsonString, Model.class);
System.out.println(testUser);
}
public static class Model {
public int age;
public boolean is_top;
Reported by PMD.
Line: 10
* Created by wenshao on 20/12/2016.
*/
public class Issue939 extends TestCase {
public void test_for_issue_false() throws Exception {
String jsonString = "" +
"{" +
" \"age\": 25," +
" \"is_stop\":false/*comment*/" +
"}";
Reported by PMD.
Line: 10
* Created by wenshao on 20/12/2016.
*/
public class Issue939 extends TestCase {
public void test_for_issue_false() throws Exception {
String jsonString = "" +
"{" +
" \"age\": 25," +
" \"is_stop\":false/*comment*/" +
"}";
Reported by PMD.
Line: 11
*/
public class Issue939 extends TestCase {
public void test_for_issue_false() throws Exception {
String jsonString = "" +
"{" +
" \"age\": 25," +
" \"is_stop\":false/*comment*/" +
"}";
Model testUser = JSON.parseObject(jsonString, Model.class);
Reported by PMD.
Line: 20
System.out.println(testUser);
}
public void test_for_issue_true() throws Exception {
String jsonString = "" +
"{" +
" \"age\": 25," +
" \"is_stop\":true/*comment*/" +
"}";
Reported by PMD.
Line: 20
System.out.println(testUser);
}
public void test_for_issue_true() throws Exception {
String jsonString = "" +
"{" +
" \"age\": 25," +
" \"is_stop\":true/*comment*/" +
"}";
Reported by PMD.
Line: 21
}
public void test_for_issue_true() throws Exception {
String jsonString = "" +
"{" +
" \"age\": 25," +
" \"is_stop\":true/*comment*/" +
"}";
Model testUser = JSON.parseObject(jsonString, Model.class);
Reported by PMD.