forked from alibaba/fastjson
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBug13.java
More file actions
executable file
·57 lines (43 loc) · 1.34 KB
/
Copy pathBug13.java
File metadata and controls
executable file
·57 lines (43 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.alibaba.json.bvt.bug;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;
import com.alibaba.fastjson.JSON;
public class Bug13 extends TestCase {
public void test_0() throws Exception {
User user = new User("name1", "11");
String object = JSON.toJSONString(user);
System.out.println(object);
user = JSON.parseObject(object, User.class);//报错
}
public static class User {
public User() {
}
private String name, age;
private List<Object> group = new ArrayList<Object>(2);
public List<Object> getGroup() {
return group;
}
public void setGroup(List<Object> group) {
this.group = group;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public User(String name, String age) {
this.name = name;
this.age = age;
group.add("1");
group.add("2");
}
}
}