-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CT_CONSTRUCTOR_THROW FP when Supertype has final finalize (#2666)
* Fix constructorthrow FP when superclass has final finalize * Add changelog entry * spotlessApply
- Loading branch information
1 parent
a834b53
commit 674a7d0
Showing
5 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
spotbugsTestCases/src/java/constructorthrow/ConstructorThrowNegativeTest12.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package constructorthrow; | ||
|
||
/** | ||
* However the constructor throws an unchecked exception, there is an empty finalize in this class. | ||
*/ | ||
public class ConstructorThrowNegativeTest12 { | ||
public ConstructorThrowNegativeTest12() { | ||
throw new RuntimeException(); // No error, final finalize. | ||
} | ||
|
||
@Override | ||
protected final void finalize(){} | ||
} |
11 changes: 11 additions & 0 deletions
11
spotbugsTestCases/src/java/constructorthrow/ConstructorThrowNegativeTest13.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package constructorthrow; | ||
|
||
/** | ||
* However there is an unchecked exception thrown from the constructor, the superclass contains a final finalize. | ||
* @see <a href="https://github.com/spotbugs/spotbugs/issues/2665">GitHub issue</a> | ||
*/ | ||
public class ConstructorThrowNegativeTest13 extends ConstructorThrowNegativeTest12 { | ||
public ConstructorThrowNegativeTest13() { | ||
throw new RuntimeException(); // No error, final finalize. | ||
} | ||
} |