-
Bug
-
Resolution: Won't Fix
-
P3
-
7
-
generic
-
generic
Running findbugs on JDK7 tools.jar I got quite a few "Null on some path errors" in the JDWP.java source file (a generated source file). The code pattern is something like:
if ((ps.vm.traceFlags & VirtualMachineImpl.TRACE_SENDS) != 0) {
ps.vm.printTrace("Sending: XXXXXXX: " +
(ZZZ==null?"NULL":"ref="+ZZZ.ref()));
}
ps.writeObjectRef(ZZZ.ref());
Findbugs is saying that on one code path, the ZZZ object could be null, but in other code paths, no null check is made.
If the JDWP.java code generation could be fixed, this could remove quite a few high risk findbugs errors, maybe 50 or more.
If the null check is not needed, then the null check should be removed, if it is needed, then it needs to be checked on all paths.
if ((ps.vm.traceFlags & VirtualMachineImpl.TRACE_SENDS) != 0) {
ps.vm.printTrace("Sending: XXXXXXX: " +
(ZZZ==null?"NULL":"ref="+ZZZ.ref()));
}
ps.writeObjectRef(ZZZ.ref());
Findbugs is saying that on one code path, the ZZZ object could be null, but in other code paths, no null check is made.
If the JDWP.java code generation could be fixed, this could remove quite a few high risk findbugs errors, maybe 50 or more.
If the null check is not needed, then the null check should be removed, if it is needed, then it needs to be checked on all paths.