AnnotationBuilder (AnnotationBuilder builder, GrMethod method, boolean makeClassAbstract, @InspectionMessage String message, TextRange range) { if (method.getBlock() == null) { builder = builder.withFix(QuickFixFactory.getInstance().createAddMethodBodyFix(method)); } else { builder = builder.withFix(QuickFixFactory.getInstance().createDeleteMethodBodyFix(method)); } GrModifierFix fix = new GrModifierFix(method, PsiModifier.ABSTRACT, false, false, GrModifierFix.MODIFIER_LIST_OWNER); builder = registerLocalFix(builder, fix, method, message, ProblemHighlightType.ERROR, range); if (makeClassAbstract) { final PsiClass containingClass = method.getContainingClass(); if (containingClass != null) { final PsiModifierList list = containingClass.getModifierList(); if (list != null && !list.hasModifierProperty(PsiModifier.ABSTRACT)) { builder = registerLocalFix(builder, new GrModifierFix(containingClass, PsiModifier.ABSTRACT, false, true, GrModifierFix.MODIFIER_LIST_OWNER), containingClass, message, ProblemHighlightType.ERROR, range); } } } return builder; }