From 68bac95cd587c5cad07866f5a3692b50c361c12c Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Fri, 24 Jun 2011 10:06:41 +0000 Subject: [PATCH] Added some more information to the logging. Removed an errant nextId decrement that would occur even if the class was already registered and already had an ID. This makes the teetering tower of glass shards slightly less fragile... slightly. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7722 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/network/serializing/Serializer.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/engine/src/networking/com/jme3/network/serializing/Serializer.java b/engine/src/networking/com/jme3/network/serializing/Serializer.java index 520302806..179371e45 100644 --- a/engine/src/networking/com/jme3/network/serializing/Serializer.java +++ b/engine/src/networking/com/jme3/network/serializing/Serializer.java @@ -172,7 +172,7 @@ public abstract class Serializer { serializer.initialize(cls); - log.log( Level.INFO, "Registered class:{0}.", cls ); + log.log( Level.INFO, "Registered class[" + classId + "]:{0}.", cls ); return reg; } if (failOnMiss) { @@ -233,12 +233,18 @@ public abstract class Serializer { public static SerializerRegistration registerClass(Class cls, Serializer serializer) { SerializerRegistration existingReg = getExactSerializerRegistration(cls); - short id = --nextId; - if (existingReg != null) id = existingReg.getId(); + short id; + if (existingReg != null) { + id = existingReg.getId(); + } else { + id = --nextId; + } SerializerRegistration reg = new SerializerRegistration(serializer, cls, id); idRegistrations.put(id, reg); classRegistrations.put(cls, reg); + + log.log( Level.INFO, "Registered class[" + id + "]:{0} to:" + serializer, cls ); serializer.initialize(cls);