< prev index next >

src/java.base/share/classes/java/text/SimpleDateFormat.java

Print this page
rev 49575 : imported patch 8181157

*** 1,7 **** /* ! * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 53,62 **** --- 53,63 ---- import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import sun.util.calendar.CalendarUtils; import sun.util.calendar.ZoneInfoFile; import sun.util.locale.provider.LocaleProviderAdapter; + import sun.util.locale.provider.TimeZoneNameUtility; /** * <code>SimpleDateFormat</code> is a concrete class for formatting and * parsing dates in a locale-sensitive manner. It allows for formatting * (date &rarr; text), parsing (text &rarr; date), and normalization.
*** 1689,1698 **** --- 1690,1705 ---- private int matchZoneString(String text, int start, String[] zoneNames) { for (int i = 1; i <= 4; ++i) { // Checking long and short zones [1 & 2], // and long and short daylight [3 & 4]. String zoneName = zoneNames[i]; + if (zoneName.isEmpty()) { + // fill in by retrieving single name + zoneName = TimeZoneNameUtility.retrieveDisplayName( + zoneNames[0], i >= 3, i % 2, locale); + zoneNames[i] = zoneName; + } if (text.regionMatches(true, start, zoneName, 0, zoneName.length())) { return i; } }
< prev index next >