-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Jackson fails to deserialize Kotlin classes that contain spaces in the name #2228
Comments
Quick question: where is the name with space in it? Is it something Kotlin compiler generates as a helper or something else? I am bit worried wrt reproduction as there does not seem to be anything actually using class name for anything... so I don't know what could be done to resolve it. If there is something, it probably would need to be by Kotlin module too. |
hi @cowtowncoder, as a minimal test case the class to deserialize that generates the exception is defined within the scope of the test method, so its name contains the test method name itself:
I guess Java class names are not expected to contain spaces, so you are probably right and is a Kotlin issue, but I found a similar bug so I was hoping it could be a Jackson databind issue. |
Right, I was at first thinking it might be related to that piece of code. Unfortunately as you can see from the stack trace, exception comes from deep within bowels of JDK (I think). So I am not sure what sure what Jackson could do. But the reference to Kotlin module has more to do with sort of division of labor: similar to Scala module, Kotlin module handles some of differences (like added introspection capabilities and requirements), especially things core databind does not have access to (in the sense it not having any Kotlin or Scala-specific code). Looking at stack trace again, I think triggering of the exception might even work simply by trying to construct |
Thanks for your answer, yes definitely I would say is a JDK or Kotlin issue. Or even more JDK cause Kotlin is allowed to define a class with spaces in its name, so the Java Class should be aware of that. |
Similar issues have been reported but not for this specific test case.
The problem arises when deserializing a Kotlin class name with spaces.
I have created a repo with the required code to reproduce the issue.
The text was updated successfully, but these errors were encountered: