The following issues were found
src/test/java/com/alibaba/json/bvt/path/JSONPath_field_access_filter_compare_string.java
34 issues
Line: 137
JSONArray array = JSON.parseArray("[{\"id\":\"1\",\"name\":\"a\"},{\"id\":\"2\",\"name\":\"b\"}]");
Object result = path.eval(array);
System.out.println(result);
}
public static class Entity {
private Integer id;
Reported by PMD.
Line: 16
public class JSONPath_field_access_filter_compare_string extends TestCase {
public void test_list_eq() throws Exception {
JSONPath path = new JSONPath("$[?(@.name = 'ljw2083')]");
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
Reported by PMD.
Line: 20
JSONPath path = new JSONPath("$[?(@.name = 'ljw2083')]");
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
entities.add(new Entity(1003, null));
entities.add(new Entity(null, null));
List<Object> result = (List<Object>) path.eval(entities);
Reported by PMD.
Line: 21
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
entities.add(new Entity(1003, null));
entities.add(new Entity(null, null));
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Reported by PMD.
Line: 26
entities.add(new Entity(null, null));
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_eq_x() throws Exception {
JSONPath path = new JSONPath("$[?(name = 'ljw2083')]");
Reported by PMD.
Line: 27
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_eq_x() throws Exception {
JSONPath path = new JSONPath("$[?(name = 'ljw2083')]");
Reported by PMD.
Line: 30
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_eq_x() throws Exception {
JSONPath path = new JSONPath("$[?(name = 'ljw2083')]");
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
Reported by PMD.
Line: 40
entities.add(new Entity(null, null));
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_eq_null() throws Exception {
JSONPath path = new JSONPath("$[?(@.name = null)]");
Reported by PMD.
Line: 41
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_eq_null() throws Exception {
JSONPath path = new JSONPath("$[?(@.name = null)]");
Reported by PMD.
Line: 44
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_eq_null() throws Exception {
JSONPath path = new JSONPath("$[?(@.name = null)]");
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/JSONScannerTest_scanFieldFloat.java
34 issues
Line: 10
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.parser.JSONScanner;
public class JSONScannerTest_scanFieldFloat extends TestCase {
public void test_0() throws Exception {
String text = "{\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1F == obj.getValue());
Reported by PMD.
Line: 12
public class JSONScannerTest_scanFieldFloat extends TestCase {
public void test_0() throws Exception {
String text = "{\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1F == obj.getValue());
}
Reported by PMD.
Line: 15
public void test_0() throws Exception {
String text = "{\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1F == obj.getValue());
}
@SuppressWarnings("resource")
public void test_isBlank() throws Exception {
String text = " {\"value\":1.0}";
Reported by PMD.
Line: 18
Assert.assertTrue(1F == obj.getValue());
}
@SuppressWarnings("resource")
public void test_isBlank() throws Exception {
String text = " {\"value\":1.0}";
Assert.assertTrue(!new JSONScanner(text).isBlankInput());
}
Reported by PMD.
Line: 24
Assert.assertTrue(!new JSONScanner(text).isBlankInput());
}
public void test_1() throws Exception {
String text = "{\"value\":\"1\"}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1F == obj.getValue());
}
Reported by PMD.
Line: 27
public void test_1() throws Exception {
String text = "{\"value\":\"1\"}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1F == obj.getValue());
}
public void test_2() throws Exception {
String text = "{\"f1\":2,\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 30
Assert.assertTrue(1F == obj.getValue());
}
public void test_2() throws Exception {
String text = "{\"f1\":2,\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1F == obj.getValue());
}
Reported by PMD.
Line: 33
public void test_2() throws Exception {
String text = "{\"f1\":2,\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1F == obj.getValue());
}
public void test_3() throws Exception {
String text = "{\"value\":1.01}";
VO obj = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 36
Assert.assertTrue(1F == obj.getValue());
}
public void test_3() throws Exception {
String text = "{\"value\":1.01}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1.01F == obj.getValue());
}
Reported by PMD.
Line: 39
public void test_3() throws Exception {
String text = "{\"value\":1.01}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1.01F == obj.getValue());
}
public void test_4() throws Exception {
String text = "{\"value\":1.}";
VO obj = JSON.parseObject(text, VO.class);
Reported by PMD.
src/test/java/com/alibaba/json/bvt/path/JSONPath_field_access_filter_in_decimal.java
33 issues
Line: 13
public class JSONPath_field_access_filter_in_decimal extends TestCase {
public void test_list_in() throws Exception {
JSONPath path = new JSONPath("[id in (1001)]");
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
Reported by PMD.
Line: 17
JSONPath path = new JSONPath("[id in (1001)]");
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
entities.add(new Entity(1003, "yakolee"));
entities.add(new Entity(1004, null));
List<Object> result = (List<Object>) path.eval(entities);
Reported by PMD.
Line: 18
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
entities.add(new Entity(1003, "yakolee"));
entities.add(new Entity(1004, null));
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Reported by PMD.
Line: 19
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
entities.add(new Entity(1003, "yakolee"));
entities.add(new Entity(1004, null));
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Assert.assertSame(entities.get(0), result.get(0));
Reported by PMD.
Line: 23
entities.add(new Entity(1004, null));
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_not_in() throws Exception {
JSONPath path = new JSONPath("[id not in (1001)]");
Reported by PMD.
Line: 24
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(1, result.size());
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_not_in() throws Exception {
JSONPath path = new JSONPath("[id not in (1001)]");
Reported by PMD.
Line: 27
Assert.assertSame(entities.get(0), result.get(0));
}
public void test_list_not_in() throws Exception {
JSONPath path = new JSONPath("[id not in (1001)]");
List<Entity> entities = new ArrayList<Entity>();
entities.add(new Entity(1001, "ljw2083"));
entities.add(new Entity(1002, "wenshao"));
Reported by PMD.
Line: 37
entities.add(new Entity(1004, null));
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(3, result.size());
Assert.assertSame(entities.get(1), result.get(0));
Assert.assertSame(entities.get(2), result.get(1));
Assert.assertSame(entities.get(3), result.get(2));
}
Reported by PMD.
Line: 38
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(3, result.size());
Assert.assertSame(entities.get(1), result.get(0));
Assert.assertSame(entities.get(2), result.get(1));
Assert.assertSame(entities.get(3), result.get(2));
}
public void test_list_not_in_null() throws Exception {
Reported by PMD.
Line: 39
List<Object> result = (List<Object>) path.eval(entities);
Assert.assertEquals(3, result.size());
Assert.assertSame(entities.get(1), result.get(0));
Assert.assertSame(entities.get(2), result.get(1));
Assert.assertSame(entities.get(3), result.get(2));
}
public void test_list_not_in_null() throws Exception {
JSONPath path = new JSONPath("[id not in (null)]");
Reported by PMD.
src/test/java/com/alibaba/json/bvt/NumberFieldTest.java
33 issues
Line: 66
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(new Long(Long.MAX_VALUE), v1.getValue());
}
public void test_codec_2_asm() throws Exception {
V0 v = new V0();
v.setValue(Long.MAX_VALUE);
Reported by PMD.
Line: 81
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(new Long(Long.MAX_VALUE), v1.getValue());
}
public void test_codec_3_no_asm() throws Exception {
V0 v = new V0();
v.setValue(new BigDecimal("3.2"));
Reported by PMD.
Line: 126
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(new Long(Long.MIN_VALUE), v1.getValue());
}
public void test_codec_min_asm() throws Exception {
V0 v = new V0();
v.setValue(Long.MIN_VALUE);
Reported by PMD.
Line: 141
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(new Long(Long.MIN_VALUE), v1.getValue());
}
public void test_codec_null_1() throws Exception {
V0 v = new V0();
Reported by PMD.
Line: 12
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
public class NumberFieldTest extends TestCase {
public void test_codec() throws Exception {
V0 v = new V0();
v.setValue(1001L);
Reported by PMD.
Line: 14
public class NumberFieldTest extends TestCase {
public void test_codec() throws Exception {
V0 v = new V0();
v.setValue(1001L);
String text = JSON.toJSONString(v);
Reported by PMD.
Line: 22
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(v1.getValue().intValue(), v.getValue().intValue());
}
public void test_codec_no_asm() throws Exception {
V0 v = new V0();
v.setValue(1001L);
Reported by PMD.
Line: 22
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(v1.getValue().intValue(), v.getValue().intValue());
}
public void test_codec_no_asm() throws Exception {
V0 v = new V0();
v.setValue(1001L);
Reported by PMD.
Line: 22
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(v1.getValue().intValue(), v.getValue().intValue());
}
public void test_codec_no_asm() throws Exception {
V0 v = new V0();
v.setValue(1001L);
Reported by PMD.
Line: 25
Assert.assertEquals(v1.getValue().intValue(), v.getValue().intValue());
}
public void test_codec_no_asm() throws Exception {
V0 v = new V0();
v.setValue(1001L);
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/JSONScannerTest_scanFieldDouble.java
33 issues
Line: 9
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
public class JSONScannerTest_scanFieldDouble extends TestCase {
public void test_0() throws Exception {
String text = "{\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1D == obj.getValue());
Reported by PMD.
Line: 11
public class JSONScannerTest_scanFieldDouble extends TestCase {
public void test_0() throws Exception {
String text = "{\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1D == obj.getValue());
}
Reported by PMD.
Line: 14
public void test_0() throws Exception {
String text = "{\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1D == obj.getValue());
}
public void test_1() throws Exception {
String text = "{\"value\":\"1\"}";
VO obj = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 17
Assert.assertTrue(1D == obj.getValue());
}
public void test_1() throws Exception {
String text = "{\"value\":\"1\"}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1D == obj.getValue());
}
Reported by PMD.
Line: 20
public void test_1() throws Exception {
String text = "{\"value\":\"1\"}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1D == obj.getValue());
}
public void test_2() throws Exception {
String text = "{\"f1\":2,\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 23
Assert.assertTrue(1D == obj.getValue());
}
public void test_2() throws Exception {
String text = "{\"f1\":2,\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1D == obj.getValue());
}
Reported by PMD.
Line: 26
public void test_2() throws Exception {
String text = "{\"f1\":2,\"value\":1.0}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1D == obj.getValue());
}
public void test_3() throws Exception {
String text = "{\"value\":1.01}";
VO obj = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 29
Assert.assertTrue(1D == obj.getValue());
}
public void test_3() throws Exception {
String text = "{\"value\":1.01}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1.01D == obj.getValue());
}
Reported by PMD.
Line: 32
public void test_3() throws Exception {
String text = "{\"value\":1.01}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1.01D == obj.getValue());
}
public void test_4() throws Exception {
String text = "{\"value\":1.}";
VO obj = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 35
Assert.assertTrue(1.01D == obj.getValue());
}
public void test_4() throws Exception {
String text = "{\"value\":1.}";
VO obj = JSON.parseObject(text, VO.class);
Assert.assertTrue(1D == obj.getValue());
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/JSONScannerTest_true.java
33 issues
Line: 9
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.parser.JSONScanner;
public class JSONScannerTest_true extends TestCase {
public void test_scan_true_0() throws Exception {
JSONScanner lexer = new JSONScanner("true");
lexer.scanTrue();
}
Reported by PMD.
Line: 11
public class JSONScannerTest_true extends TestCase {
public void test_scan_true_0() throws Exception {
JSONScanner lexer = new JSONScanner("true");
lexer.scanTrue();
}
public void test_scan_true_1() throws Exception {
Reported by PMD.
Line: 11
public class JSONScannerTest_true extends TestCase {
public void test_scan_true_0() throws Exception {
JSONScanner lexer = new JSONScanner("true");
lexer.scanTrue();
}
public void test_scan_true_1() throws Exception {
Reported by PMD.
Line: 16
lexer.scanTrue();
}
public void test_scan_true_1() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("frue");
lexer.scanTrue();
} catch (JSONException e) {
Reported by PMD.
Line: 27
Assert.assertNotNull(error);
}
public void test_scan_true_2() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("ttue");
lexer.scanTrue();
} catch (JSONException e) {
Reported by PMD.
Line: 38
Assert.assertNotNull(error);
}
public void test_scan_true_3() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("trze");
lexer.scanTrue();
} catch (JSONException e) {
Reported by PMD.
Line: 49
Assert.assertNotNull(error);
}
public void test_scan_true_4() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("truz");
lexer.scanTrue();
} catch (JSONException e) {
Reported by PMD.
Line: 60
Assert.assertNotNull(error);
}
public void test_scan_true_5() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("truee");
lexer.scanTrue();
} catch (JSONException e) {
Reported by PMD.
Line: 71
Assert.assertNotNull(error);
}
public void test_scan_true_6() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("true\"");
lexer.scanTrue();
} catch (JSONException e) {
Reported by PMD.
Line: 82
Assert.assertNotNull(error);
}
public void test_scan_true_7() throws Exception {
JSONScanner lexer = new JSONScanner("true a");
lexer.scanTrue();
}
public void test_scan_true_8() throws Exception {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/basicType/DoubleTest.java
33 issues
Line: 11
* Created by wenshao on 04/08/2017.
*/
public class DoubleTest extends TestCase {
public void test_obj() throws Exception {
String json = "{\"v1\":-0.012671709,\"v2\":0.22676692048907365,\"v3\":0.13231707,\"v4\":0.80090785,\"v5\":0.6192943}";
String json2 = "{\"v1\":\"-0.012671709\",\"v2\":\"0.22676692048907365\",\"v3\":\"0.13231707\",\"v4\":\"0.80090785\",\"v5\":\"0.6192943\"}";
Model m1 = JSON.parseObject(json, Model.class);
Model m2 = JSON.parseObject(json2, Model.class);
Reported by PMD.
Line: 11
* Created by wenshao on 04/08/2017.
*/
public class DoubleTest extends TestCase {
public void test_obj() throws Exception {
String json = "{\"v1\":-0.012671709,\"v2\":0.22676692048907365,\"v3\":0.13231707,\"v4\":0.80090785,\"v5\":0.6192943}";
String json2 = "{\"v1\":\"-0.012671709\",\"v2\":\"0.22676692048907365\",\"v3\":\"0.13231707\",\"v4\":\"0.80090785\",\"v5\":\"0.6192943\"}";
Model m1 = JSON.parseObject(json, Model.class);
Model m2 = JSON.parseObject(json2, Model.class);
Reported by PMD.
Line: 18
Model m1 = JSON.parseObject(json, Model.class);
Model m2 = JSON.parseObject(json2, Model.class);
assertNotNull(m1);
assertNotNull(m2);
assertEquals(-0.012671709D, m1.v1);
assertEquals(0.22676692048907365D, m1.v2);
assertEquals(0.13231707D, m1.v3);
Reported by PMD.
Line: 19
Model m2 = JSON.parseObject(json2, Model.class);
assertNotNull(m1);
assertNotNull(m2);
assertEquals(-0.012671709D, m1.v1);
assertEquals(0.22676692048907365D, m1.v2);
assertEquals(0.13231707D, m1.v3);
assertEquals(0.80090785D, m1.v4);
Reported by PMD.
Line: 21
assertNotNull(m1);
assertNotNull(m2);
assertEquals(-0.012671709D, m1.v1);
assertEquals(0.22676692048907365D, m1.v2);
assertEquals(0.13231707D, m1.v3);
assertEquals(0.80090785D, m1.v4);
assertEquals(0.6192943D, m1.v5);
Reported by PMD.
Line: 22
assertNotNull(m2);
assertEquals(-0.012671709D, m1.v1);
assertEquals(0.22676692048907365D, m1.v2);
assertEquals(0.13231707D, m1.v3);
assertEquals(0.80090785D, m1.v4);
assertEquals(0.6192943D, m1.v5);
assertEquals(-0.012671709D, m2.v1);
Reported by PMD.
Line: 23
assertEquals(-0.012671709D, m1.v1);
assertEquals(0.22676692048907365D, m1.v2);
assertEquals(0.13231707D, m1.v3);
assertEquals(0.80090785D, m1.v4);
assertEquals(0.6192943D, m1.v5);
assertEquals(-0.012671709D, m2.v1);
assertEquals(0.22676692048907365D, m2.v2);
Reported by PMD.
Line: 24
assertEquals(-0.012671709D, m1.v1);
assertEquals(0.22676692048907365D, m1.v2);
assertEquals(0.13231707D, m1.v3);
assertEquals(0.80090785D, m1.v4);
assertEquals(0.6192943D, m1.v5);
assertEquals(-0.012671709D, m2.v1);
assertEquals(0.22676692048907365D, m2.v2);
assertEquals(0.13231707D, m2.v3);
Reported by PMD.
Line: 25
assertEquals(0.22676692048907365D, m1.v2);
assertEquals(0.13231707D, m1.v3);
assertEquals(0.80090785D, m1.v4);
assertEquals(0.6192943D, m1.v5);
assertEquals(-0.012671709D, m2.v1);
assertEquals(0.22676692048907365D, m2.v2);
assertEquals(0.13231707D, m2.v3);
assertEquals(0.80090785D, m2.v4);
Reported by PMD.
Line: 27
assertEquals(0.80090785D, m1.v4);
assertEquals(0.6192943D, m1.v5);
assertEquals(-0.012671709D, m2.v1);
assertEquals(0.22676692048907365D, m2.v2);
assertEquals(0.13231707D, m2.v3);
assertEquals(0.80090785D, m2.v4);
assertEquals(0.6192943D, m2.v5);
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/JSONScannerTest_new.java
33 issues
Line: 9
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.parser.JSONScanner;
public class JSONScannerTest_new extends TestCase {
public void test_scan_new_0() throws Exception {
JSONScanner lexer = new JSONScanner("new");
lexer.scanNullOrNew();
}
Reported by PMD.
Line: 11
public class JSONScannerTest_new extends TestCase {
public void test_scan_new_0() throws Exception {
JSONScanner lexer = new JSONScanner("new");
lexer.scanNullOrNew();
}
public void test_scan_new_1() throws Exception {
Reported by PMD.
Line: 11
public class JSONScannerTest_new extends TestCase {
public void test_scan_new_0() throws Exception {
JSONScanner lexer = new JSONScanner("new");
lexer.scanNullOrNew();
}
public void test_scan_new_1() throws Exception {
Reported by PMD.
Line: 16
lexer.scanNullOrNew();
}
public void test_scan_new_1() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("nww");
lexer.scanNullOrNew();
} catch (JSONException e) {
Reported by PMD.
Line: 27
Assert.assertNotNull(error);
}
public void test_scan_new_2() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("nee");
lexer.scanNullOrNew();
} catch (JSONException e) {
Reported by PMD.
Line: 38
Assert.assertNotNull(error);
}
public void test_scan_new_3() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("neel");
lexer.scanNullOrNew();
} catch (JSONException e) {
Reported by PMD.
Line: 49
Assert.assertNotNull(error);
}
public void test_scan_new_4() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("neww");
lexer.scanNullOrNew();
} catch (JSONException e) {
Reported by PMD.
Line: 60
Assert.assertNotNull(error);
}
public void test_scan_new_5() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("newe");
lexer.scanNullOrNew();
} catch (JSONException e) {
Reported by PMD.
Line: 71
Assert.assertNotNull(error);
}
public void test_scan_new_6() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("new\"");
lexer.scanNullOrNew();
} catch (JSONException e) {
Reported by PMD.
Line: 82
Assert.assertNotNull(error);
}
public void test_scan_new_7() throws Exception {
JSONScanner lexer = new JSONScanner("new a");
lexer.scanNullOrNew();
}
public void test_scan_new_8() throws Exception {
Reported by PMD.
src/test/java/com/alibaba/fastjson/validate/JSONValidateTest_basic.java
33 issues
Line: 39
System.out.println(intVal & 0xFFFFFFFFL);
System.out.println((int) b);
byte[] bytes0 = new byte[8];
byte[] bytes1 = new byte[8];
Reported by PMD.
Line: 41
System.out.println(intVal & 0xFFFFFFFFL);
System.out.println((int) b);
byte[] bytes0 = new byte[8];
byte[] bytes1 = new byte[8];
byte[] bytes2 = new byte[8];
Reported by PMD.
Line: 50
putLong(bytes0, 0, a);
putLong(bytes1, 0, b);
putLong(bytes2, 0, 0xFFFFFFFF00000000L);
System.out.println("");
}
static void putLong(byte[] b, int off, long val) {
b[off + 7] = (byte) (val );
Reported by PMD.
Line: 8
public class JSONValidateTest_basic extends TestCase
{
public void test_for_bastic_true() throws Exception {
assertTrue(JSONValidator.from("{\"id\":true}").validate());
assertTrue(JSONValidator.from("[true]").validate());
assertTrue(JSONValidator.from("true").validate());
}
Reported by PMD.
Line: 8
public class JSONValidateTest_basic extends TestCase
{
public void test_for_bastic_true() throws Exception {
assertTrue(JSONValidator.from("{\"id\":true}").validate());
assertTrue(JSONValidator.from("[true]").validate());
assertTrue(JSONValidator.from("true").validate());
}
Reported by PMD.
Line: 9
public class JSONValidateTest_basic extends TestCase
{
public void test_for_bastic_true() throws Exception {
assertTrue(JSONValidator.from("{\"id\":true}").validate());
assertTrue(JSONValidator.from("[true]").validate());
assertTrue(JSONValidator.from("true").validate());
}
public void test_for_bastic_false() throws Exception {
Reported by PMD.
Line: 9
public class JSONValidateTest_basic extends TestCase
{
public void test_for_bastic_true() throws Exception {
assertTrue(JSONValidator.from("{\"id\":true}").validate());
assertTrue(JSONValidator.from("[true]").validate());
assertTrue(JSONValidator.from("true").validate());
}
public void test_for_bastic_false() throws Exception {
Reported by PMD.
Line: 10
{
public void test_for_bastic_true() throws Exception {
assertTrue(JSONValidator.from("{\"id\":true}").validate());
assertTrue(JSONValidator.from("[true]").validate());
assertTrue(JSONValidator.from("true").validate());
}
public void test_for_bastic_false() throws Exception {
assertTrue(JSONValidator.from("{\"id\":false}").validate());
Reported by PMD.
Line: 10
{
public void test_for_bastic_true() throws Exception {
assertTrue(JSONValidator.from("{\"id\":true}").validate());
assertTrue(JSONValidator.from("[true]").validate());
assertTrue(JSONValidator.from("true").validate());
}
public void test_for_bastic_false() throws Exception {
assertTrue(JSONValidator.from("{\"id\":false}").validate());
Reported by PMD.
Line: 11
public void test_for_bastic_true() throws Exception {
assertTrue(JSONValidator.from("{\"id\":true}").validate());
assertTrue(JSONValidator.from("[true]").validate());
assertTrue(JSONValidator.from("true").validate());
}
public void test_for_bastic_false() throws Exception {
assertTrue(JSONValidator.from("{\"id\":false}").validate());
assertTrue(JSONValidator.from("[false]").validate());
Reported by PMD.
src/test/java/com/alibaba/json/bvt/basicType/FloatTest2_obj.java
33 issues
Line: 11
* Created by wenshao on 04/08/2017.
*/
public class FloatTest2_obj extends TestCase {
public void test_0() throws Exception {
String json = "{\"v1\":-0.012671709,\"v2\":0.6042485,\"v3\":0.13231707,\"v4\":0.80090785,\"v5\":0.6192943}";
String json2 = "{\"v1\":\"-0.012671709\",\"v2\":\"0.6042485\",\"v3\":\"0.13231707\",\"v4\":\"0.80090785\",\"v5\":\"0.6192943\"}";
Model m1 = JSON.parseObject(json, Model.class);
Model m2 = JSON.parseObject(json2, Model.class);
Reported by PMD.
Line: 11
* Created by wenshao on 04/08/2017.
*/
public class FloatTest2_obj extends TestCase {
public void test_0() throws Exception {
String json = "{\"v1\":-0.012671709,\"v2\":0.6042485,\"v3\":0.13231707,\"v4\":0.80090785,\"v5\":0.6192943}";
String json2 = "{\"v1\":\"-0.012671709\",\"v2\":\"0.6042485\",\"v3\":\"0.13231707\",\"v4\":\"0.80090785\",\"v5\":\"0.6192943\"}";
Model m1 = JSON.parseObject(json, Model.class);
Model m2 = JSON.parseObject(json2, Model.class);
Reported by PMD.
Line: 18
Model m1 = JSON.parseObject(json, Model.class);
Model m2 = JSON.parseObject(json2, Model.class);
assertNotNull(m1);
assertNotNull(m2);
assertEquals(-0.012671709f, m1.v1);
assertEquals(0.6042485f, m1.v2);
assertEquals(0.13231707f, m1.v3);
Reported by PMD.
Line: 19
Model m2 = JSON.parseObject(json2, Model.class);
assertNotNull(m1);
assertNotNull(m2);
assertEquals(-0.012671709f, m1.v1);
assertEquals(0.6042485f, m1.v2);
assertEquals(0.13231707f, m1.v3);
assertEquals(0.80090785f, m1.v4);
Reported by PMD.
Line: 21
assertNotNull(m1);
assertNotNull(m2);
assertEquals(-0.012671709f, m1.v1);
assertEquals(0.6042485f, m1.v2);
assertEquals(0.13231707f, m1.v3);
assertEquals(0.80090785f, m1.v4);
assertEquals(0.6192943f, m1.v5);
Reported by PMD.
Line: 22
assertNotNull(m2);
assertEquals(-0.012671709f, m1.v1);
assertEquals(0.6042485f, m1.v2);
assertEquals(0.13231707f, m1.v3);
assertEquals(0.80090785f, m1.v4);
assertEquals(0.6192943f, m1.v5);
assertEquals(-0.012671709f, m2.v1);
Reported by PMD.
Line: 23
assertEquals(-0.012671709f, m1.v1);
assertEquals(0.6042485f, m1.v2);
assertEquals(0.13231707f, m1.v3);
assertEquals(0.80090785f, m1.v4);
assertEquals(0.6192943f, m1.v5);
assertEquals(-0.012671709f, m2.v1);
assertEquals(0.6042485f, m2.v2);
Reported by PMD.
Line: 24
assertEquals(-0.012671709f, m1.v1);
assertEquals(0.6042485f, m1.v2);
assertEquals(0.13231707f, m1.v3);
assertEquals(0.80090785f, m1.v4);
assertEquals(0.6192943f, m1.v5);
assertEquals(-0.012671709f, m2.v1);
assertEquals(0.6042485f, m2.v2);
assertEquals(0.13231707f, m2.v3);
Reported by PMD.
Line: 25
assertEquals(0.6042485f, m1.v2);
assertEquals(0.13231707f, m1.v3);
assertEquals(0.80090785f, m1.v4);
assertEquals(0.6192943f, m1.v5);
assertEquals(-0.012671709f, m2.v1);
assertEquals(0.6042485f, m2.v2);
assertEquals(0.13231707f, m2.v3);
assertEquals(0.80090785f, m2.v4);
Reported by PMD.
Line: 27
assertEquals(0.80090785f, m1.v4);
assertEquals(0.6192943f, m1.v5);
assertEquals(-0.012671709f, m2.v1);
assertEquals(0.6042485f, m2.v2);
assertEquals(0.13231707f, m2.v3);
assertEquals(0.80090785f, m2.v4);
assertEquals(0.6192943f, m2.v5);
}
Reported by PMD.