Skip to content

Commit

Permalink
Bogus warning for unassigned resource in ternary expression
Browse files Browse the repository at this point in the history
resolves eclipse-jdt#1762

Regression test, which passes after eclipse-jdt#1716
  • Loading branch information
stephan-herrmann committed Jan 11, 2024
1 parent 4989c7f commit a2acae7
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7035,4 +7035,23 @@ public void testBug499037_010_since_9() {
"----------\n",
options);
}
public void testGH1762() {
runLeakTest(
new String[] {
"X.java",
"""
import java.io.*;
public class X {
void m(String path, ClassLoader loader) throws IOException {
try (InputStream input = loader == null ? new FileInputStream(path) : loader.getResourceAsStream(path)) {
// read
}
}
}
"""
},
"",
null);

}
}

0 comments on commit a2acae7

Please sign in to comment.