| 1 |
// Test case for Issue 384: |
| 2 |
// https://github.com/typetools/checker-framework/issues/384 |
| 3 |
|
| 4 |
// TODO: no longer crashes, but still need to ensure annotations |
| 5 |
// are stored correctly. |
| 6 |
|
| 7 |
import org.checkerframework.checker.guieffect.qual.PolyUIType; |
| 8 |
import org.checkerframework.checker.nullness.qual.NonNull; |
| 9 |
|
| 10 |
abstract class UnionTypeBug { |
| 11 |
|
| 12 |
void method() { |
| 13 |
try { |
| 14 |
|
| 15 |
badBoy(); |
| 16 |
|
| 17 |
} catch (@NonNull InnerException1 | @NonNull InnerException2 e) { |
| 18 |
|
| 19 |
} catch (@NonNull InnerException3 | @NonNull InnerException4 e) { |
| 20 |
|
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
abstract void badBoy() |
| 25 |
throws InnerException1, InnerException2, InnerException3, InnerException4; |
| 26 |
|
| 27 |
@PolyUIType |
| 28 |
class InnerException1 extends Exception {} |
| 29 |
|
| 30 |
@PolyUIType |
| 31 |
class InnerException2 extends Exception {} |
| 32 |
|
| 33 |
@PolyUIType |
| 34 |
class InnerException3 extends Exception {} |
| 35 |
|
| 36 |
@PolyUIType |
| 37 |
class InnerException4 extends Exception {} |
| 38 |
} |