jheaps icon indicating copy to clipboard operation
jheaps copied to clipboard

Static analysis showing null pointers being dereferenced

Open huornlmj opened this issue 5 years ago • 1 comments

Sonarqube 7.8 community shows some issues, in particular possible null pointers being dereferenced. Example in src/main/java/org/jheaps/tree/BinaryTreeSoftAddressableHeap.java.

Line 810 implies that 'cur1' can be null. In Line 772 'cur1' is dereferenced. Same happens with 'cur2'. Also in src/main/java/org/jheaps/tree/BinaryTreeSoftHeap.java.

Is this expected or false positive?

huornlmj avatar Jul 22 '19 16:07 huornlmj

Hi,

this is indeed a false positive. Anyway, thanks for your comment. I took the opportunity to clean up the code based on SonarCube's findings.

d-michail avatar Jul 22 '19 20:07 d-michail