AbstractInternationalString changes for revisions 7711:7712

Those changes were done in a common ancestor of AbstractInternationalString and DefaultInternationalString. Only the first block of changes apply to AbstractInternationalString. This change has been reverted.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r7711:7712 https://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/util/AbstractInternationalString.java
Revision 7711Revision 7712
 * @return The string in the specified locale, or in a default locale.
 */
public String toString(Locale locale) {
    while (locale != null) {
        final String text = (String) localMap.get(locale);
        if (text != null) {
            return text;
        }
 * @return The string in the specified locale, or in a default locale.
 */
public String toString(Locale locale) {
    String text = null;
    while (locale != null) {
        text = (String) localMap.get(locale);
        if (text != null) {
            return text;
        }
    }
    break;
}
// Try the string in the 'null' locale.
final String text = (String) localMap.get(null);
if (text == null) {
    // No 'null' locale neither. Returns the first string in whatever locale.
    final Iterator it = localMap.values().iterator();
    }
    break;
}

// Try an Empty Locale
locale = new Locale( "", "", "" ); // IdentifiedObject does this to us
text = (String) localMap.get(locale);
if (text != null) {
    return text;
}

// Try the string in the 'null' locale.
text = (String) localMap.get(null);
if (text == null) {
    // No 'null' locale neither. Returns the first string in whatever locale.
    final Iterator it = localMap.values().iterator();
            // For now, we do not apply this operation on singleton map since they are immutable.
            final Map.Entry[] entries;
            entries = (Map.Entry[]) localMap.entrySet().toArray(new Map.Entry[localMap.size()]);
            localMap.clear();
            for (int i=0; i<entries.length; i++) {
                final Map.Entry entry = entries[i];
                localMap.put(canonicalize((Locale)entry.getKey()), entry.getValue());
            }
        }
    }
}
            // For now, we do not apply this operation on singleton map since they are immutable.
            final Map.Entry[] entries;
            entries = (Map.Entry[]) localMap.entrySet().toArray(new Map.Entry[localMap.size()]);
            localMap = new HashMap(); //TODO: Used to be localMap.clear() to recover space
            for (int i=0; i<entries.length; i++) {
                final Map.Entry entry = entries[i];
                localMap.put(canonicalize((Locale)entry.getKey()), entry.getValue());
            }
        }
    }
}