undefect. CWE-407 — 63 sites patched across 27 ecosystems

Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com

Patches, unit tests, benchmarks, whitepaper, and outreach briefs.
Public domain — no copyright claimed. Use freely.
This commit is contained in:
russell@unturf.com 2026-03-26 17:11:57 -04:00
commit 0a580b313d
70422 changed files with 17213626 additions and 0 deletions

View file

@ -0,0 +1,38 @@
/*
* @test /nodynamiccopyright/
* @bug 6970833
* @author Maurizio Cimadamore
* @summary Try-with-resource implementation throws an NPE during Flow analysis
* @compile/fail/ref=ResourceInterface.out -XDrawDiagnostics ResourceInterface.java
*/
class ResourceInterface {
public void test1() {
try(Resource1 r1 = null) { }
}
public void test2() {
try(Resource2 r2 = null) { }
}
static class E1 extends Exception {}
static class E2 extends Exception {}
interface C1 extends AutoCloseable {
void close() throws E1;
}
interface C2 extends AutoCloseable {
void close() throws E2;
}
interface C3 extends AutoCloseable {
void close() throws E2, E1;
}
static interface Resource1 extends C1, C2 {}
static interface Resource2 extends C1, C3 {}
}