Dev: fix decoding simple Java types as Date, Url and AnyCodable
This commit is contained in:
parent
31ac6c999e
commit
b47a4f4fce
|
@ -26,9 +26,7 @@ public class JavaDecoder: Decoder {
|
|||
|
||||
public func decode<T : Decodable>(_ type: T.Type, from javaObject: jobject) throws -> T {
|
||||
do {
|
||||
let rootStorageType = getJavaClassname(from: javaObject)
|
||||
self.storage.append(JNIStorageObject(type: rootStorageType, javaObject: JNI.api.NewLocalRef(JNI.env, javaObject)!))
|
||||
let value = try T(from: self)
|
||||
let value = try unbox(type: type, javaObject: javaObject)
|
||||
assert(self.storage.count == 0, "Missing decoding for \(self.storage.count) objects")
|
||||
return value
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue