mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
Java: Reworked introducing the parameters in duplicate fragments to support repeated argument values (IDEA-201024)
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
class C {
|
||||
void foo(String s, StringBuilder b) {
|
||||
b.append("repeated");
|
||||
b.append("repeated");
|
||||
b.append("repeated");
|
||||
|
||||
<selection>
|
||||
b.append("a");
|
||||
b.append("a");
|
||||
b.append("a");
|
||||
</selection>
|
||||
b.append("d");
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class C {
|
||||
void foo(String s, StringBuilder b) {
|
||||
newMethod(b, "repeated");
|
||||
|
||||
|
||||
newMethod(b, "a");
|
||||
|
||||
b.append("d");
|
||||
}
|
||||
|
||||
private void newMethod(StringBuilder b, String a) {
|
||||
b.append(a);
|
||||
b.append(a);
|
||||
b.append(a);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class C {
|
||||
void foo(String s, StringBuilder b) {
|
||||
b.append("repeated");
|
||||
b.append(s);
|
||||
b.append("repeated");
|
||||
|
||||
<selection>
|
||||
b.append("a");
|
||||
b.append("b");
|
||||
b.append("c");
|
||||
</selection>
|
||||
b.append("d");
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class C {
|
||||
void foo(String s, StringBuilder b) {
|
||||
newMethod(b, "repeated", s, "repeated");
|
||||
|
||||
|
||||
newMethod(b, "a", "b", "c");
|
||||
|
||||
b.append("d");
|
||||
}
|
||||
|
||||
private void newMethod(StringBuilder b, String a, String b2, String c) {
|
||||
b.append(a);
|
||||
b.append(b2);
|
||||
b.append(c);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class C {
|
||||
void foo(String s, StringBuilder b) {
|
||||
b.append("repeated");
|
||||
b.append("repeated");
|
||||
b.append(s);
|
||||
b.append("repeated");
|
||||
|
||||
<selection>
|
||||
b.append("a");
|
||||
b.append("b");
|
||||
b.append("b");
|
||||
b.append("c");
|
||||
</selection>
|
||||
b.append("d");
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
class C {
|
||||
void foo(String s, StringBuilder b) {
|
||||
newMethod(b, "repeated", "repeated", s, "repeated");
|
||||
|
||||
|
||||
newMethod(b, "a", "b", "b", "c");
|
||||
|
||||
b.append("d");
|
||||
}
|
||||
|
||||
private void newMethod(StringBuilder b, String a, String b2, String b3, String c) {
|
||||
b.append(a);
|
||||
b.append(b2);
|
||||
b.append(b3);
|
||||
b.append(c);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user