field can be local extended: suggest read only fields used in e.g. constructor once as can be local; process inner class constructors as methods (IDEA-52670)

This commit is contained in:
anna
2010-03-05 14:07:36 +03:00
parent 9e086ac5f3
commit b728796708
6 changed files with 45 additions and 6 deletions
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems/>
@@ -0,0 +1,11 @@
public class Outer {
private int value = 0;
public class Inner {
private final int myValue;
public Inner() {
myValue = value++;
}
}
}
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>Test.java</file>
<line>2</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Field can be local</problem_class>
<description>Field can be converted to a local variable</description>
</problem>
</problems>
@@ -0,0 +1,11 @@
public class Outer {
private int value = 0;
public class Inner {
private final int myValue;
public Inner() {
myValue = value;
}
}
}