-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
HuntBugs is the unofficial successor to Findbugs on a clean code base. The remaining warnings are all false positives and not sure how to suppress individually. It did find a few mistakes where the array was checked for null, rather than its element (weak key null guard). See https://github.com/amaembo/huntbugs for details.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1634,7 +1634,7 @@ V putSlow(K key, V value, int newWeight, boolean notifyWriter, boolean onlyIfAbs | |
nodeKey[0] = n.getKey(); | ||
oldValue[0] = n.getValue(); | ||
oldWeight[0] = n.getWeight(); | ||
if ((nodeKey == null) || (oldValue[0] == null)) { | ||
if ((nodeKey[0] == null) || (oldValue[0] == null)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ben-manes
Author
Owner
|
||
cause[0] = RemovalCause.COLLECTED; | ||
} else if (hasExpired(n, now)) { | ||
cause[0] = RemovalCause.EXPIRED; | ||
|
@@ -1994,7 +1994,7 @@ V doComputeIfAbsent(K key, Object keyRef, | |
nodeKey[0] = n.getKey(); | ||
weight[0] = n.getWeight(); | ||
oldValue[0] = n.getValue(); | ||
if ((nodeKey == null) || (oldValue[0] == null)) { | ||
if ((nodeKey[0] == null) || (oldValue[0] == null)) { | ||
cause[0] = RemovalCause.COLLECTED; | ||
} else if (hasExpired(n, now)) { | ||
cause[0] = RemovalCause.EXPIRED; | ||
|
@@ -2141,7 +2141,7 @@ V remap(K key, Object keyRef, BiFunction<? super K, ? super V, ? extends V> rema | |
synchronized (n) { | ||
nodeKey[0] = n.getKey(); | ||
oldValue[0] = n.getValue(); | ||
if ((nodeKey == null) || (oldValue[0] == null)) { | ||
if ((nodeKey[0] == null) || (oldValue[0] == null)) { | ||
cause[0] = RemovalCause.COLLECTED; | ||
} else if (hasExpired(n, now)) { | ||
cause[0] = RemovalCause.EXPIRED; | ||
|
Could this have theoretically caused missing removal event callbacks?