why #3246 is a bug?
@Test
public void JSONObjectTest() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("ab", "11");
jsonObject.put("cd", "22");
jsonObject.put("ef", "33");
Lizz lizz = jsonObject.toJavaObject(Lizz.class);
System.out.println(JSON.toJSONString(lizz));
Assert.assertNotNull(lizz.getAb());
Assert.assertNotNull(lizz.getCd());
Assert.assertNotNull(lizz.getE_f());
}
@Data
static class Lizz {
@JSONField(name = "a_b")
private String ab;
private String cd;
private String e_f;
}
"ab" connot match "a_b" of JSONField, but "ef" can match "e_f" ,I think this is wrong。
I think the matching rules should be same。
暂无答案!
目前还没有任何答案,快来回答吧!