mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
java: fixes CollectionTemplate
This commit is contained in:
parent
19ff0dd17f
commit
0a345cb12b
1 changed files with 2 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue