inspection-integration - exclude an edge between annotation access expression and annotation method

GitOrigin-RevId: bb7258de864e2b32529e679785d74ef145a43e33
This commit is contained in:
Ilyas Selimov
2021-02-10 07:23:40 +00:00
committed by intellij-monorepo-bot
parent ba3470c6f2
commit 937831e0de
3 changed files with 0 additions and 36 deletions
@@ -60,26 +60,6 @@ public class RefJavaUtilImpl extends RefJavaUtil {
return false;
}
@Override
public boolean visitElement(@NotNull UElement node) {
UNamedExpression namedExpr = ObjectUtils.tryCast(node, UNamedExpression.class);
if (namedExpr == null) return false;
UAnnotation ann = ObjectUtils.tryCast(namedExpr.getUastParent(), UAnnotation.class);
if (ann == null) return false;
String annFqn = ann.getQualifiedName();
if (annFqn == null) return false;
PsiMethod annMethod = UastUtils.getAnnotationMethod(namedExpr);
if (annMethod == null) return false;
RefMethod annRefMethod = ObjectUtils.tryCast(refFrom.getRefManager().getReference(annMethod), RefMethod.class);
if (annRefMethod == null) return false;
RefJavaElementImpl annRefClass = ObjectUtils.tryCast(
annRefMethod.getRefManager().getReference(annMethod.getContainingClass()), RefJavaElementImpl.class);
if (annRefClass != null) {
annRefClass.addReference(annRefMethod, annMethod.getOriginalElement(), decl, false, true, null);
}
return false;
}
@Override
public boolean visitTypeReferenceExpression(@NotNull UTypeReferenceExpression node) {
PsiType type = node.getType();
@@ -25,10 +25,5 @@
<line>25</line>
<description>Interface is not implemented.</description>
</problem>
<problem>
<file>SimpleAnnotation.java</file>
<line>2</line>
<description>Method is never used.</description>
</problem>
</problems>
@@ -1,11 +0,0 @@
@interface TestAnn {
String str() default "";
int digit() default 2;
}
@TestAnn(digit = 1)
class Test2 {
@TestAnn(digit = 2)
public static void main(String[] args) {
}
}