Skip to content

Commit

Permalink
False positive warning "Potential resource leak" inside "try with res…
Browse files Browse the repository at this point in the history
…ources" (eclipse-jdt#2725)

fix regression on windows by avoiding test program execution

fixes eclipse-jdt#2642
  • Loading branch information
stephan-herrmann authored Jul 18, 2024
1 parent 433d2c4 commit 25606f2
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7280,6 +7280,7 @@ public void testGH2642() {
"""
import java.io.FileWriter;
public class DemoNonCloseableWarning {
Zork err;
public static void main(String[] args) throws Exception {
try (FileWriter writer = new FileWriter("/dev/null")) {
writer.append("\\n");
Expand All @@ -7288,7 +7289,14 @@ public static void main(String[] args) throws Exception {
}
"""
},
"",
"""
----------
1. ERROR in DemoNonCloseableWarning.java (at line 3)
Zork err;
^^^^
Zork cannot be resolved to a type
----------
""",
options);
}
}

0 comments on commit 25606f2

Please sign in to comment.