The following issues were found
src/test/java/com/alibaba/json/bvt/bug/Bug_for_Jay.java
2 issues
Line: 9
public class Bug_for_Jay extends TestCase {
public void test_for_jay() throws Exception {
JSON.toJSONString(new B(), true);
}
public class A {
Reported by PMD.
Line: 9
public class Bug_for_Jay extends TestCase {
public void test_for_jay() throws Exception {
JSON.toJSONString(new B(), true);
}
public class A {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_JSONObject.java
2 issues
Line: 11
public class Bug_for_JSONObject extends TestCase {
public void test_0 () throws Exception {
JSONSerializer ser = new JSONSerializer();
ser.config(SerializerFeature.WriteClassName, true);
ser.write(new JSONObject());
}
}
Reported by PMD.
Line: 11
public class Bug_for_JSONObject extends TestCase {
public void test_0 () throws Exception {
JSONSerializer ser = new JSONSerializer();
ser.config(SerializerFeature.WriteClassName, true);
ser.write(new JSONObject());
}
}
Reported by PMD.
src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectF.java
2 issues
Line: 6
import java.util.List;
public class ObjectF {
protected long a;
protected int b;
Reported by PMD.
Line: 6
import java.util.List;
public class ObjectF {
protected long a;
protected int b;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_572.java
2 issues
Line: 12
public class Bug_for_issue_572 extends TestCase {
public void test_for_issue() throws Exception {
Model model = new Model();
model.id = 1001;
model.name = "wenshao";
String text = JSON.toJSONString(model, SerializerFeature.WriteNonStringValueAsString);
Reported by PMD.
Line: 21
Assert.assertEquals("{\"id\":\"1001\",\"name\":\"wenshao\"}", text);
}
public static class Model {
private int id;
private String name;
public int getId() {
Reported by PMD.
src/test/java/com/alibaba/json/test/vans/VansObjectChildren.java
2 issues
Line: 12
* Created by xiaolin_kxl on 17/1/5.
*/
@JSONType(orders = {"name","uuid","matrix","visible","type","children","castShadow","receiveShadow","geometry"})
public class VansObjectChildren implements Serializable{
public String name;
public String uuid;
public String type;
public boolean visible;
public String geometry;
Reported by PMD.
Line: 21
public boolean castShadow;
public boolean receiveShadow;
public float[] matrix;
public ArrayList<VansObjectChildren> children;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_char_public.java
2 issues
Line: 11
import com.alibaba.fastjson.serializer.SerializerFeature;
public class WriteAsArray_char_public extends TestCase {
public void test_0 () throws Exception {
VO vo = new VO();
vo.setId('x');
vo.setName("wenshao");
String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
Reported by PMD.
Line: 20
Assert.assertEquals("[\"x\",\"wenshao\"]", text);
}
public static class VO {
private char id;
private String name;
public char getId() {
return id;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_float_public.java
2 issues
Line: 11
import com.alibaba.fastjson.serializer.SerializerFeature;
public class WriteAsArray_float_public extends TestCase {
public void test_0 () throws Exception {
VO vo = new VO();
vo.setId(123F);
vo.setName("wenshao");
String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
Reported by PMD.
Line: 20
Assert.assertEquals("[123.0,\"wenshao\"]", text);
}
public static class VO {
private float id;
private String name;
public float getId() {
return id;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_long_private.java
2 issues
Line: 11
import com.alibaba.fastjson.serializer.SerializerFeature;
public class WriteAsArray_long_private extends TestCase {
public void test_0 () throws Exception {
VO vo = new VO();
vo.setId(123);
vo.setName("wenshao");
String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
Reported by PMD.
Line: 20
Assert.assertEquals("[123,\"wenshao\"]", text);
}
private static class VO {
private long id;
private String name;
public long getId() {
return id;
Reported by PMD.
src/test/java/com/alibaba/json/bvtVO/AuditStatusType.java
2 issues
Line: 32
for(int i$ = 0; i$ < len$; ++i$) {
AuditStatusType temp = arr$[i$];
if(temp.getEnCode().equals(enCode)) {
return temp;
}
}
return null;
Reported by PMD.
Line: 32
for(int i$ = 0; i$ < len$; ++i$) {
AuditStatusType temp = arr$[i$];
if(temp.getEnCode().equals(enCode)) {
return temp;
}
}
return null;
Reported by PMD.
src/test/java/com/alibaba/json/bvtVO/ContactTemplateParam.java
2 issues
Line: 4
package com.alibaba.json.bvtVO;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang.builder.ToStringBuilder;
import com.alibaba.fastjson.annotation.JSONField;
Reported by PMD.
Line: 8
import org.apache.commons.lang.builder.ToStringBuilder;
import com.alibaba.fastjson.annotation.JSONField;
public class ContactTemplateParam implements Serializable {
private static final long serialVersionUID = 1L;
Reported by PMD.