RFR: 7176515: ExceptionInInitializerError for an enum with multiple switch statements [v2]
Archie L. Cobbs
duke at openjdk.org
Fri Oct 21 19:29:34 UTC 2022
On Fri, 21 Oct 2022 18:17:35 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> Archie L. Cobbs has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Give test a better name and don't rely on assertions being enabled.
>
> test/langtools/tools/javac/enum/T7176515.java line 32:
>
>> 30: import java.math.RoundingMode;
>> 31:
>> 32: public class T7176515 {
>
> We've generally moved away from naming test after the bug number, although that was a long-standing practice in the past.
Thanks for the heads-up. Test name updated in 8cd5b49c5f2.
> test/langtools/tools/javac/enum/T7176515.java line 90:
>
>> 88: boolean shouldBeOdd = true;
>> 89: for (MyEnum x : MyEnum.values()) {
>> 90: assert x.isOdd() == shouldBeOdd;
>
> While we do typically run the tests with assertions enabled, it is preferable if the tests did not rely on that for proper operation.
Good idea - thanks. Fixed in 8cd5b49c5f2.
-------------
PR: https://git.openjdk.org/jdk/pull/10797
More information about the compiler-dev
mailing list