@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class A {
private String a1;
private List<B> bs;
@Data
@AllArgsConstructor
@Builder
public static class B {
private List<C> cs; //List cause NPE, Map<C, String> or String or C will not
}
@Data
@AllArgsConstructor
@Builder
public static class C {
private String c1;
}
}
String test = "{\"a1\":\"a1\",\"bs\":[{\"cs\":null}]}";
A response = JSON.parseObject(test, A.class); //NPE
暂无答案!
目前还没有任何答案,快来回答吧!