Skip to content

Commit

Permalink
Cleanup tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-tylenda-sonarsource committed Dec 10, 2024
1 parent 991f333 commit a20a1cc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import lombok.Cleanup;

class UnclosedResourcesLombokCheck {
public void wrongHandling() throws IOException {
FileInputStream stream = new FileInputStream("myFile"); // Noncompliant
stream.read();
public void missingAnnotation(String fileName) throws IOException {
InputStream in = new FileInputStream(fileName); // Noncompliant
in.read();
}

void withLombokCleanup(String fileName) throws IOException {
public void sameButAnnotated(String fileName) throws IOException {
@Cleanup
InputStream in = new FileInputStream(fileName);
in.read();
Expand Down

0 comments on commit a20a1cc

Please sign in to comment.