@@ -0,0 +1,2253 @@
+/*%0A * Copyright (C) 2010 The Android Open Source Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage libcore.internal;%0A%0A// todo: include this class in the android-luni jar and remove from here.%0A/**%0A * A pool of string instances. Unlike the %7B@link String#intern() VM's%0A * interned strings%7D, this pool provides no guarantee of reference equality.%0A * It is intended only to save allocations. This class is not thread safe.%0A */%0Apublic final class StringPool %7B%0A%0A    private final String%5B%5D pool = new String%5B512%5D;%0A%0A    private static boolean contentEquals(String s, char%5B%5D chars, int start, int length) %7B%0A        if (s.length() != length) %7B%0A            return false;%0A        %7D%0A        for (int i = 0; i %3C length; i++) %7B%0A            if (chars%5Bstart + i%5D != s.charAt(i)) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;%0A    %7D%0A%0A    /**%0A     * Returns a string equal to %7B@code new String(array, start, length)%7D.%0A     */%0A    public String get(char%5B%5D array, int start, int length) %7B%0A        // Compute an arbitrary hash of the content%0A        int hashCode = 0;%0A        for (int i = start; i %3C start + length; i++) %7B%0A            hashCode = (hashCode * 31) + array%5Bi%5D;%0A        %7D%0A%0A        // Pick a bucket using Doug Lea's supplemental secondaryHash function (from HashMap)%0A        hashCode %5E= (hashCode %3E%3E%3E 20) %5E (hashCode %3E%3E%3E 12);%0A        hashCode %5E= (hashCode %3E%3E%3E 7) %5E (hashCode %3E%3E%3E 4);%0A        int index = hashCode & (pool.length - 1);%0A%0A        String pooled = pool%5Bindex%5D;%0A        if (pooled != null && contentEquals(pooled, array, start, length)) %7B%0A            return pooled;%0A        %7D%0A%0A        String result = new String(array, start, length);%0A        pool%5Bindex%5D = result;%0A        return result;%0A    %7D%0A%7D%0A

Add libcore.internal.StringPool for now. Should add it to android-luni instead.