Skip to content

Commit

Permalink
CommitStats doesn't need to allow for null values in commit user data
Browse files Browse the repository at this point in the history
Lucene forbids writing those and MapBuilder.immutableMap doesn't like them either, as discovered by @brwe

Closes #10774
  • Loading branch information
bleskes committed Apr 24, 2015
1 parent 135af09 commit 1dc0dae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/elasticsearch/index/engine/CommitStats.java
Expand Up @@ -70,7 +70,7 @@ public long getGeneration() {
public void readFrom(StreamInput in) throws IOException {
MapBuilder<String, String> builder = MapBuilder.newMapBuilder();
for (int i = in.readVInt(); i > 0; i--) {
builder.put(in.readString(), in.readOptionalString());
builder.put(in.readString(), in.readString());
}
userData = builder.immutableMap();
generation = in.readLong();
Expand All @@ -81,7 +81,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(userData.size());
for (Map.Entry<String, String> entry : userData.entrySet()) {
out.writeString(entry.getKey());
out.writeOptionalString(entry.getValue());
out.writeString(entry.getValue());
}
out.writeLong(generation);
}
Expand Down

0 comments on commit 1dc0dae

Please sign in to comment.