mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-27 17:01:31 +07:00
global inspections: waitForInitialized() -> initializeIfNeeded()
GitOrigin-RevId: ff6f801191e0028b285b87099a6fe73bc2343238
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4c005dfe48
commit
7537121a6e
@@ -58,7 +58,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
PsiClass javaClass = node.resolve();
|
||||
if (javaClass != null) {
|
||||
final RefElement refClass = refManager.getReference(javaClass.getOriginalElement());
|
||||
if (refClass != null) refClass.waitForInitialized();
|
||||
if (refClass != null) refClass.initializeIfNeeded();
|
||||
refFrom.addReference(refClass, javaClass.getOriginalElement(), decl, false, true, null);
|
||||
}
|
||||
return false;
|
||||
@@ -83,7 +83,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
UClass target = UastContextKt.toUElement(classType.resolve(), UClass.class);
|
||||
if (target != null) {
|
||||
final RefElement refElement = refManager.getReference(target.getSourcePsi());
|
||||
if (refElement != null) refElement.waitForInitialized();
|
||||
if (refElement != null) refElement.initializeIfNeeded();
|
||||
refFrom.addReference(refElement, target.getSourcePsi(), decl, false, true, null);
|
||||
}
|
||||
return null;
|
||||
@@ -112,7 +112,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
PsiElement resolve = reference.resolve();
|
||||
if (resolve instanceof PsiMember) {
|
||||
final RefElement refResolved = refManager.getReference(resolve);
|
||||
if (refResolved != null) refResolved.waitForInitialized();
|
||||
if (refResolved != null) refResolved.initializeIfNeeded();
|
||||
refFrom.addReference(refResolved, resolve, decl, false, true, null);
|
||||
if (refResolved instanceof RefMethodImpl) {
|
||||
updateRefMethod(resolve, (RefMethodImpl)refResolved, node, decl);
|
||||
@@ -218,7 +218,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
if (psiResolved instanceof LightRecordCanonicalConstructor) {
|
||||
refResolved = refManager.getReference(psiResolved.getNavigationElement());
|
||||
if (refResolved instanceof RefClass) {
|
||||
refResolved.waitForInitialized();
|
||||
refResolved.initializeIfNeeded();
|
||||
List<RefMethod> constructors = ((RefClass)refResolved).getConstructors();
|
||||
if (!constructors.isEmpty()) {
|
||||
refResolved = constructors.get(0);
|
||||
@@ -236,8 +236,8 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
}
|
||||
boolean writing = isAccessedForWriting(node);
|
||||
boolean reading = isAccessedForReading(node);
|
||||
if (refResolved != null) refResolved.waitForInitialized();
|
||||
refFrom.waitForInitialized();
|
||||
if (refResolved != null) refResolved.initializeIfNeeded();
|
||||
refFrom.initializeIfNeeded();
|
||||
refFrom.addReference(refResolved, psiResolved, decl, writing, reading, node);
|
||||
|
||||
if (refResolved instanceof RefMethodImpl) {
|
||||
@@ -289,12 +289,12 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
}
|
||||
if (aClass != null) {
|
||||
final RefElement refWhat = refManager.getReference(aClass);
|
||||
if (refWhat != null) refWhat.waitForInitialized();
|
||||
if (refWhat != null) refWhat.initializeIfNeeded();
|
||||
refFrom.addReference(refWhat, aClass, decl, false, true, null);
|
||||
}
|
||||
PsiElement functionalExpr = expression.getSourcePsi();
|
||||
RefElement refFunctionalExpr = refManager.getReference(functionalExpr);
|
||||
if (refFunctionalExpr != null) refFunctionalExpr.waitForInitialized();
|
||||
if (refFunctionalExpr != null) refFunctionalExpr.initializeIfNeeded();
|
||||
refFrom.addReference(refFunctionalExpr, functionalExpr, decl, false, true, expression);
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
}
|
||||
|
||||
if (refConstructor != null) {
|
||||
refConstructor.waitForInitialized();
|
||||
refConstructor.initializeIfNeeded();
|
||||
refConstructor.updateParameterValues(argumentList, javaConstructor);
|
||||
}
|
||||
return refConstructor;
|
||||
@@ -323,7 +323,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
}
|
||||
PsiElement sourcePsi = uClass.getSourcePsi();
|
||||
RefElement refWhat = refManager.getReference(sourcePsi);
|
||||
if (refWhat != null) refWhat.waitForInitialized();
|
||||
if (refWhat != null) refWhat.initializeIfNeeded();
|
||||
refFrom.addReference(refWhat, sourcePsi, decl, false, true, null);
|
||||
return true;
|
||||
}
|
||||
@@ -342,7 +342,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
}
|
||||
}
|
||||
if (refMethod != null) {
|
||||
refMethod.waitForInitialized();
|
||||
refMethod.initializeIfNeeded();
|
||||
refMethod.updateReturnValueTemplate(node.getReturnExpression());
|
||||
}
|
||||
return false;
|
||||
@@ -361,7 +361,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
|
||||
if (refClass != null) {
|
||||
boolean hasConstructorsMarked = false;
|
||||
refClass.waitForInitialized();
|
||||
refClass.initializeIfNeeded();
|
||||
|
||||
if (defaultConstructorOnly) {
|
||||
WritableRefElement refDefaultConstructor = (WritableRefElement)refClass.getDefaultConstructor();
|
||||
@@ -411,7 +411,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
if (containingClass != null) {
|
||||
RefElement refContainingClass = refFrom.getRefManager().getReference(containingClass);
|
||||
if (refContainingClass != null) {
|
||||
refContainingClass.waitForInitialized();
|
||||
refContainingClass.initializeIfNeeded();
|
||||
refFrom.addReference(refContainingClass, containingClass, decl, false, true, node);
|
||||
}
|
||||
}
|
||||
@@ -441,7 +441,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
|
||||
@NotNull UExpression refExpression,
|
||||
final UElement uFrom) {
|
||||
UMethod uMethod = Objects.requireNonNull(UastContextKt.toUElement(psiResolved, UMethod.class));
|
||||
refMethod.waitForInitialized();
|
||||
refMethod.initializeIfNeeded();
|
||||
if (refExpression instanceof UCallableReferenceExpression) {
|
||||
PsiType returnType = uMethod.getReturnType();
|
||||
if (!uMethod.isConstructor()) {
|
||||
|
||||
Reference in New Issue
Block a user