From cc29defdadbd9107105d76a263008f34e9c78298 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:14:08 +0100 Subject: [PATCH] fixed files form Time #20 --- .../org/joda/time/format/DateTimeFormatterBuilder.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/projects/Time/20/org/joda/time/format/DateTimeFormatterBuilder.java b/projects/Time/20/org/joda/time/format/DateTimeFormatterBuilder.java index 558a586..ebb4b08 100644 --- a/projects/Time/20/org/joda/time/format/DateTimeFormatterBuilder.java +++ b/projects/Time/20/org/joda/time/format/DateTimeFormatterBuilder.java @@ -2539,12 +2539,18 @@ public int estimateParsedLength() { public int parseInto(DateTimeParserBucket bucket, String text, int position) { String str = text.substring(position); + String best = null; for (String id : ALL_IDS) { if (str.startsWith(id)) { - bucket.setZone(DateTimeZone.forID(id)); - return position + id.length(); + if (best == null || id.length() > best.length()) { + best = id; + } } } + if (best != null) { + bucket.setZone(DateTimeZone.forID(best)); + return position + best.length(); + } return ~position; } }