-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix Kotlin DSL according to IDEA errors and suggestions #10307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It is not clear why it does not fail with Gradle, but right now it is not possible to build the project using IDEA compiler. Some of the suggestions are good and have led to the Nullability fixes in related Java DSL classes. The `Any` extension requirement for the generic argument of reified types is not clear, but works. The requirement to refine nullable Kotlin types is good. Somewhat related to: spring-projects#10083
cppwfs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I was a bit rusty on my Kotlin...
Just one simple question.
| * @return the spec. | ||
| */ | ||
| public <P> TransformerEndpointSpec expectedType(@Nullable Class<P> expectedType) { | ||
| public <P> TransformerEndpointSpec expectedType(Class<P> expectedType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
Is this a breaking change if we state that expectedType can not be reset to null. If so should we have a note about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset?
This is part of Java DSL.
So, or you call this method in builder chain or not.
But if you do, it has to come with the value.
Why would one do:
.expectedType(String.class)
.expectedType(null)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it doesn't make sense. But someone can do it.
Its not a show stopper in any shape. I just like to be annoying. 😆
cppwfs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for investigating and fixing this.
It is not clear why it does not fail with Gradle, but right now it is not possible to build the project using IDEA compiler.
Some of the suggestions are good and have led to the Nullability fixes in related Java DSL classes. The
Anyextension requirement for the generic argument of reified types is not clear, but works. The requirement to refine nullable Kotlin types is good.Somewhat related to: #10083