-
Notifications
You must be signed in to change notification settings - Fork 175
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
Kotlin 1.4 support #356
Comments
Is there a plan around Kotlin 1.4.0 support? Will it be released as part of 2.12 or will it be held off to v3? I've speculatively upgraded on the 2.12 branch and have created 357 . All the tests pass on that PR, so it looks like there is at maybe some missing coverage around the issue mentioned by @efenderbosch above? |
I did some digging and I think that if (member is AnnotatedMethod) {
// pseudo code
if (member.name is like "getFooBar-junk") {
find fooBar member on the Kotlin class
if the member's Kotlin class has "box-impl" or "unbox-impl" methods, then it is an inline class
if it is an inline class, then return "fooBar"
}
} |
If there is missing coverage, this simple test might be enough. class InlineClassTest {
@Test
fun test() {
val mapper = ObjectMapper().registerModule(KotlinModule())
val original = SomeOtherClass(MyInlineClass("bar"))
val json = mapper.writeValueAsString(original)
val deserialized = mapper.readValue(json, SomeOtherClass::class.java)
assertThat(deserialized, equalTo(original))
}
}
inline class MyInlineClass(val inner: String)
@JsonDeserialize(builder = SomeOtherClass.JacksonBuilder::class)
data class SomeOtherClass(val fooBar: MyInlineClass) {
data class JacksonBuilder private constructor(val fooBar: String) {
fun build() = SomeOtherClass(MyInlineClass(fooBar))
}
} Passes w/ Kotlin 1.3. Currently fails w/ Kotlin 1.4 with a |
Since Jackson 3.x is still ways out (no good idea of when focus should move back), I think that support for 2.12 would make sense (or 2.13, there will be minor 2.x versions past 2.12). |
Having hit this issue today myself I found that as workaround @JvmField annotations effectively disable the mangling. |
any progress here? |
I created a |
@efenderbosch I added a (failing) test for that issue to the branch. |
Well, it should be failing. Looks like I have more messing around to do with CircleCI |
Ok, failing now; I wasn't following Maven Surefire's redundancy rules |
I think we should move ahead with updating the module to Kotlin 1.4.10 in spite of this bug. There is a test for this issue on the |
I've added simple demangling code via the above commit. Not sure, if this is enough (but all tests are green). |
One quick note: I released 2.12.0-rc1 yesterday. Will probably take at least over end of October to find out regressions, so final 2.12.0 will not go out before November 2020. But if this change is to be done for 2.12, would be good to coordinate. |
@elektro-wolle I used your commit in this PR #383 |
The 2.12 branch is now on Kotlin 1.4.10. Any new problems can be filed as new issues. |
Maybe this can be just a meta-issue to collect issues w/ Kotlin 1.4.
First thing I noticed is that inline classes no longer serialize properly.
w/ Kotlin 1.3:
w/ Kotlin 1.4:
The text was updated successfully, but these errors were encountered: