If registration was previously ignored, then ignore it on subsequent initialization

This commit is contained in:
nathan 2020-09-15 16:53:34 +02:00
parent 3b9eb00de9
commit b18fccc867
2 changed files with 11 additions and 2 deletions

View File

@ -33,8 +33,12 @@ internal abstract class ClassRegistration(val clazz: Class<*>, val serializer: S
*/
open fun register(kryo: KryoExtra, rmi: RmiHolder) {
// ClassRegistrationForRmi overrides this method
if (id == IGNORE_REGISTRATION) {
// we have previously specified that this registration should be ignored!
return
}
if (id != 0) {
if (id > 0) {
// our ID will always be > 0
// this means that this registration was PREVIOUSLY registered on a different kryo. Shortcut the logic.

View File

@ -105,7 +105,12 @@ internal class ClassRegistrationForRmi(ifaceClass: Class<*>,
*/
override fun register(kryo: KryoExtra, rmi: RmiHolder) {
// we override this, because we ALWAYS will call our RMI registration!
if (id != 0) {
if (id == IGNORE_REGISTRATION) {
// we have previously specified that this registration should be ignored!
return
}
if (id > 0) {
// our ID will always be > 0
// this means that this registration was PREVIOUSLY registered on a different kryo. Shortcut the logic.