Merge remote-tracking branch 'origin/master'

This commit is contained in:
Dmitry Jemerov
2012-05-18 21:07:01 +02:00
124 changed files with 2953 additions and 1109 deletions
@@ -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);
}
}
@@ -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);
}
}
}
@@ -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);
}
}
@@ -0,0 +1,8 @@
// "Convert to local variable" "true"
class Temp {
void test() {
<caret>int p = 1;
System.out.print(p);
}
}
@@ -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);
}
}
}
@@ -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);
}
}
@@ -0,0 +1,8 @@
// "Convert to local variable" "true"
class Temp {
void test(int <caret>p) {
p = 1;
System.out.print(p);
}
}
@@ -0,0 +1,26 @@
public class Demo {
static class MyParent {
private final String value;
MyParent(String value) {
this.value = value;
}
}
static class MyC<caret>hild extends MyParent {
MyChild(String value) {
super(value);
}
}
public static void main(String[] args) {
String value = "something";
final MyParent p;
if (true)
p = new MyChild(value);
else
p = new MyParent("value");
}
}
@@ -0,0 +1,22 @@
public class Demo {
static class MyParent {
private final String value;
MyParent(String value) {
this.value = value;
}
}
public static void main(String[] args) {
String value = "something";
final MyParent p;
if (true) {
final String value1 = value;
p = new MyParent(value1);
}
else
p = new MyParent("value");
}
}