ConvertToLocalInspection: changed quick-fix to explicitly show type of code block where field is used (IDEA-CR-42222)

This commit is contained in:
Artemiy Sartakov
2019-02-05 13:26:10 +07:00
parent de56823187
commit 1b87c1a508
14 changed files with 33 additions and 25 deletions
@@ -1,4 +1,4 @@
// "Convert field to local variable in method 'IntelliJBugConvertToLocal'" "true"
// "Convert field to local variable in constructor" "true"
import java.util.ArrayList;
class ITest {
@@ -1,4 +1,4 @@
// "Convert field to local variable in method 'Test'" "true"
// "Convert field to local variable in constructor" "true"
class Test {
public Test(String param) {
@@ -1,4 +1,4 @@
// "Convert to local" "true"
// "Convert field to local variable in initializer section" "true"
class TestInitializer {
{
@@ -1,4 +1,4 @@
// "Convert field to local variables in 2 methods" "true"
// "Convert to local" "true"
class Test {
int getFoo1() {
@@ -1,4 +1,4 @@
// "Convert field to local variable in method 'FieldCanBeLocalTest'" "true"
// "Convert field to local variable in constructor" "true"
import javax.swing.*;
@@ -1,4 +1,4 @@
// "Convert field to local variable in method 'IntelliJBugConvertToLocal'" "true"
// "Convert field to local variable in constructor" "true"
import java.util.ArrayList;
class ITest {
@@ -1,4 +1,4 @@
// "Convert field to local variable in method 'Test'" "true"
// "Convert field to local variable in constructor" "true"
class Test {
private final String f<caret>ield;
@@ -1,4 +1,4 @@
// "Convert to local" "true"
// "Convert field to local variable in initializer section" "true"
class TestInitializer {
private boolean fie<caret>ld;
@@ -1,4 +1,4 @@
// "Convert field to local variables in 2 methods" "true"
// "Convert to local" "true"
class Test {
private int my<caret>Foo;
@@ -1,4 +1,4 @@
// "Convert to local" "false"
// "Fix all 'Field can be local' problems in file" "false"
class MyClassTest {
private boolean edit<caret>able = false;
@@ -1,4 +1,4 @@
// "Convert field to local variable in method 'FieldCanBeLocalTest'" "true"
// "Convert field to local variable in constructor" "true"
import javax.swing.*;
@@ -1,4 +1,4 @@
// "Convert to local" "false"
// "Fix all 'Field can be local' problems in file" "false"
class TestFieldConversion
{
private static int som<caret>eInt = 0;