The following issues were found
src/test/java/com/alibaba/json/bvt/support/spring/FastjsonSockJsMessageCodecTest_encode.java
2 issues
Line: 11
import junit.framework.TestCase;
public class FastjsonSockJsMessageCodecTest_encode extends TestCase {
public void test_encode() throws Exception {
FastjsonSockJsMessageCodec fastjsonCodec = new FastjsonSockJsMessageCodec();
Jackson2SockJsMessageCodec jacksonCodec = new Jackson2SockJsMessageCodec();
String v0 = "a0\"\0", v1 = "a1";
String fastjsonResult = fastjsonCodec.encode(v0, v1);
Reported by PMD.
Line: 15
FastjsonSockJsMessageCodec fastjsonCodec = new FastjsonSockJsMessageCodec();
Jackson2SockJsMessageCodec jacksonCodec = new Jackson2SockJsMessageCodec();
String v0 = "a0\"\0", v1 = "a1";
String fastjsonResult = fastjsonCodec.encode(v0, v1);
String jacksonResult = jacksonCodec.encode(v0, v1);
Assert.assertEquals(jacksonResult, fastjsonResult);
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/DefaultObjectDeserializerTest12.java
2 issues
Line: 12
public class DefaultObjectDeserializerTest12 extends TestCase {
public void test_list() throws Exception {
A a = new A();
DefaultJSONParser parser = new DefaultJSONParser("{\"values\":[]}", ParserConfig.getGlobalInstance());
parser.parseObject(a);
parser.close();
}
Reported by PMD.
Line: 12
public class DefaultObjectDeserializerTest12 extends TestCase {
public void test_list() throws Exception {
A a = new A();
DefaultJSONParser parser = new DefaultJSONParser("{\"values\":[]}", ParserConfig.getGlobalInstance());
parser.parseObject(a);
parser.close();
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/ConstructorErrorTest_private.java
2 issues
Line: 12
public class ConstructorErrorTest_private extends TestCase {
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("{}", Model.class);
} catch (JSONException ex) {
error = ex;
Reported by PMD.
Line: 13
public class ConstructorErrorTest_private extends TestCase {
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("{}", Model.class);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/ConstructorErrorTest_inner.java
2 issues
Line: 12
public class ConstructorErrorTest_inner extends TestCase {
public void test_error() throws Exception {
JSONObject obj = new JSONObject();
obj.put("value", new JSONObject());
Exception error = null;
try {
obj.toJavaObject(Model.class);
Reported by PMD.
Line: 15
public void test_error() throws Exception {
JSONObject obj = new JSONObject();
obj.put("value", new JSONObject());
Exception error = null;
try {
obj.toJavaObject(Model.class);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/ConstructorErrorTest_initError_private.java
2 issues
Line: 13
public class ConstructorErrorTest_initError_private extends TestCase {
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("{}", Model.class, Feature.InitStringFieldAsEmpty);
} catch (JSONException ex) {
error = ex;
Reported by PMD.
Line: 14
public class ConstructorErrorTest_initError_private extends TestCase {
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("{}", Model.class, Feature.InitStringFieldAsEmpty);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/ConstructorErrorTest_initError.java
2 issues
Line: 13
public class ConstructorErrorTest_initError extends TestCase {
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("{}", Model.class, Feature.InitStringFieldAsEmpty);
} catch (JSONException ex) {
error = ex;
Reported by PMD.
Line: 14
public class ConstructorErrorTest_initError extends TestCase {
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("{}", Model.class, Feature.InitStringFieldAsEmpty);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/ConstructorErrorTest.java
2 issues
Line: 12
public class ConstructorErrorTest extends TestCase {
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("{}", Model.class);
} catch (JSONException ex) {
error = ex;
Reported by PMD.
Line: 13
public class ConstructorErrorTest extends TestCase {
public void test_error() throws Exception {
Exception error = null;
try {
JSON.parseObject("{}", Model.class);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/util/JavaBeanInfoTest.java
2 issues
Line: 7
import junit.framework.TestCase;
public class JavaBeanInfoTest extends TestCase {
public void test_0() throws Exception {
JavaBeanInfo.getBuilderClass(null);
}
}
Reported by PMD.
Line: 7
import junit.framework.TestCase;
public class JavaBeanInfoTest extends TestCase {
public void test_0() throws Exception {
JavaBeanInfo.getBuilderClass(null);
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/BigDecimalDeserializerTest.java
2 issues
Line: 16
public class BigDecimalDeserializerTest extends TestCase {
public void test_bigdecimal() throws Exception {
Assert.assertEquals(BigDecimal.ZERO, JSON.parseObject("0", BigDecimal.class));
Assert.assertEquals(BigDecimal.ZERO, JSON.parseObject("'0'", BigDecimal.class));
Assert.assertEquals(new BigDecimal("0.0"), JSON.parseObject("0.0", BigDecimal.class));
Assert.assertEquals(new BigDecimal("0.0"), JSON.parseObject("'0.0'", BigDecimal.class));
Reported by PMD.
Line: 25
Assert.assertEquals(null, JSON.parseObject("null", BigDecimal.class));
DefaultJSONParser parser = new DefaultJSONParser("null", ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
Assert.assertEquals(null, BigDecimalCodec.instance.deserialze(parser, null, null));
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/var/TwoTypeTest.java
2 issues
Line: 9
* Created by wenshao on 23/01/2017.
*/
public class TwoTypeTest extends TestCase {
public void test_two() throws Exception {
}
public static class ModelA {
public int id;
Reported by PMD.
Line: 9
* Created by wenshao on 23/01/2017.
*/
public class TwoTypeTest extends TestCase {
public void test_two() throws Exception {
}
public static class ModelA {
public int id;
Reported by PMD.