harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r784724 - in /harmony/enhanced/classlib/trunk/modules/text/src: main/java/java/text/SimpleDateFormat.java test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.java
Date Mon, 15 Jun 2009 10:57:07 GMT
Author: regisxu
Date: Mon Jun 15 10:57:07 2009
New Revision: 784724

URL: http://svn.apache.org/viewvc?rev=784724&view=rev
Log:
Apply patch for HARMONY-6231: [classlib][text] DateFormat does not consider lenient

Modified:
    harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/SimpleDateFormat.java
    harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.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=784724&r1=784723&r2=784724&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 Jun 15 10:57:07 2009
@@ -1081,6 +1081,7 @@
             tzId = id;
             icuFormat.setTimeZone(com.ibm.icu.util.TimeZone.getTimeZone(tzId));
         }
+        icuFormat.setLenient(calendar.isLenient());
         return icuFormat.parse(string,position);
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.java?rev=784724&r1=784723&r2=784724&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.java
Mon Jun 15 10:57:07 2009
@@ -459,4 +459,17 @@
 			assertNotNull(e.getMessage());
 		}
 	}
+
+    /**
+     * @tests java.text.DateFormat#setLenient(boolean)
+     */
+    public void test_setLenient() {
+	Date d = null;
+	DateFormat output = new SimpleDateFormat("MM/dd/yy");
+	output.setLenient(false);
+	try {
+	    d = output.parse("01/01/-1");
+	    fail("Should throw ParseException here.");
+	} catch (ParseException e) {}
+    }
 }



Mime
View raw message