java-topology/test/langtools/tools/javac/multicatch/Neg01eff_final.java
russell@unturf.com 0a580b313d 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.
2026-03-26 17:11:57 -04:00

25 lines
642 B
Java

/*
* @test /nodynamiccopyright/
* @bug 6943289
*
* @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch')
* @compile/fail/ref=Neg01eff_final.out -XDrawDiagnostics Neg01eff_final.java
*/
class Neg01eff_final {
static class A extends Exception {}
static class B1 extends A {}
static class B2 extends A {}
class Test {
void m() throws A {
try {
throw new B1();
} catch (A ex1) {
try {
throw ex1; // used to throw A, now throws B1!
} catch (B2 ex2) { }//unreachable
}
}
}
}