forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for unique.leaked warning on constructors (Feature request typeto…
…ols#3313) using .astub files, with test cases
- Loading branch information
1 parent
60354d3
commit 7794ac9
Showing
3 changed files
with
25 additions
and
5 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
7 changes: 7 additions & 0 deletions
7
framework/src/main/java/org/checkerframework/common/aliasing/jdk.astub
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,7 @@ | ||
import org.checkerframework.common.aliasing.qual.*; | ||
|
||
package java.lang; | ||
|
||
class Object { | ||
@Unique Object(); | ||
} |
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,16 @@ | ||
import org.checkerframework.common.aliasing.qual.Unique; | ||
|
||
class ParentUniqueClass{ | ||
|
||
// No need for @SuppressWarnings() | ||
@Unique ParentUniqueClass(){ | ||
// Doesn't raise unique.leaked error since it's a parent class (top of heirarchy) | ||
} | ||
} | ||
|
||
class ChildUniqueClass extends ParentUniqueClass { | ||
|
||
@Unique ChildUniqueClass(){ | ||
// Doesn't raise unique.leaked error since its parent is @Unique | ||
} | ||
} |