Skip to content

Commit

Permalink
#159 review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderhook committed Mar 17, 2024
1 parent d19770f commit 811de7a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/org/mapstruct/intellij/util/MapstructUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,18 @@ public static boolean isFluentSetter(@NotNull PsiMethod method, PsiType psiType)
isAssignableFromReturnTypeOrSuperTypes( psiType, method.getReturnType() );
}

private static boolean isAssignableFromReturnTypeOrSuperTypes(PsiType psiType, @Nullable PsiType returnType) {

if ( returnType == null ) {
return false;
}
private static boolean isAssignableFromReturnTypeOrSuperTypes(PsiType psiType, PsiType returnType) {

if ( isAssignableFrom( psiType, returnType ) ) {
return true;
}

return Arrays.stream( returnType.getSuperTypes() )
.anyMatch( superType -> isAssignableFrom( psiType, superType ) );
for ( PsiType superType : returnType.getSuperTypes() ) {
if ( isAssignableFrom( psiType, superType ) ) {
return true;
}
}
return false;
}

private static boolean isAssignableFrom(PsiType psiType, @Nullable PsiType returnType) {
Expand Down

0 comments on commit 811de7a

Please sign in to comment.