Permalink
Browse files

In map_field_by, assoc both the clojure name and the protobuf name.

Should only matter in cases that are basically errors.
  • Loading branch information...
1 parent ebb18b0 commit 907a53c6d062618c44947aa7f76f433464b89a5a @amalloy amalloy committed Apr 23, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/protobuf/core/PersistentProtocolBufferMap.java
@@ -595,11 +595,12 @@ protected void setField(DynamicMessage.Builder builder, Descriptors.FieldDescrip
} else {
Object map_field_by = def.mapFieldBy(field);
if (map_field_by != null) {
+ String field_name = def.namingStrategy.protoName(map_field_by);
for (ISeq s = RT.seq(value); s != null; s = s.next()) {
Map.Entry<?, ?> e = (Map.Entry<?, ?>)s.first();
IPersistentMap map = (IPersistentMap)e.getValue();
Object k = e.getKey();
- Object v = toProtoValue(field, map.assoc(map_field_by, k));
+ Object v = toProtoValue(field, map.assoc(map_field_by, k).assoc(field_name, k));
addRepeatedField(builder, field, v);
}
} else if (field.getOptions().getExtension(Extensions.map)) {

0 comments on commit 907a53c

Please sign in to comment.