harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r768920 - /harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
Date Mon, 27 Apr 2009 10:29:52 GMT
Author: tellison
Date: Mon Apr 27 10:29:52 2009
New Revision: 768920

URL: http://svn.apache.org/viewvc?rev=768920&view=rev
Log:
Apply slightly modified patch for HARMONY-6181 ([classlib][text] SimpleDateFormatTest.test_set2DigitYearStartLjava_util_Date
would fail)

Modified:
    harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java

Modified: harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java?rev=768920&r1=768919&r2=768920&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
Mon Apr 27 10:29:52 2009
@@ -257,8 +257,19 @@
      * @exception IllegalArgumentException
      *                if the pattern is invalid
      */
+    @SuppressWarnings("nls")
     public void applyPattern(String template) {
         validatePattern(template);
+        /*
+         * ICU spec explicitly mentions that "ICU interprets a single 'y'
+         * differently than Java." We need to do a trick here to follow Java
+         * spec.
+         */
+        if (template.equals("y")) {
+            icuFormat.applyPattern("yy");
+            pattern = "y";
+            return;
+        }
         icuFormat.applyPattern(template);
         pattern = template;
     }



Mime
View raw message