harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r617008 - 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 Thu, 31 Jan 2008 05:53:22 GMT
Author: tonywu
Date: Wed Jan 30 21:53:11 2008
New Revision: 617008

URL: http://svn.apache.org/viewvc?rev=617008&view=rev
Log:
Fix the EUT regression of HARMONY-5436

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=617008&r1=617007&r2=617008&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 21:53:11 2008
@@ -446,9 +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 (objects != null) {
+            for (int i = 0; i < objects.length; i++) {
+                if (objects[i] == null) {
+                    objects[i] = "null";
+                }
             }
         }
         if (format == null) {

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=617008&r1=617007&r2=617008&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 21:53:11 2008
@@ -764,6 +764,7 @@
         MessageFormat obj = new MessageFormat(pat); 
         assertEquals(etalon, obj.format(new Object[]{new Date(1198141737640L)})); 
         
+        assertEquals("{0}", MessageFormat.format("{0}", (Object[])null));
         assertEquals("nullABC", MessageFormat.format("{0}{1}", new String[]{null, "ABC"}));
     } 
 



Mime
View raw message