mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dfa: suppress constant condition checking for expression-internal assignments (IDEA-31697)
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems/>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
public class NonconstantCondition {
|
||||
void test(boolean flag) {
|
||||
if (flag == (flag = true)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class Contracts {
|
||||
|
||||
void test(boolean flag) {
|
||||
if (flag == (flag = true)) System.out.println();
|
||||
|
||||
int x = 1;
|
||||
boolean y = x == (x +=1); // returns false
|
||||
if (y) System.out.println();
|
||||
|
||||
int k = 1;
|
||||
boolean z = (k +=1) == k; // returns true
|
||||
if (z) System.out.println();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user