harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r616678 - in /harmony/enhanced/classlib/trunk/modules/text/src: main/java/java/text/MessageFormat.java test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java
Date Wed, 30 Jan 2008 08:16:34 GMT
Author: tonywu
Date: Wed Jan 30 00:16:32 2008
New Revision: 616678

URL: http://svn.apache.org/viewvc?rev=616678&view=rev
Log:
Fix HARMONY-5436 ([classlib][EUT] r612718 commit caused failure in 1 jdtcoremodel test)

Modified:
    harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/MessageFormat.java
    harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java

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=616678&r1=616677&r2=616678&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
Wed Jan 30 00:16:32 2008
@@ -446,6 +446,11 @@
      *                when the pattern cannot be parsed
      */
     public static String format(String template, Object... objects) {
+        for (int i = 0; i < objects.length; i++) {
+            if (objects[i] == null) {
+                objects[i] = "null";
+            }
+        }
         if (format == null) {
             format = new com.ibm.icu.text.MessageFormat(template);
         } else if (!template.equals(format.toPattern())){

Modified: harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java?rev=616678&r1=616677&r2=616678&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java
Wed Jan 30 00:16:32 2008
@@ -763,6 +763,8 @@
         String etalon="text here  000002007  and here"; 
         MessageFormat obj = new MessageFormat(pat); 
         assertEquals(etalon, obj.format(new Object[]{new Date(1198141737640L)})); 
+        
+        assertEquals("nullABC", MessageFormat.format("{0}{1}", new String[]{null, "ABC"}));
     } 
 
     public void testHARMONY5323() { 



Mime
View raw message