[jira] [Commented] (ARTEMIS-1400) FindBugs warnings
[ https://issues.apache.org/jira/browse/ARTEMIS-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358142#comment-16358142 ] ASF GitHub Bot commented on ARTEMIS-1400: - Github user jdanekrh commented on the pull request: https://github.com/apache/activemq-artemis/commit/dc41f3ca491e96e199290a225fdaa07ac05d66df#commitcomment-27446263 Issues created and linked onto https://issues.apache.org/jira/browse/ARTEMIS-1400. > FindBugs warnings > - > > Key: ARTEMIS-1400 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1400 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.4.0 >Reporter: Jiri Daněk >Priority: Minor > Fix For: 2.4.0 > > Attachments: > findbugs-3.0.1_apache-artemis-2.4.0-20170906.150547-13-bin.html > > > 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 > {noformat} > 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 > 381ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine == > null ? " " : inputLine); > 382 } else { > 383logger.trace(inputLine); > 384 } > 385 } > 386 > 387 reader.close(); > 388 } > {noformat} > ActiveMQFilterPredicate.java > https://scan7.coverity.com/reports.htm#v10043/p14213/fileInstanceId=33820887&defectInstanceId=7427212&mergedDefectId=1455392 > {noformat} > 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 } > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (ARTEMIS-1400) FindBugs warnings
[ https://issues.apache.org/jira/browse/ARTEMIS-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16161491#comment-16161491 ] ASF GitHub Bot commented on ARTEMIS-1400: - Github user asfgit closed the pull request at: https://github.com/apache/activemq-artemis/pull/1524 > FindBugs warnings > - > > Key: ARTEMIS-1400 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1400 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.4.0 >Reporter: Jiri Danek >Priority: Minor > Fix For: 2.4.0 > > Attachments: > findbugs-3.0.1_apache-artemis-2.4.0-20170906.150547-13-bin.html > > > 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 > {noformat} > 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 > 381ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine == > null ? " " : inputLine); > 382 } else { > 383logger.trace(inputLine); > 384 } > 385 } > 386 > 387 reader.close(); > 388 } > {noformat} > ActiveMQFilterPredicate.java > https://scan7.coverity.com/reports.htm#v10043/p14213/fileInstanceId=33820887&defectInstanceId=7427212&mergedDefectId=1455392 > {noformat} > 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 } > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (ARTEMIS-1400) FindBugs warnings
[ https://issues.apache.org/jira/browse/ARTEMIS-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16161490#comment-16161490 ] ASF subversion and git services commented on ARTEMIS-1400: -- Commit a07cb45222f175a405866b863da5eca33e44f736 in activemq-artemis's branch refs/heads/master from [~tabish121] [ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=a07cb45 ] ARTEMIS-1400 Fix some minor issues spotted with FindBugs Remove a bit of dead code, and invert two string tests that were testing for null after comparing the value to empty string (NPE scenario). > FindBugs warnings > - > > Key: ARTEMIS-1400 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1400 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.4.0 >Reporter: Jiri Danek >Priority: Minor > Fix For: 2.4.0 > > Attachments: > findbugs-3.0.1_apache-artemis-2.4.0-20170906.150547-13-bin.html > > > 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 > {noformat} > 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 > 381ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine == > null ? " " : inputLine); > 382 } else { > 383logger.trace(inputLine); > 384 } > 385 } > 386 > 387 reader.close(); > 388 } > {noformat} > ActiveMQFilterPredicate.java > https://scan7.coverity.com/reports.htm#v10043/p14213/fileInstanceId=33820887&defectInstanceId=7427212&mergedDefectId=1455392 > {noformat} > 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 } > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (ARTEMIS-1400) FindBugs warnings
[ https://issues.apache.org/jira/browse/ARTEMIS-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16161464#comment-16161464 ] Timothy Bish commented on ARTEMIS-1400: --- I recommend closing this as resolved and if you see further bugs that appear to be real issues to open new issues for them otherwise this issue will sit open forever and not track with correct release information. > FindBugs warnings > - > > Key: ARTEMIS-1400 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1400 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.4.0 >Reporter: Jiri Danek >Priority: Minor > Attachments: > findbugs-3.0.1_apache-artemis-2.4.0-20170906.150547-13-bin.html > > > 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 > {noformat} > 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 > 381ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine == > null ? " " : inputLine); > 382 } else { > 383logger.trace(inputLine); > 384 } > 385 } > 386 > 387 reader.close(); > 388 } > {noformat} > ActiveMQFilterPredicate.java > https://scan7.coverity.com/reports.htm#v10043/p14213/fileInstanceId=33820887&defectInstanceId=7427212&mergedDefectId=1455392 > {noformat} > 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 } > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (ARTEMIS-1400) FindBugs warnings
[ https://issues.apache.org/jira/browse/ARTEMIS-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16158808#comment-16158808 ] Timothy Bish commented on ARTEMIS-1400: --- PR submitted to cover these cases. > FindBugs warnings > - > > Key: ARTEMIS-1400 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1400 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.4.0 >Reporter: Jiri Danek >Priority: Minor > > 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 > {noformat} > 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 > 381ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine == > null ? " " : inputLine); > 382 } else { > 383logger.trace(inputLine); > 384 } > 385 } > 386 > 387 reader.close(); > 388 } > {noformat} > ActiveMQFilterPredicate.java > https://scan7.coverity.com/reports.htm#v10043/p14213/fileInstanceId=33820887&defectInstanceId=7427212&mergedDefectId=1455392 > {noformat} > 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 } > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (ARTEMIS-1400) FindBugs warnings
[ https://issues.apache.org/jira/browse/ARTEMIS-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16158805#comment-16158805 ] ASF GitHub Bot commented on ARTEMIS-1400: - GitHub user tabish121 opened a pull request: https://github.com/apache/activemq-artemis/pull/1524 ARTEMIS-1400 Fix some minor issues spotted with FindBugs Remove a bit of dead code, and invert two string tests that were testing for null after comparing the value to empty string (NPE scenario). You can merge this pull request into a Git repository by running: $ git pull https://github.com/tabish121/activemq-artemis ARTEMIS-1400 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/activemq-artemis/pull/1524.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1524 commit a02187bb8a487853e4020ec54819bf5bca0ee154 Author: Timothy Bish Date: 2017-09-08T15:41:28Z ARTEMIS-1400 Fix some minor issues spotted with FindBugs Remove a bit of dead code, and invert two string tests that were testing for null after comparing the value to empty string (NPE scenario). > FindBugs warnings > - > > Key: ARTEMIS-1400 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1400 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.4.0 >Reporter: Jiri Danek >Priority: Minor > > 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 > {noformat} > 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 > 381ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine == > null ? " " : inputLine); > 382 } else { > 383logger.trace(inputLine); > 384 } > 385 } > 386 > 387 reader.close(); > 388 } > {noformat} > ActiveMQFilterPredicate.java > https://scan7.coverity.com/reports.htm#v10043/p14213/fileInstanceId=33820887&defectInstanceId=7427212&mergedDefectId=1455392 > {noformat} > 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 } > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)