boolean (@NotNull PsiClass aClass) { PsiMethod[] constructors = aClass.getConstructors(); if (constructors.length == 0) return false; for (PsiMethod constructor : constructors) { PsiMethodCallExpression methodCallExpression = JavaPsiConstructorUtil.findThisOrSuperCallInConstructor(constructor); if (methodCallExpression == null) return false; if (JavaPsiConstructorUtil.isChainedConstructorCall(methodCallExpression)) continue; PsiReferenceExpression referenceExpression = methodCallExpression.getMethodExpression(); PsiExpression qualifierExpression = PsiUtil.skipParenthesizedExprDown(referenceExpression.getQualifierExpression()); //If the class instance creation expression is qualified, then the immediately //enclosing instance of i is the object that is the value of the Primary expression or the ExpressionName, //otherwise aClass needs to be a member of a class enclosing the class in which the class instance creation expression appears //already excluded by InheritanceUtil.hasEnclosingInstanceInScope if (qualifierExpression == null) return false; } return true; }