Upgrade corda/crash, snakeyaml

This commit is contained in:
Chris Cochrane 2023-04-20 14:01:20 +01:00
commit c58c49d27a
No known key found for this signature in database
GPG Key ID: 4D4602B5BBC63950
11 changed files with 34 additions and 15 deletions

View File

@ -61,8 +61,9 @@ buildscript {
ext.asm_version = '7.1'
ext.artemis_version = '2.6.2'
// TODO Upgrade Jackson only when corda is using kotlin 1.3.10
ext.jackson_version = '2.9.7'
// TODO Upgrade to Jackson 2.10+ only when corda is using kotlin 1.3.10
ext.jackson_version = '2.13.5'
ext.jackson_kotlin_version = '2.9.7'
ext.jetty_version = '9.4.19.v20190610'
ext.jersey_version = '2.25'
ext.servlet_version = '4.0.1'
@ -105,9 +106,9 @@ buildscript {
ext.dependency_checker_version = '5.2.0'
ext.commons_collections_version = '4.3'
ext.beanutils_version = '1.9.4'
ext.crash_version = '1.7.4'
ext.crash_version = '1.7.6'
ext.jsr305_version = constants.getProperty("jsr305Version")
ext.shiro_version = '1.4.1'
ext.shiro_version = '1.10.0'
ext.artifactory_plugin_version = constants.getProperty('artifactoryPluginVersion')
ext.hikari_version = '3.3.1'
ext.liquibase_version = '3.6.3'
@ -445,6 +446,10 @@ allprojects {
details.useVersion netty_version
}
}
if (details.requested.group == 'org.yaml' && details.requested.name == 'snakeyaml') {
details.useVersion snake_yaml_version
}
}
}
}

View File

@ -9,7 +9,9 @@ dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// Jackson and its plugins: parsing to/from JSON and other textual formats.
compile "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_kotlin_version") {
exclude module: "jackson-databind"
}
// Yaml is useful for parsing strings to method calls.
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jackson_version"
// This adds support for java.time types.

View File

@ -6,6 +6,7 @@ import com.fasterxml.jackson.core.*
import com.fasterxml.jackson.databind.*
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import com.fasterxml.jackson.databind.cfg.ConstructorDetector
import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier
import com.fasterxml.jackson.databind.deser.std.NumberDeserializers
import com.fasterxml.jackson.databind.node.ObjectNode
@ -179,6 +180,8 @@ object JacksonSupport {
addMixIn(X500Principal::class.java, X500PrincipalMixin::class.java)
addMixIn(X509Certificate::class.java, X509CertificateMixin::class.java)
addMixIn(CertPath::class.java, CertPathMixin::class.java)
setConstructorDetector(ConstructorDetector.DEFAULT.withAllowJDKTypeConstructors(true))
}
}

View File

@ -19,6 +19,7 @@ import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier
import com.fasterxml.jackson.databind.deser.ContextualDeserializer
import com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer
import com.fasterxml.jackson.databind.deser.std.FromStringDeserializer
import com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy
import com.fasterxml.jackson.databind.introspect.AnnotatedClass
import com.fasterxml.jackson.databind.introspect.BasicClassIntrospector
import com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector
@ -114,6 +115,14 @@ private class CordaSerializableClassIntrospector(private val context: Module.Set
}
return super.constructPropertyCollector(config, ac, type, forSerialization, mutatorPrefix)
}
override fun constructPropertyCollector(config: MapperConfig<*>?, classDef: AnnotatedClass?, type: JavaType, forSerialization: Boolean, accNaming: AccessorNamingStrategy?): POJOPropertiesCollector {
if (hasCordaSerializable(type.rawClass)) {
// Adjust the field visibility of CordaSerializable classes on the fly as they are encountered.
context.configOverride(type.rawClass).visibility = Value.defaultVisibility().withFieldVisibility(Visibility.ANY)
}
return super.constructPropertyCollector(config, classDef, type, forSerialization, accNaming)
}
}
private class CordaSerializableBeanSerializerModifier : BeanSerializerModifier() {

View File

@ -25,7 +25,7 @@ disruptorVersion=3.4.2
typesafeConfigVersion=1.3.4
jsr305Version=3.0.2
artifactoryPluginVersion=4.16.1
snakeYamlVersion=1.19
snakeYamlVersion=1.33
caffeineVersion=2.7.0
metricsVersion=4.1.0
metricsNewRelicVersion=1.1.1

View File

@ -454,7 +454,7 @@ class CheckpointDumperImpl(private val checkpointStorage: CheckpointStorage, pri
private object MapSerializer : JsonSerializer<Map<Any, Any>>() {
override fun serialize(map: Map<Any, Any>, gen: JsonGenerator, serializers: SerializerProvider) {
gen.writeStartArray(map.size)
gen.writeStartArray()
map.forEach { (key, value) ->
gen.jsonObject {
writeObjectField("key", key)

View File

@ -16,7 +16,7 @@ dependencies {
cordaCompile project(':core')
compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_kotlin_version")
// only included to control the `DemoClock` as part of the demo application
// normally `:node` should not be depended on in any CorDapps

View File

@ -70,7 +70,7 @@ dependencies {
}
compile('org.springframework.boot:spring-boot-starter-log4j2')
runtimeOnly("org.apache.logging.log4j:log4j-web:$log4j_version")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_kotlin_version")
compile project(":client:rpc")
compile project(":client:jackson")
compile project(":finance:workflows")

View File

@ -82,10 +82,10 @@ include 'tools:checkpoint-agent'
include 'samples:attachment-demo:contracts'
include 'samples:attachment-demo:workflows'
include 'samples:trader-demo:workflows-trader'
include 'samples:irs-demo'
include 'samples:irs-demo:cordapp:contracts-irs'
include 'samples:irs-demo:cordapp:workflows-irs'
include 'samples:irs-demo:web'
// include 'samples:irs-demo'
// include 'samples:irs-demo:cordapp:contracts-irs'
// include 'samples:irs-demo:cordapp:workflows-irs'
// include 'samples:irs-demo:web'
include 'samples:simm-valuation-demo'
include 'samples:simm-valuation-demo:flows'
include 'samples:simm-valuation-demo:contracts-states'

View File

@ -6,7 +6,7 @@ dependencies {
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
compile "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_kotlin_version"
compile "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}"
compile "junit:junit:${junit_version}"

View File

@ -52,7 +52,7 @@ dependencies {
compile "com.typesafe:config:$typesafe_config_version"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
compile "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_kotlin_version"
compile "info.picocli:picocli:$picocli_version"
// TornadoFX: A lightweight Kotlin framework for working with JavaFX UI's.