mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-15281 A method/constructor parameter which is written (before read) should be treated as redundant implemented
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>2</line>
|
||||
<description>Parameter can be converted to a variable</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1,8 @@
|
||||
class Temp {
|
||||
public Temp(int p) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
p = i;
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>4</line>
|
||||
<description>Parameter can be converted to a variable</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1,13 @@
|
||||
class Temp {
|
||||
public boolean flag;
|
||||
|
||||
void test(int p) {
|
||||
if (flag) {
|
||||
p = 1;
|
||||
}
|
||||
else {
|
||||
p = 2;
|
||||
}
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>3</line>
|
||||
<description>Parameter can be converted to a variable</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1,7 @@
|
||||
class Temp {
|
||||
|
||||
void test(int p) {
|
||||
p = 1;
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Convert to local variable" "true"
|
||||
class Temp {
|
||||
public Temp() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
<caret>int p = i;
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Convert to local variable" "true"
|
||||
class Temp {
|
||||
public boolean flag;
|
||||
|
||||
void test() {
|
||||
<caret>int p;
|
||||
if (flag) {
|
||||
p = 1;
|
||||
}
|
||||
else {
|
||||
p = 2;
|
||||
}
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Convert to local variable" "true"
|
||||
class Temp {
|
||||
|
||||
void test() {
|
||||
<caret>int p = 1;
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Convert to local variable" "true"
|
||||
class Temp {
|
||||
public Temp(int <caret>p) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
p = i;
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Convert to local variable" "true"
|
||||
class Temp {
|
||||
public boolean flag;
|
||||
|
||||
void test(int <caret>p) {
|
||||
if (flag) {
|
||||
p = 1;
|
||||
}
|
||||
else {
|
||||
p = 2;
|
||||
}
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Convert to local variable" "true"
|
||||
class Temp {
|
||||
|
||||
void test(int <caret>p) {
|
||||
p = 1;
|
||||
System.out.print(p);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user