mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
make static: move field initialization to constructors if it depends on introduced fields
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
public class YoYo {
|
||||
Object y;
|
||||
class <caret>YoYoYo {
|
||||
Object x = y;
|
||||
Object[] xx = {y};
|
||||
void foo (){
|
||||
YoYo yoYoy = YoYo.this;
|
||||
Object t = y;
|
||||
Object t1 = yoYoy.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
public class YoYo {
|
||||
Object y;
|
||||
static class YoYoYo {
|
||||
Object x;
|
||||
Object[] xx;
|
||||
private YoYo anObject;
|
||||
private Object y;
|
||||
|
||||
public YoYoYo(YoYo anObject, Object y) {
|
||||
this.anObject = anObject;
|
||||
this.y = y;
|
||||
this.x = y;
|
||||
this.xx = new Object[]{y};
|
||||
}
|
||||
|
||||
void foo (){
|
||||
YoYo yoYoy = anObject;
|
||||
Object t = y;
|
||||
Object t1 = yoYoy.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user