mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: match annotated instanceof expression correctly
This commit is contained in:
+1
-1
@@ -1453,7 +1453,7 @@ public class JavaMatchingVisitor extends JavaElementVisitor {
|
||||
if (myMatchingVisitor.getResult()) {
|
||||
final PsiTypeElement checkType = instanceOf.getCheckType();
|
||||
if (checkType != null) {
|
||||
myMatchingVisitor.setResult(matchType(checkType, instanceOf2.getCheckType()));
|
||||
myMatchingVisitor.setResult(myMatchingVisitor.match(checkType, instanceOf2.getCheckType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -2476,6 +2476,14 @@ public class StructuralSearchTest extends StructuralSearchTestCase {
|
||||
"@Deprecated\n" +
|
||||
"package one.two;";
|
||||
assertEquals("Find annotation on package statement", 1, findMatchesCount(source4, "@'_Annotation", true));
|
||||
|
||||
final String source5 ="class A {" +
|
||||
" boolean a(Object o) {" +
|
||||
" return o instanceof @HH String;" +
|
||||
" }" +
|
||||
"}";
|
||||
assertEquals("Find annotation on instanceof expression", 1, findMatchesCount(source5, "'_a instanceof @HH String"));
|
||||
assertEquals("Match annotation correctly on instanceof expression", 0, findMatchesCount(source5, "'_a instanceof @GG String"));
|
||||
}
|
||||
|
||||
public void testBoxingAndUnboxing() {
|
||||
|
||||
Reference in New Issue
Block a user