S does not mean the same as ms! also, allow decimal for S

This commit is contained in:
Michael McCandless 2015-06-01 13:08:54 -04:00 committed by mikemccand
parent 79524c1041
commit 964ac4405b
1 changed files with 1 additions and 1 deletions

View File

@ -239,7 +239,7 @@ public class TimeValue implements Serializable, Streamable {
// TODO: we should be consistent about whether upper-case is allowed (it is always allowed for ByteSizeValue, but here only for
// s/S and h/H):
if (sValue.endsWith("S")) {
millis = Long.parseLong(sValue.substring(0, sValue.length() - 1));
millis = (long) Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 1000;
} else if (sValue.endsWith("ms")) {
millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 2)));
} else if (sValue.endsWith("s")) {