Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addAssert/beforeInEnumInitializer.java
Tagir Valeev fdb5a1025d [java-inspections] CodeBlockSurrounder: disable in enum initializers
We could devise something like ((Runnable)() -> {...}).run() but this kind of code looks too ugly.
Fixes IDEA-252688 Assertion error when applying fix to assert not null in enums

GitOrigin-RevId: 6f2122acb60cfcb074cc47e6bc599626fe5547fd
2020-10-14 05:42:27 +00:00

6 lines
121 B
Java

// "Assert 'field != null'" "false"
enum A {
I(field.<caret>hashCode());
private static Object field;
A(int i) {}
}