Skip to content

The For-Loop in SimpleDateTimeTextProvider.LocaleStore Constructor #198

Closed
@paulushub

Description

@paulushub

The following constructor has a for-loop with a continue statement that seems to do nothing!
It is the line continue; // not parsable, try next style:
Is there something missing?

LocaleStore(Map<TextStyle, Map<Long, String>> valueTextMap) {
    this.valueTextMap = valueTextMap;
    Map<TextStyle, List<Entry<String, Long>>> map = new HashMap<TextStyle, List<Entry<String,Long>>>();
    List<Entry<String, Long>> allList = new ArrayList<Map.Entry<String,Long>>();
    for (TextStyle style : valueTextMap.keySet()) {
        Map<String, Entry<String, Long>> reverse = new HashMap<String, Map.Entry<String,Long>>();
        for (Map.Entry<Long, String> entry : valueTextMap.get(style).entrySet()) {
            if (reverse.put(entry.getValue(), createEntry(entry.getValue(), entry.getKey())) != null) {
                continue;  // not parsable, try next style
            }
        }
        List<Entry<String, Long>> list = new ArrayList<Map.Entry<String,Long>>(reverse.values());
        Collections.sort(list, COMPARATOR);
        map.put(style, list);
        allList.addAll(list);
        map.put(null, allList);
    }
    Collections.sort(allList, COMPARATOR);
    this.parsable = map;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions