-
Bug
-
Resolution: Unresolved
-
P3
-
None
-
24, 25
-
None
The meaning of the assertion
Throws: IllegalArgumentException if an existing catch block catches all exceptions is ambiguous. The following piece of code can be interpreted as indefinite:
(Consumer<CodeBuilder.CatchBuilder>) catchBuilder -> {
catchBuilder.catchingAll(tb -> {
tb.astore(1);
tb.iconst_0();
tb.ireturn();
});
catchBuilder.catchingAll(tb -> {
tb.astore(1);
tb.iconst_1();
tb.ireturn();
});
};
Presumably, it should throw an IllegalArgumentException. However, the expected exception is not thrown. Also, no cases were found that could propagate this exception, so the assertion seems superfluous in the specification.
The following sequence also looks like a candidate to throw an IllegalArgumentException:
(Consumer<CodeBuilder.CatchBuilder>) catchBuilder -> {
catchBuilder.catchingAll(
tb -> {
tb.astore(1);
tb.iconst_0();
tb.ireturn();
});
catchBuilder.catching( classDescOf(Exception.class),
tb -> {
tb.astore(1);
tb.iconst_1();
tb.ireturn();
});
}
Throws: IllegalArgumentException if an existing catch block catches all exceptions is ambiguous. The following piece of code can be interpreted as indefinite:
(Consumer<CodeBuilder.CatchBuilder>) catchBuilder -> {
catchBuilder.catchingAll(tb -> {
tb.astore(1);
tb.iconst_0();
tb.ireturn();
});
catchBuilder.catchingAll(tb -> {
tb.astore(1);
tb.iconst_1();
tb.ireturn();
});
};
Presumably, it should throw an IllegalArgumentException. However, the expected exception is not thrown. Also, no cases were found that could propagate this exception, so the assertion seems superfluous in the specification.
The following sequence also looks like a candidate to throw an IllegalArgumentException:
(Consumer<CodeBuilder.CatchBuilder>) catchBuilder -> {
catchBuilder.catchingAll(
tb -> {
tb.astore(1);
tb.iconst_0();
tb.ireturn();
});
catchBuilder.catching( classDescOf(Exception.class),
tb -> {
tb.astore(1);
tb.iconst_1();
tb.ireturn();
});
}