harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r810928 - in /harmony/enhanced/classlib/trunk/modules/text/src/main/java: java/text/Format.java java/text/MessageFormat.java java/text/NumberFormat.java org/apache/harmony/text/internal/nls/messages.properties
Date Thu, 03 Sep 2009 13:17:17 GMT
Author: tellison
Date: Thu Sep  3 13:17:16 2009
New Revision: 810928

URL: http://svn.apache.org/viewvc?rev=810928&view=rev
Log:
Fix for HARMONY-6332 ([classlib] [text] java.text.Format#parseObject() fails to provide message
for ParseException)

Modified:
    harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java
    harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java
    harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java
    harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties

Modified: harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java?rev=810928&r1=810927&r2=810928&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java (original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/Format.java Thu Sep
 3 13:17:16 2009
@@ -186,7 +186,9 @@
         ParsePosition position = new ParsePosition(0);
         Object result = parseObject(string, position);
         if (position.getErrorIndex() != -1 || position.getIndex() == 0) {
-            throw new ParseException(null, position.getErrorIndex());
+            // text.1C=Format.parseObject(String) parse failure
+            throw new ParseException(
+                    Messages.getString("text.1C"), position.getErrorIndex()); //$NON-NLS-1$
         }
         return result;
     }

Modified: harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java?rev=810928&r1=810927&r2=810928&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java
Thu Sep  3 13:17:16 2009
@@ -858,7 +858,9 @@
         ParsePosition position = new ParsePosition(0);
         Object[] result = parse(string, position);
         if (position.getErrorIndex() != -1 || position.getIndex() == 0) {
-            throw new ParseException(null, position.getErrorIndex());
+            // text.1B=MessageFormat.parseObject(String) parse failure
+            throw new ParseException(
+                    Messages.getString("text.1B"), position.getErrorIndex()); //$NON-NLS-1$
         }
         return result;
     }

Modified: harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java?rev=810928&r1=810927&r2=810928&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/NumberFormat.java
Thu Sep  3 13:17:16 2009
@@ -540,7 +540,9 @@
         ParsePosition pos = new ParsePosition(0);
         Number number = parse(string, pos);
         if (pos.getErrorIndex() != -1 || pos.getIndex() == 0) {
-            throw new ParseException(null, pos.getErrorIndex());
+            // text.1D=Unparseable number: {0}
+            throw new ParseException(
+                    Messages.getString("text.1D", string), pos.getErrorIndex()); //$NON-NLS-1$
         }
         return number;
     }

Modified: harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties?rev=810928&r1=810927&r2=810928&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties
(original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties
Thu Sep  3 13:17:16 2009
@@ -43,4 +43,9 @@
 text.18=Not a valid {0}, subclass should override readResolve()
 text.19=Unparseable date: {0}
 text.1A=position is null
+text.1B=MessageFormat.parseObject(String) parse failure
+text.1C=Format.parseObject(String) parse failure
+text.1D=Unparseable number: {0}
+
+
 



Mime
View raw message