mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +00:00
CORDA-3738: Upgrade to DJVM 1.1-RC01. (#6182)
* Update for changes to API for DJVM 1.1-RC01. * Tidy up generics for DJVM serialization.
This commit is contained in:
parent
9a2ae8ae19
commit
1c3ec2eb18
@ -30,7 +30,7 @@ snakeYamlVersion=1.19
|
||||
caffeineVersion=2.7.0
|
||||
metricsVersion=4.1.0
|
||||
metricsNewRelicVersion=1.1.1
|
||||
djvmVersion=1.0
|
||||
djvmVersion=1.1-RC01
|
||||
deterministicRtVersion=1.0-RC02
|
||||
openSourceBranch=https://github.com/corda/corda/blob/release/os/4.4
|
||||
openSourceSamplesBranch=https://github.com/corda/samples/blob/release-V4
|
||||
|
@ -30,11 +30,11 @@ class SandboxEnumSerializer(
|
||||
private val localFactory: LocalSerializerFactory
|
||||
) : CustomSerializer.Implements<Any>(clazz = classLoader.toSandboxAnyClass(Enum::class.java)) {
|
||||
@Suppress("unchecked_cast")
|
||||
private val describeEnum: Function<Class<*>, Array<Any>>
|
||||
= taskFactory.apply(DescribeEnum::class.java) as Function<Class<*>, Array<Any>>
|
||||
private val describeEnum: Function<Class<*>, Array<out Any>>
|
||||
= taskFactory.apply(DescribeEnum::class.java) as Function<Class<*>, Array<out Any>>
|
||||
@Suppress("unchecked_cast")
|
||||
private val getEnumNames: Function<Array<Any>, List<String>>
|
||||
= (taskFactory.apply(GetEnumNames::class.java) as Function<Array<Any>, Array<Any>>)
|
||||
private val getEnumNames: Function<Array<out Any>, List<String>>
|
||||
= (taskFactory.apply(GetEnumNames::class.java) as Function<Array<out Any>, Array<out Any>>)
|
||||
.andThen { it.map(Any::toString) }
|
||||
@Suppress("unchecked_cast")
|
||||
private val isEnum: Predicate<Class<*>>
|
||||
@ -70,7 +70,7 @@ class SandboxEnumSerializer(
|
||||
|
||||
private class ConcreteEnumSerializer(
|
||||
declaredType: Class<*>,
|
||||
private val members: Array<Any>,
|
||||
private val members: Array<out Any>,
|
||||
private val memberNames: List<String>,
|
||||
factory: LocalSerializerFactory
|
||||
) : AMQPSerializer<Any> {
|
||||
|
@ -24,7 +24,7 @@ class SandboxSymbolSerializer(
|
||||
init {
|
||||
val transformTask = taskFactory.apply(SymbolDeserializer::class.java)
|
||||
@Suppress("unchecked_cast")
|
||||
transformer = basicInput.andThen(transformTask) as Function<String, Any?>
|
||||
transformer = basicInput.andThen(transformTask) as Function<String, out Any?>
|
||||
}
|
||||
|
||||
override val schemaForDocumentation: Schema = Schema(emptyList())
|
||||
|
@ -33,7 +33,7 @@ class SandboxZonedDateTimeSerializer(
|
||||
)
|
||||
creator = task.andThen { input ->
|
||||
@Suppress("unchecked_cast", "SpreadOperator")
|
||||
createTask(null, *(input as Array<Any?>))!!
|
||||
createTask(null, *(input as Array<out Any?>))!!
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,37 +79,23 @@ abstract class TestBase(type: SandboxType) {
|
||||
}
|
||||
|
||||
fun sandbox(action: Consumer<SandboxRuntimeContext>) {
|
||||
sandbox(WARNING, emptySet(), emptySet(), action)
|
||||
sandbox(WARNING, emptySet(), action)
|
||||
}
|
||||
|
||||
inline fun sandbox(visibleAnnotations: Set<Class<out Annotation>>, crossinline action: SandboxRuntimeContext.() -> Unit) {
|
||||
sandbox(visibleAnnotations, Consumer { ctx -> action(ctx) })
|
||||
}
|
||||
|
||||
fun sandbox(visibleAnnotations: Set<Class<out Annotation>>, action: Consumer<SandboxRuntimeContext>) {
|
||||
sandbox(WARNING, visibleAnnotations, emptySet(), action)
|
||||
}
|
||||
|
||||
inline fun sandbox(
|
||||
visibleAnnotations: Set<Class<out Annotation>>,
|
||||
sandboxOnlyAnnotations: Set<String>,
|
||||
crossinline action: SandboxRuntimeContext.() -> Unit
|
||||
) {
|
||||
sandbox(visibleAnnotations, sandboxOnlyAnnotations, Consumer { ctx -> action(ctx) })
|
||||
}
|
||||
|
||||
fun sandbox(
|
||||
visibleAnnotations: Set<Class<out Annotation>>,
|
||||
sandboxOnlyAnnotations: Set<String>,
|
||||
action: Consumer<SandboxRuntimeContext>
|
||||
) {
|
||||
sandbox(WARNING, visibleAnnotations, sandboxOnlyAnnotations, action)
|
||||
sandbox(WARNING, visibleAnnotations, action)
|
||||
}
|
||||
|
||||
fun sandbox(
|
||||
minimumSeverityLevel: Severity,
|
||||
visibleAnnotations: Set<Class<out Annotation>>,
|
||||
sandboxOnlyAnnotations: Set<String>,
|
||||
action: Consumer<SandboxRuntimeContext>
|
||||
) {
|
||||
var thrownException: Throwable? = null
|
||||
@ -117,7 +103,6 @@ abstract class TestBase(type: SandboxType) {
|
||||
UserPathSource(classPaths).use { userSource ->
|
||||
SandboxRuntimeContext(parentConfiguration.createChild(userSource, Consumer {
|
||||
it.setMinimumSeverityLevel(minimumSeverityLevel)
|
||||
it.setSandboxOnlyAnnotations(sandboxOnlyAnnotations)
|
||||
it.setVisibleAnnotations(visibleAnnotations)
|
||||
})).use(action)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user