xiuji666

Results 2 issues of xiuji666

您好,我正在用蚂蚁的单元测试用例自动生成工具(https://github.com/TRaaSStack/auto-unit-test-case-generator) 对这个项目进行测试,发现如下两个可能引发NPE的问题,期待得到您的反馈。 一 HotTagCache类中可能抛出NPE 被测方法的入参为Map,在其中一个添加的元素的value赋null值 ![image](https://user-images.githubusercontent.com/110900065/205802942-d35434ca-4698-4443-858d-7db5f2c783a0.png) 被测方法: ![image](https://user-images.githubusercontent.com/110900065/205803066-d7087027-e555-44d5-adb8-d1f40520c778.png) ![image](https://user-images.githubusercontent.com/110900065/205803108-d24006a9-70ea-48b9-ad8c-0b4fc43be5dd.png) 源码中在遍历元素的时候,由于其中的一个元素的value值为空,而代码中未对null做非空校验,导致在进入compareTo的时候,this.getPriority()获取的值为null,从而报npe异常 二 UserStrategyFactory类中可能抛出NPE 调用被测方法之前,先对被测类的私有属性类型为list的strategies赋初值,即在list中添加null元素 ![image](https://user-images.githubusercontent.com/110900065/205803368-24adacb4-3d10-489f-a4d4-6caf27370286.png) 被测方法: ![image](https://user-images.githubusercontent.com/110900065/205803432-858d5b69-2fa7-49b1-9cd2-aa751eb9c271.png) 在被测方法中,遍历list时,未对元素strategy做非空判断,导致strategy.getSupportedType()操作时报npe

OSError: dlopen(java-grammar.so, 6): image not found