d-michail / jheaps

Master repository for the JHeaps project
http://www.jheaps.org
Apache License 2.0
44 stars 9 forks source link

Static analysis showing null pointers being dereferenced #2

Open huornlmj opened 4 years ago

huornlmj commented 4 years ago

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?

d-michail commented 4 years ago

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.