mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
inline to anonymous: wrap code with code block when needed (IDEA-86007)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
public class Demo {
|
||||
|
||||
static class MyParent {
|
||||
private final String value;
|
||||
|
||||
MyParent(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
static class MyC<caret>hild extends MyParent {
|
||||
MyChild(String value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
String value = "something";
|
||||
final MyParent p;
|
||||
if (true)
|
||||
p = new MyChild(value);
|
||||
else
|
||||
p = new MyParent("value");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
public class Demo {
|
||||
|
||||
static class MyParent {
|
||||
private final String value;
|
||||
|
||||
MyParent(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
String value = "something";
|
||||
final MyParent p;
|
||||
if (true) {
|
||||
final String value1 = value;
|
||||
p = new MyParent(value1);
|
||||
}
|
||||
else
|
||||
p = new MyParent("value");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user