-
Notifications
You must be signed in to change notification settings - Fork 688
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARJAVA-4436 Fix FP on S2095 when using @lombok.Cleanup (#4957)
Co-authored-by: Dorian Burihabwa <[email protected]>
- Loading branch information
1 parent
565282b
commit 2d6bb09
Showing
3 changed files
with
47 additions
and
1 deletion.
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
18 changes: 18 additions & 0 deletions
18
...cution/java-symbolic-execution-plugin/src/test/files/se/UnclosedResourcesLombokCheck.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,18 @@ | ||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import lombok.Cleanup; | ||
|
||
class UnclosedResourcesLombokCheck { | ||
public void fullyQualified(String fileName) throws IOException { | ||
@lombok.Cleanup | ||
InputStream in = new FileInputStream(fileName); | ||
in.read(); | ||
} | ||
|
||
public void annotated(String fileName) throws IOException { | ||
@Cleanup | ||
InputStream in = new FileInputStream(fileName); | ||
in.read(); | ||
} | ||
} |
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