You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I found an inconsistent detection result about the rule SA_FIELD_SELF_ASSIGNMENT, the code example is below. SpotBugs can detect the bug in line 4, but cannot in line 8. These two lines are equivalent, hence, I think this is a false negative.
publicclassC {
intfoo;
voidfoo1() {
foo = foo++; // can report a warning in this line
}
classsubC {
voidfoo2() {
foo = foo++; // should report a warning in this line
}
}
}
SpotBugs version: 4.7.1
The text was updated successfully, but these errors were encountered:
Bug `SA_FIELD_SELF_ASSIGNMENT` was not reported in nested classes, only in the outer class. This lead to inconsistent behavior. See issue ([spotbugs#2142](spotbugs#2142)). This PR fixes this issue.
* Report bug `SA_FIELD_SELF_ASSIGNMENT` in nested classes as well
Bug `SA_FIELD_SELF_ASSIGNMENT` was not reported in nested classes, only in the outer class. This lead to inconsistent behavior. See issue ([#2142](#2142)). This PR fixes this issue.
* Update spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindFieldSelfAssignment.java
Co-authored-by: Kengo TODA <skypencil+github@gmail.com>
* Update spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindFieldSelfAssignment.java
Co-authored-by: Kengo TODA <skypencil+github@gmail.com>
* Fixed according to the comments of @KengoTODA
Co-authored-by: Kengo TODA <skypencil@gmail.com>
Co-authored-by: Kengo TODA <skypencil+github@gmail.com>
Hi, I found an inconsistent detection result about the rule SA_FIELD_SELF_ASSIGNMENT, the code example is below. SpotBugs can detect the bug in line 4, but cannot in line 8. These two lines are equivalent, hence, I think this is a false negative.
SpotBugs version: 4.7.1
The text was updated successfully, but these errors were encountered: