MoveFieldAssignmentToInitializerInspection: allow unknown methods

As this is intention-like part of inspection (no warning), we can allow it even if we are not sure that semantics will be preserved. See comments in IDEA-177602
This commit is contained in:
Tagir Valeev
2017-10-09 16:36:51 +07:00
parent a89e180534
commit 08cea712a2
3 changed files with 32 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
// "Move assignment to field declaration" "INFORMATION"
public class Test {
String myField = getValue();
private String value;
void f() {
}
public String getValue() {
return value+value;
}
}

View File

@@ -0,0 +1,13 @@
// "Move assignment to field declaration" "INFORMATION"
public class Test {
String myField;
private String value;
void f() {
<caret>myField = getValue();
}
public String getValue() {
return value+value;
}
}