mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Java control flow: Added conditional branch that bypasses assert statement because assertions can be disabled (IDEA-71526)
This commit is contained in:
+8
@@ -274,4 +274,12 @@ class InitializedInClassInitializerUsedInTheFollowingFieldInitializer {
|
||||
{
|
||||
k = 1;
|
||||
}
|
||||
}
|
||||
|
||||
class AssignInAssert {
|
||||
<error descr="Variable 'b' might not have been initialized">private final boolean b</error>;
|
||||
|
||||
AssignInAssert() {
|
||||
assert b = true;
|
||||
}
|
||||
}
|
||||
+9
@@ -435,4 +435,13 @@ class ClassInitializerConstantEval {
|
||||
<error descr="Variable 'x' might already have been assigned to">x</error> = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AssignInAssert {
|
||||
void f() {
|
||||
boolean a;
|
||||
assert a = true;
|
||||
if(<error descr="Variable 'a' might not have been initialized">a</error>)
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user