Index: MessageFormatter.java
===================================================================
--- MessageFormatter.java	（版本 1067）
+++ MessageFormatter.java	（工作副本）
@@ -1,7 +1,7 @@
-/* 
+/*
  * Copyright (c) 2004-2007 QOS.ch
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free  of charge, to any person obtaining
  * a  copy  of this  software  and  associated  documentation files  (the
  * "Software"), to  deal in  the Software without  restriction, including
@@ -9,10 +9,10 @@
  * distribute,  sublicense, and/or sell  copies of  the Software,  and to
  * permit persons to whom the Software  is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The  above  copyright  notice  and  this permission  notice  shall  be
  * included in all copies or substantial portions of the Software.
- * 
+ *
  * THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
  * EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
  * MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
@@ -40,40 +40,40 @@
  * pattern itself but do not want them to be interpreted as a formatting
  * anchors, you can espace the '{' character with '\', that is the backslash
  * character. Only the '{' character should be escaped. There is no need to
- * escape the '}' character. For example, 
+ * escape the '}' character. For example,
  * <pre>MessageFormatter.format(&quot;Set \\{1,2,3} is not equal to {}.&quot;, &quot;1,2&quot;);</pre>
- * will return the string "Set {1,2,3} is not equal to 1,2.". 
- * 
+ * will return the string "Set {1,2,3} is not equal to 1,2.".
+ *
  * <p>
- * The escaping behaviour just described can be overridden by 
+ * The escaping behaviour just described can be overridden by
  * escaping the escape character '\'. Calling
  * <pre>MessageFormatter.format(&quot;File name is C:\\\\{}.&quot;, &quot;file.zip&quot;);</pre>
  * will return the string "File name is C:\file.zip".
- * 
+ *
  * <p>
  * See {@link #format(String, Object)}, {@link #format(String, Object, Object)}
  * and {@link #arrayFormat(String, Object[])} methods for more details.
- * 
+ *
  * @author Ceki G&uuml;lc&uuml;
  */
 public class MessageFormatter {
   static final char DELIM_START = '{';
   static final char DELIM_STOP = '}';
   private static final char ESCAPE_CHAR = '\\';
-  
+
   /**
    * Performs single argument substitution for the 'messagePattern' passed as
    * parameter.
    * <p>
    * For example,
-   * 
+   *
    * <pre>
    * MessageFormatter.format(&quot;Hi {}.&quot;, &quot;there&quot;);
    * </pre>
-   * 
+   *
    * will return the string "Hi there.".
    * <p>
-   * 
+   *
    * @param messagePattern
    *          The message pattern which will be parsed and formatted
    * @param argument
@@ -85,18 +85,18 @@
   }
 
   /**
-   * 
+   *
    * Performs a two argument substitution for the 'messagePattern' passed as
    * parameter.
    * <p>
    * For example,
-   * 
+   *
    * <pre>
    * MessageFormatter.format(&quot;Hi {}. My name is {}.&quot;, &quot;Alice&quot;, &quot;Bob&quot;);
    * </pre>
-   * 
+   *
    * will return the string "Hi Alice. My name is Bob.".
-   * 
+   *
    * @param messagePattern
    *          The message pattern which will be parsed and formatted
    * @param arg1
@@ -115,7 +115,7 @@
    * Same principle as the {@link #format(String, Object)} and
    * {@link #format(String, Object, Object)} methods except that any number of
    * arguments can be passed in an array.
-   * 
+   *
    * @param messagePattern
    *          The message pattern which will be parsed and formatted
    * @param argArray
@@ -134,7 +134,7 @@
     if(argArray == null) {
       return messagePattern;
     }
-    
+
     StringBuffer sbuf = new StringBuffer(messagePattern.length() + 50);
 
     for (int L = 0; L < argArray.length; L++) {
@@ -164,7 +164,7 @@
             // itself escaped: "abc x:\\{}"
             // we have to consume one backward slash
             sbuf.append(messagePattern.substring(i, j-1));
-            sbuf.append(argArray[L]);
+            appendParam(sbuf,argArray[L]);
             i = j + 2;
           }
         } else if ((delimStop != DELIM_STOP)) {
@@ -174,7 +174,7 @@
         } else {
           // normal case
           sbuf.append(messagePattern.substring(i, j));
-          sbuf.append(argArray[L]);
+          appendParam(sbuf,argArray[L]);
           i = j + 2;
         }
       }
@@ -184,6 +184,74 @@
     return sbuf.toString();
   }
 
+  /**
+    * append value ,check array type ,added by lizongbo
+    * @param sb StringBuffer
+    * @param argArray Object
+    */
+   private static void appendParam(StringBuffer sb, Object argArray) {
+       if (argArray != null && argArray.getClass().isArray()) {
+           sb.append('[');
+           if (argArray instanceof Object[]) {
+               Object[] value = (Object[]) argArray;
+               if (value.length > 0) {
+                   for (int k = 0; k < value.length - 1; k++) {
+                       sb.append(value[k]).append(',');
+                   }
+                   sb.append(value[value.length - 1]);
+               }
+           } else if (argArray instanceof byte[]) {
+               byte[] value = (byte[]) argArray;
+               if (value.length > 0) {
+                   for (int k = 0; k < value.length - 1; k++) {
+                       sb.append(value[k]).append(',');
+                   }
+                   sb.append(value[value.length - 1]);
+               }
+           } else if (argArray instanceof char[]) {
+               char[] value = (char[]) argArray;
+               sb.append(value);
+           } else if (argArray instanceof int[]) {
+               int[] value = (int[]) argArray;
+               if (value.length > 0) {
+                   for (int k = 0; k < value.length - 1; k++) {
+                       sb.append(value[k]).append(',');
+                   }
+                   sb.append(value[value.length - 1]);
+               }
+           } else if (argArray instanceof long[]) {
+               long[] value = (long[]) argArray;
+               if (value.length > 0) {
+                   for (int k = 0; k < value.length - 1; k++) {
+                       sb.append(value[k]).append(',');
+                   }
+                   sb.append(value[value.length - 1]);
+               }
+           } else if (argArray instanceof double[]) {
+               double[] value = (double[]) argArray;
+               if (value.length > 0) {
+                   for (int k = 0; k < value.length - 1; k++) {
+                       sb.append(value[k]).append(',');
+                   }
+                   sb.append(value[value.length - 1]);
+               }
+           } else if (argArray instanceof float[]) {
+               float[] value = (float[]) argArray;
+               if (value.length > 0) {
+                   for (int k = 0; k < value.length - 1; k++) {
+                       sb.append(value[k]).append(',');
+                   }
+                   sb.append(value[value.length - 1]);
+               }
+           }
+           sb.append(']');
+       } else {
+           sb.append(argArray);
+       }
+
+   }
+
+
   static boolean isEscapedDelimeter(String messagePattern,
       int delimeterStartIndex) {
 
