mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 21:43:33 +07:00
ConvertToLocalInspection: CR fixes (IDEA-CR-42222)
1. localVariableIsCopy -> isLocalVariableCopy 2. added more precise convert to local quick fix message (with info about to where field will be inlined) 3. fixed tests for new convert to local quick fix messages 4. removed inlineVariable(PsiVariable, PsiExpression)
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'getFoo1'" "true"
|
||||
class Test {
|
||||
|
||||
int getFoo1(boolean f) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'IntelliJBugConvertToLocal'" "true"
|
||||
import java.util.ArrayList;
|
||||
|
||||
class ITest {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'Test'" "true"
|
||||
class Test {
|
||||
|
||||
public Test(String param) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'someMethod'" "true"
|
||||
class TestFieldConversion
|
||||
{
|
||||
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Convert to local" "true"
|
||||
class TestInitializer {
|
||||
|
||||
{
|
||||
boolean field = true;
|
||||
System.out.println(field);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variables in 2 methods" "true"
|
||||
class Test {
|
||||
|
||||
int getFoo1() {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'setEditable1'" "true"
|
||||
class MyClassTest {
|
||||
|
||||
private boolean editable = false;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'FieldCanBeLocalTest'" "true"
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'getFoo1'" "true"
|
||||
class Test {
|
||||
private int my<caret>Foo;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'IntelliJBugConvertToLocal'" "true"
|
||||
import java.util.ArrayList;
|
||||
|
||||
class ITest {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'Test'" "true"
|
||||
class Test {
|
||||
|
||||
private final String f<caret>ield;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'someMethod'" "true"
|
||||
class TestFieldConversion
|
||||
{
|
||||
/**
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Convert to local" "true"
|
||||
class TestInitializer {
|
||||
|
||||
private boolean fie<caret>ld;
|
||||
|
||||
{
|
||||
field = true;
|
||||
System.out.println(field);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variables in 2 methods" "true"
|
||||
class Test {
|
||||
private int my<caret>Foo;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'setEditable1'" "true"
|
||||
class MyClassTest {
|
||||
|
||||
private boolean editable = false;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Convert to local" "true"
|
||||
// "Convert field to local variable in method 'FieldCanBeLocalTest'" "true"
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user