File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/main/java/org/mapstruct/intellij/inspection Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 55 */
66package org .mapstruct .intellij .inspection ;
77
8- import java .util .Optional ;
9-
108import com .intellij .codeInspection .ProblemHighlightType ;
119import com .intellij .codeInspection .ProblemsHolder ;
1210import com .intellij .openapi .util .TextRange ;
@@ -73,9 +71,14 @@ private boolean shouldRegisterProblem(BaseReference reference) {
7371 }
7472
7573 private boolean containingClassIsAnnotationType (PsiElement element ) {
76- return Optional .ofNullable ( PsiTreeUtil .getParentOfType ( element , PsiClass .class ) )
77- .map ( PsiClass ::isAnnotationType )
78- .orElse ( false );
74+
75+ PsiClass containingClass = PsiTreeUtil .getParentOfType ( element , PsiClass .class );
76+
77+ if ( containingClass == null ) {
78+ return false ;
79+ }
80+
81+ return containingClass .isAnnotationType ();
7982 }
8083 }
8184}
You can’t perform that action at this time.
0 commit comments