Skip to content

Commit

Permalink
fix FinalizerNullsFields not checking method signature (spotbugs#3210)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuditKnoll authored Dec 3, 2024
1 parent 2a69d08 commit 711dde8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Currently the versioning policy of this project follows [Semantic Versioning v2.
- Added missing comma between line number and confidence when describing matching and mismatching bugs for tests ([#3187](https://github.com/spotbugs/spotbugs/pull/3187))
- Fixed method matchers with array types ([#3203](https://github.com/spotbugs/spotbugs/issues/3203))
- Fix SARIF report's message property in Exception to meet the standard ([#3197](https://github.com/spotbugs/spotbugs/issues/3197))
- Fixed `FI_FINALIZER_NULLS_FIELDS` FPs for functions called finalize() but not with the correct signature. ([#3207](https://github.com/spotbugs/spotbugs/issues/3207))

### Cleanup
- Cleanup thread issue and regex issue in test-harness ([#3130](https://github.com/spotbugs/spotbugs/issues/3130))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import org.apache.bcel.Const;
import org.apache.bcel.classfile.Code;
import org.apache.bcel.classfile.Field;
import org.apache.bcel.classfile.Method;

import edu.umd.cs.findbugs.BugAccumulator;
Expand Down Expand Up @@ -53,16 +52,7 @@ public FinalizerNullsFields(BugReporter bugReporter) {

@Override
public void visit(Method obj) {
if ("finalize".equals(obj.getName())) {
inFinalize = true;
} else {
inFinalize = false;
}
}

@Override
public void visit(Field obj) {

inFinalize = "finalize".equals(obj.getName()) && "()V".equals(obj.getSignature());
}

@Override
Expand Down

0 comments on commit 711dde8

Please sign in to comment.