mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
inline method: don't repeat field initializer (IDEA-158832)
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
|
||||
class Foo {
|
||||
|
||||
public static final Bar[] bars= new Bar[] {Bar.callMe("a", 0, "A", "B", "C"), Bar.callMe("b", 1, "A", "B")};
|
||||
}
|
||||
|
||||
|
||||
class Bar {
|
||||
|
||||
public Bar(String a, int nr, String... args) {
|
||||
}
|
||||
|
||||
public static Bar call<caret>Me(String a, int nr, String ... args) {
|
||||
return new Bar(a, nr, args);
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
|
||||
class Foo {
|
||||
|
||||
public static final Bar[] bars= new Bar[] {new Bar("a", 0, "A", "B", "C"), new Bar("b", 1, "A", "B")};
|
||||
}
|
||||
|
||||
|
||||
class Bar {
|
||||
|
||||
public Bar(String a, int nr, String... args) {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user