mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 21:43:33 +07:00
do not replace diamonds without necessity (IDEA-87172)
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
public class TestCompletion {
|
||||
|
||||
public static <T, V> ParallelPipeline<T, V> test(T base, V newStage, T upstream, final ParallelPipeline<T, V> anObject) {
|
||||
if (base != null){
|
||||
return anObject;
|
||||
}
|
||||
else {
|
||||
return new ParallelPipeline<>(upstream, newStage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void f() {
|
||||
test(null, null, null, new ParallelPipeline<>(null, null));
|
||||
}
|
||||
private static class ParallelPipeline<T, V> {
|
||||
public ParallelPipeline(T p0, V p1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
public class TestCompletion {
|
||||
|
||||
public static <T, V> ParallelPipeline<T, V> test(T base, V newStage, T upstream) {
|
||||
if (base != null){
|
||||
return <selection>new ParallelPipeline<>(base, newStage)</selection>;
|
||||
}
|
||||
else {
|
||||
return new ParallelPipeline<>(upstream, newStage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void f() {
|
||||
test(null, null, null);
|
||||
}
|
||||
private static class ParallelPipeline<T, V> {
|
||||
public ParallelPipeline(T p0, V p1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -275,6 +275,10 @@ public class IntroduceParameterTest extends LightRefactoringTestCase {
|
||||
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL, true, false, true, false);
|
||||
}
|
||||
|
||||
public void testPreserveDiamondOccurrences() throws Exception {
|
||||
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL, true, false, true, false);
|
||||
}
|
||||
|
||||
public void testSubstituteTypeParams() throws Exception {
|
||||
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL, true, false, true, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user