You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Version
0.7.0
Component(s)
Java
Minimal reproduce step
class Test {
var id: Long? = null
var map: MutableMap<String, Any?>
constructor(map: Map<String, Any?>) {
val camelCaseMap = mutableMapOf<String, Any?>()
for ((k, v) in map) {
// Change to camel case
val prop = toCamelCase(k)
camelCaseMap[prop] = v
}
this.map = camelCaseMap.withDefault { null }
}
fun toCamelCase(name: String): String {
if (name.isEmpty()) {
return ""
}
var camelCase = name.substring(0, 1).toLowerCase()
if (name.length > 1) {
var wordStart = false;
for (i in 1..(name.length - 1)) {
var currChar = name[i]
if (currChar == '_') {
wordStart = true
} else {
if (wordStart) {
camelCase += currChar.toUpperCase()
} else {
camelCase += currChar.toLowerCase()
}
wordStart = false
}
}
}
return camelCase
}
}
fun main(args: Array) {
println("Hello World!")
// Try adding program arguments via Run/Debug configuration.
// Learn more about running applications: https://www.jetbrains.com/help/idea/running-applications.html.
println("Program arguments: ${args.joinToString()}")
val fury = Fury.builder()..withLanguage(Language.XLANG).build()
fury.register(Test::class.java)
val bytes = fury.serializeJavaObject(Test(mapOf("id" to "123")))
println(fury.deserializeJavaObject(bytes, Test::class.java))
}
What did you expect to see?
Able to serialize Test object and deserialize it to see the values of the properties with Language.XLANG
What did you see instead?
Class class kotlin.collections.MutableMapWithDefaultImpl doesn't have a no-arg constructor
java.lang.RuntimeException: Class class kotlin.collections.MutableMapWithDefaultImpl doesn't have a no-arg constructor\n\tat org.apache.fury.reflect.ReflectionUtils.getCtrHandle(ReflectionUtils.java:126)\n\tat org.apache.fury.serializer.collection.AbstractMapSerializer.newMap(AbstractMapSerializer.java:791)
Anything Else?
No response
Are you willing to submit a PR?
I'm willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Fury XLANG doesn't support kotlin yet, please use Language.JAVA instead. Currently FURY support kotlin by implementing JDK serialization interface, we have not check kotlin class type and optimize for kotlin types yet. The xlang serialization won't follow JDK serialization interface, so we do not support kotlin for xlang serialization yet
Search before asking
Version
0.7.0
Component(s)
Java
Minimal reproduce step
class Test {
var id: Long? = null
var map: MutableMap<String, Any?>
}
fun main(args: Array) {
println("Hello World!")
}
What did you expect to see?
Able to serialize Test object and deserialize it to see the values of the properties with Language.XLANG
What did you see instead?
Class class kotlin.collections.MutableMapWithDefaultImpl doesn't have a no-arg constructor
java.lang.RuntimeException: Class class kotlin.collections.MutableMapWithDefaultImpl doesn't have a no-arg constructor\n\tat org.apache.fury.reflect.ReflectionUtils.getCtrHandle(ReflectionUtils.java:126)\n\tat org.apache.fury.serializer.collection.AbstractMapSerializer.newMap(AbstractMapSerializer.java:791)
Anything Else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: