Index: lucene/src/java/org/apache/lucene/util/StringHelper.java =================================================================== --- lucene/src/java/org/apache/lucene/util/StringHelper.java (revision 1103906) +++ lucene/src/java/org/apache/lucene/util/StringHelper.java (working copy) @@ -1,5 +1,7 @@ package org.apache.lucene.util; +import java.util.concurrent.ConcurrentHashMap; + /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -29,11 +31,12 @@ * The StringInterner implementation used by Lucene. * This shouldn't be changed to an incompatible implementation after other Lucene APIs have been used. */ - public static StringInterner interner = new SimpleStringInterner(1024,8); + public static ConcurrentHashMap uniqueStrings = new ConcurrentHashMap(); /** Return the same string object for all equal strings */ public static String intern(String s) { - return interner.intern(s); + String v = uniqueStrings.putIfAbsent(s, s); + return (v != null) ? v : s; } /**