void (@NotNull PsiMethod method) { // no call to super, so it doesn't drill down into inner classes if (method.isConstructor()) return; final String methodName = method.getName(); final PsiClass containingClass = method.getContainingClass(); if (containingClass == null) return; final String className = containingClass.getName(); if (!methodName.equals(className)) return; MethodSignature signature = method.getSignature(PsiSubstitutor.EMPTY); boolean canReplaceWithConstructor = method.getBody() != null && !containingClass.isInterface() && !ContainerUtil.exists(containingClass.getConstructors(), ctor -> MethodSignatureUtil.areErasedParametersEqual(signature, ctor.getSignature(PsiSubstitutor.EMPTY))); registerMethodError(method, isOnTheFly(), canReplaceWithConstructor); }