harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r417148 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/Formatter.java test/java/tests/api/java/util/FormatterTest.java
Date Mon, 26 Jun 2006 09:06:44 GMT
Author: ndbeyer
Date: Mon Jun 26 02:06:44 2006
New Revision: 417148

URL: http://svn.apache.org/viewvc?rev=417148&view=rev
Log:
Apply patch for HARMONY-653.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormatterTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java?rev=417148&r1=417147&r2=417148&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Formatter.java
Mon Jun 26 02:06:44 2006
@@ -1183,6 +1183,11 @@
                 if (ParserStateMachine.EXIT_STATE != state) {
                     // exit state does not need to get next char
                     currentChar = getNextFormatChar();
+                    if (EOS == currentChar
+                            && ParserStateMachine.ENTRY_STATE != state) {
+                        throw new UnknownFormatConversionException(
+                                getFormatString());
+                    }
                 }
 
                 switch (state) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormatterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormatterTest.java?rev=417148&r1=417147&r2=417148&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormatterTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/FormatterTest.java
Mon Jun 26 02:06:44 2006
@@ -811,6 +811,14 @@
         } catch (UnknownFormatConversionException e) {
             // expected
         }
+        
+        try {
+            Formatter f = new Formatter(Locale.US);
+            f.format("%", "string");
+            fail("should throw UnknownFormatConversionException");
+        } catch (UnknownFormatConversionException e) {
+            // expected
+        }       
 
         formatter = new Formatter(Locale.FRANCE);
         formatter.format("%1$s%2$s%3$s%4$s%5$s%6$s%7$s%8$s%<s%s%s%<s", "1",



Mime
View raw message