Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping: Explicit _timestamp default null is set to now #9428

Merged
merged 1 commit into from Jan 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -354,8 +354,8 @@ private void initMappers(Map<String, Object> withoutType) {
path = fieldNode.toString();
} else if (fieldName.equals("format")) {
format = fieldNode.toString();
} else if (fieldName.equals("default") && fieldNode != null) {
defaultTimestamp = fieldNode.toString();
} else if (fieldName.equals("default")) {
defaultTimestamp = fieldNode == null ? null : fieldNode.toString();
}
}
this.timestamp = new Timestamp(enabled, path, format, defaultTimestamp);
Expand Down
Expand Up @@ -624,7 +624,9 @@ public void testInitMappers() throws IOException {
.endObject()
.endObject().endObject().string();
// This was causing a NPE
new MappingMetaData(new CompressedString(mapping));
MappingMetaData mappingMetaData = new MappingMetaData(new CompressedString(mapping));
String defaultTimestamp = mappingMetaData.timestamp().defaultTimestamp();
assertThat(defaultTimestamp, is(nullValue()));
}

@Test
Expand Down