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
This commit is contained in:
parent
b7afd19fb4
commit
68bac95cd5
@ -172,7 +172,7 @@ public abstract class Serializer {
|
|||||||
|
|
||||||
serializer.initialize(cls);
|
serializer.initialize(cls);
|
||||||
|
|
||||||
log.log( Level.INFO, "Registered class:{0}.", cls );
|
log.log( Level.INFO, "Registered class[" + classId + "]:{0}.", cls );
|
||||||
return reg;
|
return reg;
|
||||||
}
|
}
|
||||||
if (failOnMiss) {
|
if (failOnMiss) {
|
||||||
@ -233,13 +233,19 @@ public abstract class Serializer {
|
|||||||
public static SerializerRegistration registerClass(Class cls, Serializer serializer) {
|
public static SerializerRegistration registerClass(Class cls, Serializer serializer) {
|
||||||
SerializerRegistration existingReg = getExactSerializerRegistration(cls);
|
SerializerRegistration existingReg = getExactSerializerRegistration(cls);
|
||||||
|
|
||||||
short id = --nextId;
|
short id;
|
||||||
if (existingReg != null) id = existingReg.getId();
|
if (existingReg != null) {
|
||||||
|
id = existingReg.getId();
|
||||||
|
} else {
|
||||||
|
id = --nextId;
|
||||||
|
}
|
||||||
SerializerRegistration reg = new SerializerRegistration(serializer, cls, id);
|
SerializerRegistration reg = new SerializerRegistration(serializer, cls, id);
|
||||||
|
|
||||||
idRegistrations.put(id, reg);
|
idRegistrations.put(id, reg);
|
||||||
classRegistrations.put(cls, reg);
|
classRegistrations.put(cls, reg);
|
||||||
|
|
||||||
|
log.log( Level.INFO, "Registered class[" + id + "]:{0} to:" + serializer, cls );
|
||||||
|
|
||||||
serializer.initialize(cls);
|
serializer.initialize(cls);
|
||||||
|
|
||||||
return reg;
|
return reg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user