mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
Fix unused declaration record false positives in batch inspection (IDEA-293902)
GitOrigin-RevId: 9f6e745abc93560315c708cf3e6806f86533ac1e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a7e54c330d
commit
ae88c6cbb4
@@ -167,7 +167,11 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
visitClass(((UObjectLiteralExpression)node).getDeclaration());
|
||||
}
|
||||
if (node.getKind() == UastCallKind.CONSTRUCTOR_CALL) {
|
||||
PsiMethod resolvedMethod = node.resolve();
|
||||
PsiElement resolvedMethod = node.resolve();
|
||||
if (resolvedMethod instanceof LightElement) {
|
||||
UElement uElement = UastContextKt.toUElement(resolvedMethod);
|
||||
resolvedMethod = uElement == null ? null : uElement.getSourcePsi();
|
||||
}
|
||||
final List<UExpression> argumentList = node.getValueArguments();
|
||||
RefMethod refConstructor = processNewLikeConstruct(resolvedMethod, argumentList);
|
||||
|
||||
@@ -295,9 +299,10 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private RefMethod processNewLikeConstruct(final PsiMethod javaConstructor, final List<UExpression> argumentList) {
|
||||
private RefMethod processNewLikeConstruct(PsiElement javaConstructor, List<UExpression> argumentList) {
|
||||
if (javaConstructor == null) return null;
|
||||
RefMethodImpl refConstructor = (RefMethodImpl)refManager.getReference(javaConstructor.getOriginalElement());
|
||||
RefMethodImpl refConstructor =
|
||||
ObjectUtils.tryCast(refManager.getReference(javaConstructor.getOriginalElement()), RefMethodImpl.class);
|
||||
refFrom.addReference(refConstructor, javaConstructor, decl, false, true, null);
|
||||
|
||||
for (UExpression arg : argumentList) {
|
||||
|
||||
Reference in New Issue
Block a user