boolean (@NotNull PsiAnnotation psiAnnotation, @NotNull PsiClass psiClass, @NotNull ProblemSink builder) { final String typeName = FieldNameConstantsHandler.getTypeName(psiClass, psiAnnotation); Optional<PsiClass> innerClass = PsiClassUtil.getInnerClassInternByName(psiClass, typeName); if (innerClass.isPresent()) { final boolean asEnum = PsiAnnotationUtil.getBooleanAnnotationValue(psiAnnotation, "asEnum", false); if (innerClass.get().isEnum() != asEnum) { builder.addErrorMessage("inspection.message.field.name.constants.inner.type", asEnum); return false; } } return true; }