Collection<LombokProblem> (@NotNull PsiAnnotation psiAnnotation) { // TODO warning: "You're assigning an auto-cleanup variable to something else. This is a bad idea." final ProblemValidationSink problemNewBuilder = new ProblemValidationSink(); PsiLocalVariable psiVariable = PsiTreeUtil.getParentOfType(psiAnnotation, PsiLocalVariable.class); if (null != psiVariable) { final String cleanupName = PsiAnnotationUtil.getStringAnnotationValue(psiAnnotation, "value", "close"); if (StringUtil.isEmptyOrSpaces(cleanupName)) { problemNewBuilder.addErrorMessage("inspection.message.cleanup.value.cannot.be.empty.string"); } else { validateCleanUpMethodExists(psiVariable, cleanupName, problemNewBuilder); } validateInitializerExist(problemNewBuilder, psiVariable); } else { problemNewBuilder.addErrorMessage("inspection.message.cleanup.legal.only.on.local.variable.declarations"); } return problemNewBuilder.getProblems(); }