Findbugs fixes
Testing Sonar with a few findbugs fixes. Suppressing a false positive to see if it works. Change-Id: I0cdf2921198787adc56c680840aa00bdd254269b
Showing
2 changed files
with
8 additions
and
0 deletions
... | @@ -210,7 +210,12 @@ public class FooComponent { | ... | @@ -210,7 +210,12 @@ public class FooComponent { |
210 | } | 210 | } |
211 | } | 211 | } |
212 | int retry = 5; | 212 | int retry = 5; |
213 | + | ||
213 | do { | 214 | do { |
215 | + if (vv == null) { | ||
216 | + log.error("Shouldn't reach here - value is null"); | ||
217 | + break; | ||
218 | + } | ||
214 | ByteBuffer prev = ByteBuffer.wrap(vv.value()); | 219 | ByteBuffer prev = ByteBuffer.wrap(vv.value()); |
215 | long next = prev.getLong() + 1; | 220 | long next = prev.getLong() + 1; |
216 | byte[] newValue = ByteBuffer.allocate(Long.BYTES).putLong(next).array(); | 221 | byte[] newValue = ByteBuffer.allocate(Long.BYTES).putLong(next).array(); | ... | ... |
... | @@ -94,6 +94,9 @@ public class ClusterMessagingProtocolClient implements ProtocolClient { | ... | @@ -94,6 +94,9 @@ public class ClusterMessagingProtocolClient implements ProtocolClient { |
94 | } | 94 | } |
95 | 95 | ||
96 | @Override | 96 | @Override |
97 | +// @edu.umd.cs.findbugs.annotations.SuppressWarnings | ||
98 | +// (value="NP_NONNULL_PARAM_VIOLATION", | ||
99 | +// justification="False positives on completedFuture call, passing null as a parameter is allowed") | ||
97 | public synchronized CompletableFuture<Void> connect() { | 100 | public synchronized CompletableFuture<Void> connect() { |
98 | if (remoteNode != null) { | 101 | if (remoteNode != null) { |
99 | // done | 102 | // done | ... | ... |
-
Please register or login to post a comment