dlcheck icon indicating copy to clipboard operation
dlcheck copied to clipboard

Fix NPE

Open vektory79 opened this issue 8 years ago • 2 comments

If method LockGraph.shortestPath returns null, it's lead to NPE in method LockGraph.publishPotentialDeadlockIfNeeded.

vektory79 avatar Apr 20 '17 09:04 vektory79

Have this NPE occurred? The LockGraph.shortestPath method is called only if a cycle is detected, so it cannot return null. Maybe changing "return null" to "throw new IllegalStateException(...)" is a better solution.

ndkoval avatar Apr 23 '17 20:04 ndkoval

Yes.

Finally I reproduce this error again: https://gist.github.com/vektory79/34ec4225ada199d67bd40b034300b8fa

dlcheck.log looks lake: https://gist.github.com/vektory79/d70a87b25da7b3d27ca79fc2fc44d3b9

vektory79 avatar May 22 '17 15:05 vektory79