boolean (@NotNull PsiClass inheritor, @NotNull PsiMethod constructor, final boolean constructorCanBeCalledImplicitly, @NotNull SearchScope searchScope, @NotNull Project project, final boolean isStrictSignatureSearch, @NotNull String superOrThisKeyword, @NotNull String thisOrSuperKeyword, @NotNull Processor<? super PsiReference> processor) { PsiMethod[] constructors = inheritor.getConstructors(); if (constructors.length == 0 && constructorCanBeCalledImplicitly) { if (!processImplicitConstructorCall(inheritor, processor, constructor, project, inheritor)) return false; } for (PsiMethod method : constructors) { PsiCodeBlock body = method.getBody(); if (body == null || method == constructor && isStrictSignatureSearch || method instanceof SyntheticElement) { continue; } PsiStatement[] statements = body.getStatements(); if (statements.length != 0 && statements[0] instanceof PsiExpressionStatement exprStatement && exprStatement.getExpression() instanceof PsiMethodCallExpression call) { PsiReferenceExpression refExpr = call.getMethodExpression(); if (PsiSearchScopeUtil.isInScope(searchScope, refExpr)) { if (refExpr.textMatches(superOrThisKeyword)) { PsiElement referencedElement = refExpr.resolve(); if (referencedElement instanceof PsiMethod constructor1) { boolean match = isStrictSignatureSearch ? myManager.areElementsEquivalent(constructor1, constructor) : myManager.areElementsEquivalent(constructor.getContainingClass(), constructor1.getContainingClass()); if (match && !processor.process(refExpr)) return false; } //as long as we've encountered super/this keyword, no implicit ctr calls are possible here continue; } else if (refExpr.textMatches(thisOrSuperKeyword)) { continue; } } } if (constructorCanBeCalledImplicitly && PsiSearchScopeUtil.isInScope(searchScope, method)) { if (!processImplicitConstructorCall(method, processor, constructor, project, inheritor)) return false; } } return true; }