mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 21:18:23 +01:00
java: fixes CollectionTemplate
This commit is contained in:
parent
19ff0dd17f
commit
0a345cb12b
@ -31,10 +31,11 @@ public class CollectionTemplate implements Template {
|
||||
}
|
||||
|
||||
public void pack(Packer pk, Object target) throws IOException {
|
||||
if(target instanceof Collection) {
|
||||
if(!(target instanceof Collection)) {
|
||||
throw new MessageTypeException();
|
||||
}
|
||||
Collection<Object> collection = (Collection<Object>)target;
|
||||
pk.packArray(collection.size());
|
||||
for(Object element : collection) {
|
||||
elementTemplate.pack(pk, element);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user