diff options
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | THANKYOU | 1 | ||||
-rw-r--r-- | java/text/DateFormatSymbols.java | 11 |
3 files changed, 27 insertions, 3 deletions
@@ -1,3 +1,21 @@ +2012-05-01 Andrew John Hughes <ahughes@redhat.com> + + * java/text/DateFormatSymbols.java: + Rename U00AE and U000A9 as the more memorable + FIELD_SPLIT and ZONE_SPLIT respectively. + * THANKYOU: Add Andreas Sewe. + +2012-04-30 Andreas Sewe <sewe@st.informatik.tu-darmstadt.de> + + PR classpath/53171 + * java/text/DateFormatSymbols.java: + (U00A9): Pre-compile pattern for zone separation. + (U00AE): Likewise for fields. + (getStringArray(List,String,int,String)): Use U00AE.split + in place of String.split. + (getZoneStrings(ResourceBundle,Locale)): Use U00AE.split + and U00A9.split in place of String.split. + 2012-04-25 Andrew John Hughes <ahughes@redhat.com> Update warning suppression so it still works @@ -43,6 +43,7 @@ Petter Reinholdtsen (pere@hungry.com) Julian Scheid (julian.scheid@sektor37.de) Martin Schröder (ms@artcom-gmbh.de) Robert Schuster (robertschuster@fsfe.org) +Andreas Sewe (sewe@st.informatik.tu-darmstadt.de) Gaute Smaaland (gs@sevenmountains.no) Michael Smith (msmith@spinnakernet.com) J. Russell Smyth (drfish@uswest.net) diff --git a/java/text/DateFormatSymbols.java b/java/text/DateFormatSymbols.java index 53e7ba07c..6b0d3a13f 100644 --- a/java/text/DateFormatSymbols.java +++ b/java/text/DateFormatSymbols.java @@ -55,6 +55,7 @@ import java.util.Properties; import java.util.ResourceBundle; import java.util.ServiceLoader; import java.util.TimeZone; +import java.util.regex.Pattern; import java.util.spi.TimeZoneNameProvider; @@ -100,6 +101,10 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable } } + private static final Pattern ZONE_SEP = Pattern.compile("\u00a9"); + + private static final Pattern FIELD_SEP = Pattern.compile("\u00ae"); + /** * The timezone strings supplied by the runtime. */ @@ -161,7 +166,7 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable for (int a = 0; a < bundles.size(); ++a) { String localeData = bundles.get(a).getString(name); - String[] array = localeData.split("\u00ae", size); + String[] array = FIELD_SEP.split(localeData, size); for (int b = 0; b < data.length; ++b) { if (array.length > b && array[b] != null && data[b].isEmpty() && !array[b].isEmpty()) @@ -191,10 +196,10 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable int index = 0; String country = locale.getCountry(); String data = res.getString("zoneStrings"); - String[] zones = data.split("\u00a9"); + String[] zones = ZONE_SEP.split(data); for (int a = 0; a < zones.length; ++a) { - String[] strings = zones[a].split("\u00ae"); + String[] strings = FIELD_SEP.split(zones[a]); String type = properties.getProperty(strings[0] + "." + country); if (type == null) type = properties.getProperty(strings[0] + ".DEFAULT"); |