We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fastjson 2.0.27-SNAPSHOT版本调用JSON.toJSONString() 方法时,产生npe
1、分别定义2个类(一点要是公共类)
@Data public class Aa { private List<Bb> bList; } @Data public class Bb { private List<LocalDateTime> dateTimes; }
2、执行测试用例
@Test public void t2(){ Aa a =new Aa(); List<Bb> bList = new ArrayList<>(); Bb b1 = new Bb(); bList.add(b1); Bb b2 = new Bb(); bList.add(b2); List<LocalDateTime> dateTimes1 = new ArrayList<>(); dateTimes1.add(LocalDateTime.now()); dateTimes1.add(LocalDateTime.now()); b1.setDateTimes(dateTimes1); List<LocalDateTime> dateTimes2 = new ArrayList<>(); dateTimes2.add(LocalDateTime.now()); // dateTimes2.add(LocalDateTime.now()); b2.setDateTimes(dateTimes2); a.setBList(bList); Map<String, Object> map2 = ReflectUtils.buildObjectForMap(a); String json = JSON.toJSONString(map2); System.out.println(json); }
出现空指针异常
The text was updated successfully, but these errors were encountered:
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.27-SNAPSHOT/ 问题已修复,请帮忙用2.0.27-SNAPSHOT版本验证
Sorry, something went wrong.
fix : reference detect npe, for issue #1332
4f41b12
https://github.com/alibaba/fastjson2/releases/tag/2.0.27 问题已修复,请用新版本
No branches or pull requests
问题描述
fastjson 2.0.27-SNAPSHOT版本调用JSON.toJSONString() 方法时,产生npe
环境信息
重现步骤
1、分别定义2个类(一点要是公共类)
2、执行测试用例
出现空指针异常
![image](https://user-images.githubusercontent.com/10411913/230548193-a68bbde0-f105-4ee5-b5d7-3f3e06cce428.png)
The text was updated successfully, but these errors were encountered: