mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
anonym -> inner: ensure encoded (IDEA-201012)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class ConvertAnonymousToInner {
|
||||
|
||||
boolean myFast = true;
|
||||
|
||||
void convert(boolean fast) {
|
||||
new Object() {<caret>
|
||||
public String toString() {
|
||||
if (myFast != fast) {
|
||||
myFast = fast;
|
||||
System.out.println(fast);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
class ConvertAnonymousToInner {
|
||||
|
||||
boolean myFast = true;
|
||||
|
||||
void convert(boolean fast) {
|
||||
new MyObject(fast);
|
||||
}
|
||||
|
||||
private class MyObject {
|
||||
private final boolean myFast;
|
||||
|
||||
public MyObject(boolean fast) {
|
||||
myFast = fast;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
if (ConvertAnonymousToInner.this.myFast != myFast) {
|
||||
ConvertAnonymousToInner.this.myFast = myFast;
|
||||
System.out.println(myFast);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user