Corda-1869 serialisation refactor (#3780)

* Pull out and tidy type parameter inference

* Contain null proliferation

* Extract fingerprinter state

* SerializerFingerPrinter is always initialised with a SerializerFactory

* Move non-recursive state transition functions into state

* Move all state transition functions into state

* Simplify and optimise with mutable state

* Move TypeParameterUtils back into internal.amqp

* Clarify behaviour of constructorForDeserialisation

* constructorForDeserialization no longer returns null

* Capture field properties

* Narrow PropertyDescriptor

* Use map rather than apply on a mutable list

* Remove printStackTrace added for debugging

* CORDA-1869 minor tweaks

* Use groupingBy to avoid creating an intermediate map

* Convert some functional origami to plain old for-loops

* Eliminate nested lambda to unbreak pre-serialisation

* Use EnumMap for map of Enums
This commit is contained in:
Dominic Fox
2018-08-30 10:18:02 +01:00
committed by GitHub
parent 4337537791
commit 0f36e22314
16 changed files with 627 additions and 593 deletions

View File

@ -15,10 +15,6 @@ class FingerPrinterTesting : FingerPrinter {
return cache.computeIfAbsent(type) { index++.toString() }
}
override fun setOwner(factory: SerializerFactory) {
return
}
@Suppress("UNUSED")
fun changeFingerprint(type: Type) {
cache.computeIfAbsent(type) { "" }.apply { index++.toString() }
@ -47,7 +43,7 @@ class FingerPrinterTestingTests {
AllWhitelist,
ClassLoader.getSystemClassLoader(),
evolutionSerializerGetter = EvolutionSerializerGetterTesting(),
fingerPrinter = FingerPrinterTesting())
fingerPrinterConstructor = { _ -> FingerPrinterTesting() })
val blob = TestSerializationOutput(VERBOSE, factory).serializeAndReturnSchema(C(1, 2L))