boolean (@NotNull PsiClass psiClass, @Nullable String staticConstructorName, @NotNull Collection<PsiField> params, @NotNull ProblemSink builder) { boolean result = true; final List<PsiType> paramTypes = new ArrayList<>(params.size()); for (PsiField param : params) { paramTypes.add(param.getType()); } if (isStaticConstructor(staticConstructorName)) { final Collection<PsiMethod> definedMethods = PsiClassUtil.collectClassStaticMethodsIntern(psiClass); final PsiMethod existedStaticMethod = findExistedMethod(definedMethods, staticConstructorName, paramTypes); if (null != existedStaticMethod) { if (paramTypes.isEmpty()) { builder.addErrorMessage("inspection.message.method.s.matched.static.constructor.name.already.defined", staticConstructorName) .withLocalQuickFixes(() -> new SafeDeleteFix(existedStaticMethod)); } else { builder.addErrorMessage("inspection.message.method.s.with.d.parameters.matched.static.constructor.name.already.defined", staticConstructorName, paramTypes.size()) .withLocalQuickFixes(() -> new SafeDeleteFix(existedStaticMethod)); } result = false; } } return result; }