Skip to content

Commit

Permalink
Fix some false negative issues about the rule RV_DONT_JUST_NULL_CHECK…
Browse files Browse the repository at this point in the history
…_READLINE (#1823)

* Update BadUseOfReturnValue.java

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update BadUseOfReturnValue.java

* Update CHANGELOG.md

* Update CHANGELOG.md

* update:spotlessApply

Co-authored-by: Kengo TODA <skypencil+github@gmail.com>
Co-authored-by: huaien <Zustin>
  • Loading branch information
Zustin and KengoTODA authored Dec 22, 2021
1 parent d8cef7f commit 24a56b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Currently the versioning policy of this project follows [Semantic Versioning v2.
- Bumped log4j from 2.14.1 to 2.16.0 to address CVE-2021-44228

### Fixed
- False negative about the rule RV_DONT_JUST_NULL_CHECK_READLINE ([#1821](https://github.com/spotbugs/spotbugs/issues/1821)[#1820](https://github.com/spotbugs/spotbugs/issues/1820)[#1819](https://github.com/spotbugs/spotbugs/issues/1819)[#1818](https://github.com/spotbugs/spotbugs/issues/1818))
- Updated RV_01_TO_INT to handle float and long checks ([#1518](https://github.com/spotbugs/spotbugs/issues/1518))

## 4.5.1 - 2021-12-08
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ public void sawOpcode(int seen) {
}

if (seen == Const.INVOKEVIRTUAL && "readLine".equals(getNameConstantOperand())
&& "()Ljava/lang/String;".equals(getSigConstantOperand()) && getClassConstantOperand().startsWith("java/io")
&& !"java/io/LineNumberReader".equals(getClassConstantOperand())) {
&& "()Ljava/lang/String;".equals(getSigConstantOperand()) &&
((getClassConstantOperand().startsWith("java/io") && !"java/io/LineNumberReader".equals(getClassConstantOperand())) ||
(getClassConstantOperand().startsWith("javax/imageio/stream")))) {
readLineOnTOS = true;
} else if (readLineOnTOS) {
if (seen == Const.IFNULL || seen == Const.IFNONNULL) {
Expand Down

0 comments on commit 24a56b5

Please sign in to comment.