java-topology/test/langtools/tools/javac/multicatch/Neg02eff_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

27 lines
590 B
Java

/*
* @test /nodynamiccopyright/
* @bug 6943289 6993963
*
* @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch')
* @author mcimadamore
* @compile/fail/ref=Neg02eff_final.out -XDrawDiagnostics Neg02eff_final.java
*
*/
class Neg02eff_final {
static class A extends Exception {}
static class B extends Exception {}
void m() {
try {
if (true) {
throw new A();
}
else {
throw new B();
}
} catch (A | B ex) {
ex = new B();
}
}
}