mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
option to ignore fields used in multiple methods to be converted to local (IDEA-108517)
This commit is contained in:
+6
-9
@@ -1,13 +1,10 @@
|
||||
class Test {
|
||||
private int f;
|
||||
private int f;
|
||||
|
||||
void foo () {
|
||||
f = 0;
|
||||
int k = f;
|
||||
}
|
||||
public void bar() {
|
||||
foo(() -> {f++;});
|
||||
}
|
||||
|
||||
int bar () {
|
||||
f = 5;
|
||||
return f;
|
||||
}
|
||||
private void foo(Runnable r) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
class Test {
|
||||
private int f;
|
||||
private int f;
|
||||
|
||||
public void bar() {
|
||||
foo(() -> {f++;});
|
||||
}
|
||||
void foo () {
|
||||
f = 0;
|
||||
int k = f;
|
||||
}
|
||||
|
||||
private void foo(Runnable r) {
|
||||
}
|
||||
int bar () {
|
||||
f = 5;
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>2</line>
|
||||
<description>Field can be converted to a local variable</description>
|
||||
</problem>
|
||||
|
||||
</problems>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
private int f;
|
||||
|
||||
void foo () {
|
||||
f = 0;
|
||||
int k = f;
|
||||
}
|
||||
|
||||
int bar () {
|
||||
f = 5;
|
||||
return f;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user