Skip to content

Commit

Permalink
Improve boolean handling in snapshot/restore request parsing
Browse files Browse the repository at this point in the history
Fixes #4949
  • Loading branch information
Mark Conlin authored and imotov committed Jan 30, 2014
1 parent 436d4b5 commit 32202d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Expand Up @@ -393,10 +393,7 @@ public CreateSnapshotRequest source(Map source) {
}
settings((Map<String, Object>) entry.getValue());
} else if (name.equals("include_global_state")) {
if (!(entry.getValue() instanceof Boolean)) {
throw new ElasticsearchIllegalArgumentException("malformed include_global_state, should be boolean");
}
includeGlobalState((Boolean) entry.getValue());
includeGlobalState = nodeBooleanValue(entry.getValue());
}
}
indicesOptions(IndicesOptions.fromOptions(ignoreUnavailable, allowNoIndices, expandWildcardsOpen, expandWildcardsClosed));
Expand Down
Expand Up @@ -411,10 +411,7 @@ public RestoreSnapshotRequest source(Map source) {
}
settings((Map<String, Object>) entry.getValue());
} else if (name.equals("include_global_state")) {
if (!(entry.getValue() instanceof Boolean)) {
throw new ElasticsearchIllegalArgumentException("malformed include_global_state, should be boolean");
}
includeGlobalState((Boolean) entry.getValue());
includeGlobalState = nodeBooleanValue(entry.getValue());
} else if (name.equals("rename_pattern")) {
if (entry.getValue() instanceof String) {
renamePattern((String) entry.getValue());
Expand Down

0 comments on commit 32202d5

Please sign in to comment.