-
Notifications
You must be signed in to change notification settings - Fork 310
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
@BatchMapping does not support kotlin collection whose element type is interface. #454
Comments
At the end of the day, we have to adapt to |
In kotlin language, However, that's only a language-level magic, after compiling, in JVM byte code,
Output: public abstract void com.example.demo.Example.f(java.util.List) |
@babyfish-ct What problem do you face when you use the |
OK, if the data types are classes, it works as you said, there is no issues However, if data types are interfaces, it cannot work Minimized code
|
What's the actual error and stacktrace? |
Error message is show in graphiq, not in java console.
If |
The annotation
@BatchMapping
requires method whose parameter is collection/list, egFor java, it's OK.
Howerver, for kotlin, it's not OK
Because kotlin compiler generates the parameter type as
kotlin.collections.List
/kotlin.collections.Collection
, notjava.util.List
/java.util.Collection
Now, my workaround is: Explicitly use
java.util.List
in kotlin, this will cause warning of Intellij.SpringBoot version:
2.7.0
Example code:
Line 36 and 46 of here
The text was updated successfully, but these errors were encountered: