--- c:\Java\jdk1.7\src\java\lang\String.java	2008-09-11 00:55:24.000000000 +0200
+++ c:\Proyectos\jdk1.7.0_optimizado\src\java\lang\String.java	2008-09-21 22:11:11.332000000 +0200
@@ -3010,5 +3010,142 @@
      *          guaranteed to be from a pool of unique strings.
      */
     public native String intern();
+    
+    
+    
+    
+    
+    //-------------------------------------------------------------------------------
+    // Jesús Viñuales tests...
+    // http://serverperformance.blogspot.com
+    //
+    // sept-08
+    //-------------------------------------------------------------------------------
+    
+    /**
+     * Creates a new String from a String array.
+     * with the same result as "new StringBuilder().append().append()...toString()".
+     * 
+     * This is actually an optimized specialization of the
+     * <code>public String(Object...)</code> constructor.
+     * 
+     * @param strs      The String array
+     * @throws          NullPointerException if <code>objs</code> is <code>null</code>
+     *                  (but its elements can be null)
+     */
+    public String(String... strs) {
+        // 1. Calculates the needed array length...
+        int totalSize = 0;
+        int numStrs = strs.length;
+        for (int i=0; i<numStrs; i++) {
+            String str = strs[i];
+            totalSize += (str!=null) ? str.count : 4; // "null".count = 4
+        }
+        // 2. ...And copies the char[] values
+        char[] newValue = new char[totalSize];
+        copyValuesInto(strs, 0, newValue, 0, strs.length);
+        this.offset = 0;
+        this.count = totalSize;
+        this.value = newValue;
+    }
+
+    /**
+     * Creates a new String from two.
+     * with the same result as "new StringBuilder().append(str0).append(str1).toString()".
+     * 
+     * This is actually an optimized specialization of the
+     * <code>public String(String...)</code> constructor.
+     * 
+     * @param str0      
+     * @param str1      
+     */
+    public String(String str0, String str1) {
+        if (str0==null) str0 = "null";
+        if (str1==null) str1 = "null";
+        // 1. Calculates the needed array length...
+        int str0Count = str0.count;
+        int str1Count = str1.count;
+        int totalSize = str0Count + str1Count;
+        // 2. ...And copies the char[] values
+        char[] newValue = new char[totalSize];
+        System.arraycopy(str0.value, str0.offset, newValue, 0, str0Count);
+        System.arraycopy(str1.value, str1.offset, newValue, str0Count, str1Count);
+        this.offset = 0;
+        this.count = totalSize;
+        this.value = newValue;
+    }
+
+    /**
+     * This is actually an optimized specialization of the
+     * <code>public String(String...)</code> constructor.
+     */
+    public String(String str0, String str1, String str2) {
+        if (str0==null) str0 = "null";
+        if (str1==null) str1 = "null";
+        if (str2==null) str2 = "null";
+        // 1. Calculates the needed array length...
+        int str0Count = str0.count;
+        int str1Count = str1.count;
+        int str2Count = str2.count;
+        int totalSize = str0Count + str1Count + str2Count;
+        // 2. ...And copies the char[] values
+        char[] newValue = new char[totalSize];
+        System.arraycopy(str0.value, str0.offset, newValue, 0, str0Count);
+        System.arraycopy(str1.value, str1.offset, newValue, str0Count, str1Count);
+        System.arraycopy(str2.value, str2.offset, newValue, str1Count, str2Count);
+        this.offset = 0;
+        this.count = totalSize;
+        this.value = newValue;
+    }
+    
+    /**
+     * This is actually an optimized specialization of the
+     * <code>public String(String...)</code> constructor.
+     */
+    public String(String str0, String str1, String str2, String str3) {
+        if (str0==null) str0 = "null";
+        if (str1==null) str1 = "null";
+        if (str2==null) str2 = "null";
+        if (str3==null) str3 = "null";
+        // 1. Calculates the needed array length...
+        int str0Count = str0.count;
+        int str1Count = str1.count;
+        int str2Count = str2.count;
+        int str3Count = str3.count;
+        int totalSize = str0Count + str1Count + str2Count + str3Count;
+        // 2. ...And copies the char[] values
+        char[] newValue = new char[totalSize];
+        System.arraycopy(str0.value, str0.offset, newValue, 0, str0Count);
+        System.arraycopy(str1.value, str1.offset, newValue, str0Count, str1Count);
+        System.arraycopy(str2.value, str2.offset, newValue, str1Count, str2Count);
+        System.arraycopy(str3.value, str3.offset, newValue, str2Count, str3Count);
+        this.offset = 0;
+        this.count = totalSize;
+        this.value = newValue;
+    }
+    
+    /**
+     * To be used by String(String...) constructor and by StringAppender.toString()
+     * 
+     * @param strs  Precondition: (strs!=null)
+     * @param dst   Precondition: (dst!=null) && (dst.length is enought)
+     * @param dstBegin 
+     */
+    static void copyValuesInto(String[] strs, int srcBegin, char[] dst, int dstBegin, int numStrs) {
+        int pos = dstBegin;
+        for (int i=srcBegin; i<numStrs; i++) {
+            String str = strs[i];
+            if (str!=null) {
+                int strCount = str.count;
+                System.arraycopy(str.value, str.offset, dst, pos, strCount);
+                pos += strCount;
+            }
+            else {
+                System.arraycopy("null".value, 0, dst, pos, 4);
+                pos += 4;
+            }
+        }
+    }
+    
 
 }
