Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Staged
-
2.4.0
-
None
-
None
Description
Inspired by PROTON-1572, I am raising similar Jira for FindBugs issues in Artemis. The best way to get at an up-to-date list is probably either just run FindBugs (there are IDE plugins for ease of use) or look into Coverity Scan results. As far as I know, anybody who requests access to Artemis Coverity issues will promptly get it.
I noticed these two issues there, which prompted me to raise this Jira, but there is more. Probably not serious, the dead code certainly, the other one probably, but something that should be eventually fixed.
NetworkHealthCheck.java
https://scan7.coverity.com/reports.htm#v10043/p14213/fileInstanceId=33820734&defectInstanceId=7426786&mergedDefectId=1455416
375 private void readStream(InputStream stream, boolean error) throws IOException { CID 1418794: Dm: Dubious method used (FB.DM_DEFAULT_ENCODING) [select issue] 376 BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); 377 378 String inputLine; cond_notnull: Condition (inputLine = reader.readLine()) != null, taking true branch. Now the value of inputLine is not null. 379 while ((inputLine = reader.readLine()) != null) { 380 if (error) { notnull: At condition inputLine == null, the value of inputLine cannot be null. dead_error_condition: The condition inputLine == null cannot be true. CID 1455416: Logically dead code (DEADCODE) dead_error_line: Execution cannot reach the expression " " inside this statement: org.apache.activemq.artemis.... 381 ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine == null ? " " : inputLine); 382 } else { 383 logger.trace(inputLine); 384 } 385 } 386 387 reader.close(); 388 }
ActiveMQFilterPredicate.java
https://scan7.coverity.com/reports.htm#v10043/p14213/fileInstanceId=33820887&defectInstanceId=7427212&mergedDefectId=1455392
100 private boolean contains(Object field, Object value) { 101 if (field == null) { deref: Directly dereferencing value. CID 1455401: Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking value suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 102 return (value.equals("") || value == null); 103 } 104 return field.toString().contains(value.toString()); 105 }
Attachments
Attachments
Issue Links
- contains
-
ARTEMIS-1671 FindBugs: Null pointer dereferences (FORWARD_NULL) in AbstractJournalStorageManager.java
- Resolved
-
ARTEMIS-1672 Coverity: Null pointer dereferences (REVERSE_INULL) in ActiveMQServerImpl.java
- Resolved
-
ARTEMIS-1673 Coverity: Null pointer dereferences (NULL_RETURNS) in PageSubscriptionImpl.java
- Resolved
- incorporates
-
ARTEMIS-1406 FindBugs: impossible instanceof in exception handler in MappedSequentialFile.java
- Resolved
-
ARTEMIS-1407 FindBugs: Suspicious calls to generic collection methods in AMQPConnectionCallback.java
- Resolved
-
ARTEMIS-1634 Coverity: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) in QueueControlImpl.java
- Resolved
-
ARTEMIS-1635 Coverity: Resource leaks (RESOURCE_LEAK) in JDBCFileUtils.java
- Resolved
-
ARTEMIS-1636 Coverity: Null pointer dereferences (FORWARD_NULL) in JournalStorageManager.java
- Resolved
-
ARTEMIS-1399 FindBugs: Comparing incompatible types for equality in QueueFilterPredicate.java
- Resolved
-
ARTEMIS-1408 FindBugs: Synchronization on java.util.concurrent objects in MQTTSessionState.java
- Resolved
-
ARTEMIS-1395 FindBugs: Dubious method used: System.exit() in CoreMessage#toString()
- Resolved
-
ARTEMIS-1412 Coverity: Use of freed resources in LargeMessageControllerImpl.java
- Resolved
-
ARTEMIS-1414 Coverity: Resource leak on an exceptional path in ArtemisCreatePlugin.java
- Resolved
-
ARTEMIS-1411 Coverity: Using invalid iterator in ProcessBuilder.java
- Closed
-
ARTEMIS-1152 Investigate suspected Double-Checked Locking
- Open
- is part of
-
ARTEMIS-1409 FindBugs: inefficient use of keySet iterator instead of entrySet iterator
- Resolved
-
ARTEMIS-1410 Coverity: Identical code for different branches
- Resolved
- links to