This pads out the timezone string arrays so that those
without daylight savings time still have a length of 5.

ChangeLog:

2008-07-07  Andrew John Hughes  <[EMAIL PROTECTED]>

        * java/text/DateFormatSymbols.java:
        (getZoneStrings(ResourceBundle,Locale)):
        Pad arrays smaller than 5 with empty strings.

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: java/text/DateFormatSymbols.java
===================================================================
RCS file: /sources/classpath/classpath/java/text/DateFormatSymbols.java,v
retrieving revision 1.23
diff -u -u -r1.23 DateFormatSymbols.java
--- java/text/DateFormatSymbols.java    8 Jan 2007 00:41:24 -0000       1.23
+++ java/text/DateFormatSymbols.java    7 Jul 2008 02:55:30 -0000
@@ -113,7 +113,18 @@
         String data = res.getString("zoneStrings");
        String[] zones = data.split("\u00a9");
        for (int a = 0; a < zones.length; ++a)
-         allZones.add(zones[a].split("\u00ae"));
+         {
+           String[] strings = zones[a].split("\u00ae");
+           if (strings.length < 5)
+             {
+               String[] newStrings = new String[5];
+               System.arraycopy(strings, 0, newStrings, 0, strings.length);
+               for (int b = strings.length; a < newStrings.length; ++a)
+                 newStrings[b] = "";
+               strings = newStrings;
+             }
+           allZones.add(strings);
+         }
       }
     catch (MissingResourceException e)
       {

Reply via email to