void (@NotNull PsiMethod method) { //no call to super, so we don't drill into anonymous classes if (!method.isConstructor()) { return; } if (!method.hasModifierProperty(PsiModifier.PUBLIC)) { return; } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null) { return; } if (containingClass.hasModifierProperty(PsiModifier.PUBLIC) || containingClass.hasModifierProperty(PsiModifier.PROTECTED)) { return; } if (SerializationUtils.isExternalizable(containingClass)) { final PsiParameterList parameterList = method.getParameterList(); if (parameterList.isEmpty()) { return; } } registerModifierError(PsiModifier.PUBLIC, method, method); }