changed the ServiceLoader.load call to use the class loader used to load the DefaultKryoCustomizer class instead of the default of using the thread context loader. This allows apps that use custom class loader hierarchies to use corda jars. All tests still pass

This commit is contained in:
Curtis Stanford 2017-07-11 13:15:31 -06:00 committed by Mike Hearn
parent 4487408526
commit c721316d67

View File

@ -47,7 +47,7 @@ object DefaultKryoCustomizer {
// No ClassResolver only constructor. MapReferenceResolver is the default as used by Kryo in other constructors.
val unusedKryo = Kryo(makeStandardClassResolver(), MapReferenceResolver())
val customization = KryoSerializationCustomization(unusedKryo)
ServiceLoader.load(CordaPluginRegistry::class.java).toList().filter { it.customizeSerialization(customization) }
ServiceLoader.load(CordaPluginRegistry::class.java, this.javaClass.classLoader).toList().filter { it.customizeSerialization(customization) }
}
fun customize(kryo: Kryo): Kryo {