public Collection<LombokProblem> verifyAnnotation(@NotNull PsiAnnotation psiAnnotation) {
Collection<LombokProblem> result = new ArrayList<LombokProblem>(2);
final ProblemNewBuilder problemNewBuilder = new ProblemNewBuilder(result);
PsiMethod psiMethod = PsiTreeUtil.getParentOfType(psiAnnotation, PsiMethod.class);
if (null != psiMethod) {
if (psiMethod.hasModifierProperty(PsiModifier.ABSTRACT)) {
problemNewBuilder.addError("'@Synchronized' is legal only on concrete methods.",
QuickFixFactory.getInstance().createModifierListFix(psiMethod, PsiModifier.ABSTRACT, false, false)
);
}
final String lockFieldName = PsiAnnotationUtil.getAnnotationValue(psiAnnotation, "value", String.class);
if (StringUtil.isNotEmpty(lockFieldName)) {
final PsiClass containingClass = psiMethod.getContainingClass();
if (null != containingClass) {
final PsiField lockField = containingClass.findFieldByName(lockFieldName, true);
if (null != lockField) {
if (!lockField.hasModifierProperty(PsiModifier.FINAL)) {