mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use interface where possible: ignore right hand of assignment type argument (IDEADEV-39117)
This commit is contained in:
+6
@@ -273,6 +273,12 @@ public abstract class TurnRefsToSuperProcessorBase extends BaseRefactoringProces
|
||||
} else if (classReference.getParent() instanceof PsiTypeElement) {
|
||||
processUsage(classReference);
|
||||
return;
|
||||
} else if (classReference.getParent() instanceof PsiNewExpression) {
|
||||
final PsiVariable variable = PsiTreeUtil.getParentOfType(classReference, PsiVariable.class);
|
||||
if (variable != null) {
|
||||
processUsage(variable);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
markNode(ref); //???
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
interface I{}
|
||||
@@ -0,0 +1 @@
|
||||
class IImpl implements I{}
|
||||
@@ -0,0 +1,6 @@
|
||||
import java.util.*;
|
||||
class U {
|
||||
public static void main(String[] args) {
|
||||
List<List<I>> l = new ArrayLits<List<I>>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
interface I{}
|
||||
@@ -0,0 +1 @@
|
||||
class IImpl implements I{}
|
||||
@@ -0,0 +1,6 @@
|
||||
import java.util.*;
|
||||
class U {
|
||||
public static void main(String[] args) {
|
||||
List<List<IImpl>> l = new ArrayLits<List<IImpl>>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
interface I{}
|
||||
@@ -0,0 +1 @@
|
||||
class IImpl implements I{}
|
||||
@@ -0,0 +1,6 @@
|
||||
import java.util.*;
|
||||
class U {
|
||||
public static void main(String[] args) {
|
||||
List<I> l = new ArrayLits<I>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
interface I{}
|
||||
+1
@@ -0,0 +1 @@
|
||||
class IImpl implements I{}
|
||||
@@ -0,0 +1,6 @@
|
||||
import java.util.*;
|
||||
class U {
|
||||
public static void main(String[] args) {
|
||||
List<IImpl> l = new ArrayLits<IImpl>();
|
||||
}
|
||||
}
|
||||
@@ -117,6 +117,14 @@ public class TurnRefsToSuperTest extends MultiFileTestCase {
|
||||
doTest("B", "A", false);
|
||||
}
|
||||
|
||||
public void testTypeArgumentsRH() throws Exception {
|
||||
doTest("IImpl", "I", false);
|
||||
}
|
||||
|
||||
public void testTypeArgumentsRH1() throws Exception {
|
||||
doTest("IImpl", "I", false);
|
||||
}
|
||||
|
||||
private void doTest(@NonNls final String className, @NonNls final String superClassName, final boolean replaceInstanceOf) throws Exception {
|
||||
doTest(new PerformAction() {
|
||||
public void performAction(VirtualFile rootDir, VirtualFile rootAfter) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user