} else if (options.getExtension(Extensions.set)) {
Descriptors.Descriptor type = field.getMessageType();
Descriptors.FieldDescriptor item_field = type.findFieldByName("item");
Descriptors.FieldDescriptor exists_field = type.findFieldByName("exists");
ITransientSet set = (ITransientSet)OrderedSet.EMPTY.asTransient();
while (iterator.hasNext()) {
DynamicMessage message = (DynamicMessage)iterator.next();
Object item = fromProtoValue(item_field, message.getField(item_field));
Boolean exists = (Boolean)message.getField(exists_field);
if (exists) {
set = (ITransientSet)set.conj(item);
} else {
try {
set = set.disjoin(item);
} catch (Exception e) {
e.printStackTrace();
}
}
}
return set.persistent();
}
}
List<Object> list = new ArrayList<Object>(values.size());
while (iterator.hasNext()) {
list.add(fromProtoValue(field, iterator.next(), use_extensions));