boolean (@NotNull PsiAnnotation psiAnnotation, @NotNull PsiField psiField, @NotNull ProblemSink builder) { boolean result; final String methodVisibility = LombokProcessorUtil.getMethodModifier(psiAnnotation); result = null != methodVisibility; final boolean lazy = isLazyGetter(psiAnnotation); if (null == methodVisibility && lazy) { builder.addWarningMessage("inspection.message.lazy.does.not.work.with.access.level.none"); } if (result && lazy) { if (!psiField.hasModifierProperty(PsiModifier.FINAL) || !psiField.hasModifierProperty(PsiModifier.PRIVATE)) { builder.addErrorMessage("inspection.message.lazy.requires.field.to.be.private.final") .withLocalQuickFixes(()->PsiQuickFixFactory.createModifierListFix(psiField, PsiModifier.PRIVATE, true, false), ()->PsiQuickFixFactory.createModifierListFix(psiField, PsiModifier.FINAL, true, false)); result = false; } if (!psiField.hasInitializer()) { builder.addErrorMessage("inspection.message.lazy.requires.field.initialization"); result = false; } } validateOnXAnnotations(psiAnnotation, psiField, builder, "onMethod"); if (result) { result = validateExistingMethods(psiField, builder, true); } if (result) { result = validateAccessorPrefix(psiField, builder); } return result; }