java: fixed a bug within a Packer class

This commit is contained in:
Muga Nishizawa
2010-09-27 10:16:32 +09:00
parent 02342ba540
commit ee1ba5c0f2

View File

@@ -486,8 +486,7 @@ public class Packer {
packer.pack(this, o); packer.pack(this, o);
return this; return this;
} else if (isAnnotated(klass, MessagePackMessage.class)) { } else if (isAnnotated(klass, MessagePackMessage.class)) {
ReflectionPacker.create(klass); packer = ReflectionPacker.create(klass);
CustomPacker.register(klass, packer);
packer.pack(this, o); packer.pack(this, o);
return this; return this;
} else if (isAnnotated(klass, MessagePackDelegate.class)) { } else if (isAnnotated(klass, MessagePackDelegate.class)) {
@@ -495,7 +494,7 @@ public class Packer {
} else if (isAnnotated(klass, MessagePackOrdinalEnum.class)) { } else if (isAnnotated(klass, MessagePackOrdinalEnum.class)) {
throw new UnsupportedOperationException("not supported yet. : " + klass.getName()); throw new UnsupportedOperationException("not supported yet. : " + klass.getName());
} }
CustomPacker.register(klass, packer);
// FIXME check annotations -> code generation -> CustomMessage.registerPacker // FIXME check annotations -> code generation -> CustomMessage.registerPacker
throw new MessageTypeException("unknown object "+o+" ("+o.getClass()+")"); throw new MessageTypeException("unknown object "+o+" ("+o.getClass()+")");