Conversation
|
Check my comment in #159 (comment). Is the test code working even properly with the MapStruct processor. We don't really support |
|
@filiphr Could you please have another look? I think it is now valid to support super types like this in the IDE plugin. |
filiphr
left a comment
There was a problem hiding this comment.
Looks good @thunderhook, I've added some small comments
| return Arrays.stream( returnType.getSuperTypes() ) | ||
| .anyMatch( superType -> isAssignableFrom( psiType, superType ) ); |
There was a problem hiding this comment.
There is no need to create a stream and then use anyMatch. Let's just iterate through the returnType.getSuperTypes() and do a check in the for loop.
|
|
||
| private static boolean isAssignableFromReturnTypeOrSuperTypes(PsiType psiType, @Nullable PsiType returnType) { | ||
|
|
||
| if ( returnType == null ) { |
There was a problem hiding this comment.
The returnType cannot be null because in isFluentSetter we are checking method.getReturnType() != null.
|
@filiphr Thanks for the feedback. I have made the requested changes. |
I hope this change has no unwanted side effects. It checks whether a fluent setters return type also can be assigned to one of its super types to support classes like this:
Fixes #159