[java-inspections] ReplaceWithConstantValueFix: suggest to extract side effects when applicable

Fixes IDEA-323618 Side-effect ignored by code assist

GitOrigin-RevId: 6206743a4af64948f95d722708e42caf05dda2f3
This commit is contained in:
Tagir Valeev
2023-07-03 20:35:10 +02:00
committed by intellij-monorepo-bot
parent 37ac327415
commit cf2584bfdd
6 changed files with 107 additions and 19 deletions

View File

@@ -0,0 +1,12 @@
// "Replace with '0'" "true-preview"
import java.util.stream.*;
class Test {
public static void method() {
int a = 1;
int b = 0;
b = a;
a = 0;
}
}

View File

@@ -0,0 +1,11 @@
// "Replace with '0'" "true-preview"
import java.util.stream.*;
class Test {
public static void method() {
int a = 1;
int b = 0;
a = (a + b)<caret> - (b = a);
}
}