mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: search for class should not find type parameters
This commit is contained in:
+1
@@ -470,6 +470,7 @@ public class JavaMatchingVisitor extends JavaElementVisitor {
|
||||
if (templateIsInterface != clazz2.isInterface()) return false;
|
||||
if (templateIsInterface && clazz.isAnnotationType() && !clazz2.isAnnotationType()) return false;
|
||||
if (clazz.isEnum() && !clazz2.isEnum()) return false;
|
||||
if (clazz instanceof PsiTypeParameter != clazz2 instanceof PsiTypeParameter) return false;
|
||||
|
||||
if (!matchInAnyOrder(clazz.getExtendsList(), clazz2.getExtendsList())) {
|
||||
return false;
|
||||
|
||||
+4
@@ -714,6 +714,10 @@ public class StructuralSearchTest extends StructuralSearchTestCase {
|
||||
"class B { { a = 10; } }\n" +
|
||||
"class C { { a = 10; } }";
|
||||
assertEquals("static block search", 1, findMatchesCount(s141, "class '_ { static { a = 10; } } "));
|
||||
|
||||
final String in = "class D<T> {}\n" +
|
||||
"class T {}";
|
||||
assertEquals("search for class should not find type parameters", 1, findMatchesCount(in, "class T {}"));
|
||||
}
|
||||
|
||||
public void testParameterlessConstructorSearch() {
|
||||
|
||||
Reference in New Issue
Block a user