Skip to content

Commit 6e63cb4

Browse files
committed
Review: EpochTimeParser comments
1 parent f5fe3f2 commit 6e63cb4

File tree

1 file changed

+4
-4
lines changed
  • src/main/java/org/elasticsearch/common/joda

1 file changed

+4
-4
lines changed

src/main/java/org/elasticsearch/common/joda/Joda.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@ public DateTimeField getField(Chronology chronology) {
200200

201201
public static class EpochTimeParser implements DateTimeParser {
202202

203-
private static final Pattern milliSecondPrecisionPattern = Pattern.compile("^\\d{1,13}$");
204-
private static final Pattern secondPrecisionPattern = Pattern.compile("^\\d{1,10}$");
203+
private static final Pattern MILLI_SECOND_PRECISION_PATTERN = Pattern.compile("^\\d{1,13}$");
204+
private static final Pattern SECOND_PRECISION_PATTERN = Pattern.compile("^\\d{1,10}$");
205205

206206
private final boolean hasMilliSecondPrecision;
207207
private final Pattern pattern;
208208

209209
public EpochTimeParser(boolean hasMilliSecondPrecision) {
210210
this.hasMilliSecondPrecision = hasMilliSecondPrecision;
211-
this.pattern = hasMilliSecondPrecision ? milliSecondPrecisionPattern : secondPrecisionPattern;
211+
this.pattern = hasMilliSecondPrecision ? MILLI_SECOND_PRECISION_PATTERN : SECOND_PRECISION_PATTERN;
212212
}
213213

214214
@Override
@@ -218,7 +218,7 @@ public int estimateParsedLength() {
218218

219219
@Override
220220
public int parseInto(DateTimeParserBucket bucket, String text, int position) {
221-
if (text.length() > estimateParsedLength() || !pattern.matcher(text).matches()) {
221+
if (text.length() > estimateParsedLength() || pattern.matcher(text).matches() == false) {
222222
return 0;
223223
}
224224

0 commit comments

Comments
 (0)