mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
invert boolean: invert assignment if used as expression (IDEA-152284)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
class C {
|
||||
boolean f<caret>oo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
boolean a, b;
|
||||
a = b = foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class C {
|
||||
void bar() {
|
||||
boolean a, <caret>b;
|
||||
a = b = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class C {
|
||||
void bar() {
|
||||
boolean a, bInverted;
|
||||
a = !(bInverted = true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class C {
|
||||
boolean fooInverted() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void bar() {
|
||||
boolean a, b;
|
||||
a = b = !fooInverted();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user