Skip to content

Commit d3fb4cd

Browse files
authored
Fix loop in SimpleDateTimeTextProvider (#202)
Should continue the outer loop (based on the comment) Fixes #198
1 parent 96182a6 commit d3fb4cd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/changes/changes.xml

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
<body>
99

1010
<!-- types are add, fix, remove, update -->
11+
<release version="1.7.1" date="SNAPSHOT" description="v1.7.1">
12+
<action dev="jodastephen" type="fix" issue="198">
13+
Fix implementation of `SimpleDateTimeTextProvider`.
14+
</action>
15+
<action dev="jodastephen" type="update">
16+
Update to time-zone data 2025agtz.
17+
</action>
18+
</release>
1119
<release version="1.7.0" date="2024-09-17" description="v1.7.0">
1220
<action dev="jodastephen" type="fix">
1321
Enhance TZDB parsing, handling more shortened forms.

src/main/java/org/threeten/bp/format/SimpleDateTimeTextProvider.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,12 @@ static final class LocaleStore {
426426
this.valueTextMap = valueTextMap;
427427
Map<TextStyle, List<Entry<String, Long>>> map = new HashMap<TextStyle, List<Entry<String,Long>>>();
428428
List<Entry<String, Long>> allList = new ArrayList<Map.Entry<String,Long>>();
429+
outer:
429430
for (TextStyle style : valueTextMap.keySet()) {
430431
Map<String, Entry<String, Long>> reverse = new HashMap<String, Map.Entry<String,Long>>();
431432
for (Map.Entry<Long, String> entry : valueTextMap.get(style).entrySet()) {
432433
if (reverse.put(entry.getValue(), createEntry(entry.getValue(), entry.getKey())) != null) {
433-
continue; // not parsable, try next style
434+
continue outer; // not parsable, try next style
434435
}
435436
}
436437
List<Entry<String, Long>> list = new ArrayList<Map.Entry<String,Long>>(reverse.values());

0 commit comments

Comments
 (0)