mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable inline to anonymous for type params (IDEA-140846)
This commit is contained in:
@@ -203,6 +203,9 @@ public class InlineToAnonymousClassHandler extends JavaInlineActionHandler {
|
||||
|
||||
@Nullable
|
||||
public static String getCannotInlineMessage(final PsiClass psiClass) {
|
||||
if (psiClass instanceof PsiTypeParameter) {
|
||||
return "Type parameters cannot be inlined";
|
||||
}
|
||||
if (psiClass.isAnnotationType()) {
|
||||
return "Annotation types cannot be inlined";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class B<K>{}
|
||||
class A<<caret>T> extends B<T> {
|
||||
A<String> a;
|
||||
}
|
||||
+4
@@ -332,6 +332,10 @@ public class InlineToAnonymousClassTest extends LightRefactoringTestCase {
|
||||
doTestNoInline("Library classes cannot be inlined");
|
||||
}
|
||||
|
||||
public void testNoInlineTypeParameter() throws Exception {
|
||||
doTestNoInline("Type parameters cannot be inlined");
|
||||
}
|
||||
|
||||
public void testNoInlineNoUsages() throws Exception {
|
||||
doTestPreprocessUsages("Class is never used");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user