remove redundant initializer: cope with field initializer side effects

EA-113714 - CCE: RemoveInitializerFix.lambda$sideEffectAwareRemove$
This commit is contained in:
Anna.Kozlova
2017-12-14 18:45:49 +01:00
parent e6eb7b137a
commit 65d06951f4
3 changed files with 34 additions and 0 deletions
@@ -0,0 +1,16 @@
// "Remove redundant initializer" "true"
class A {
private String myFoo;
{
abc();
}
protected String abc() {
return "";
}
public A(String myFoo) {
this.myFoo = myFoo;
}
}
@@ -0,0 +1,12 @@
// "Remove redundant initializer" "true"
class A {
private String myFoo = ab<caret>c();
protected String abc() {
return "";
}
public A(String myFoo) {
this.myFoo = myFoo;
}
}