Buggy code:
class FieldCacheImpl implements FieldCache { abstract static class Cache { private final Map readerCache = new WeakHashMap ( ) ; protected abstract Object createValue ( IndexReader reader , Object key ) throws IOException { } public Object get ( IndexReader reader , Object key ) throws IOException { Map innerCache ; Object value ; synchronized ( readerCache ) { innerCache = ( ( Map ) ( readerCache . get ( reader ) ) ) ; if ( innerCache == null ) { innerCache = new HashMap ( ) ; readerCache . put ( reader , innerCache ) ; value = null ; } else { value = innerCache . get ( key ) ; } if ( value == null ) { value = new FieldCacheImpl . CreationPlaceholder ( ) ; <START_BUG> innerCache . put ( reader , value ) ; <END_BUG> } } if ( value instanceof FieldCacheImpl . CreationPlaceholder ) { synchronized ( value ) { FieldCacheImpl . CreationPlaceholder progress = ( ( FieldCacheImpl . CreationPlaceholder ) ( value ) ) ; if ( ( progress . value ) == null ) { progress . value = createValue ( reader , key ) ; synchronized ( readerCache ) { innerCache . put ( key , progress . value ) ; } } return progress . value ; } } return value ; } } static final class CreationPlaceholder { Object value ; } static class Entry { final String field ; final int type ; final Object custom ; final Locale locale ; Entry ( String field , int type , Locale locale ) { } Entry ( String field , Object custom ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } } private static final IntParser INT_PARSER = new IntParser ( ) { public int parseInt ( String value ) { } } ; private static final FloatParser FLOAT_PARSER = new FloatParser ( ) { public float parseFloat ( String value ) { } } ; public int [ ] getInts ( IndexReader reader , String field ) throws IOException { } public int [ ] getInts ( IndexReader reader , String field , IntParser parser ) throws IOException { } FieldCacheImpl . Cache intsCache = new FieldCacheImpl . Cache ( ) { protected Object createValue ( IndexReader reader , Object entryKey ) throws IOException { } } ; public float [ ] getFloats ( IndexReader reader , String field ) throws IOException { } public float [ ] getFloats ( IndexReader reader , String field , FloatParser parser ) throws IOException { } FieldCacheImpl . Cache floatsCache = new FieldCacheImpl . Cache ( ) { protected Object createValue ( IndexReader reader , Object entryKey ) throws IOException { } } ; public String [ ] getStrings ( IndexReader reader , String field ) throws IOException { } FieldCacheImpl . Cache stringsCache = new FieldCacheImpl . Cache ( ) { protected Object createValue ( IndexReader reader , Object fieldKey ) throws IOException { } } ; public StringIndex getStringIndex ( IndexReader reader , String field ) throws IOException { } FieldCacheImpl . Cache stringsIndexCache = new FieldCacheImpl . Cache ( ) { protected Object createValue ( IndexReader reader , Object fieldKey ) throws IOException { } } ; public Object getAuto ( IndexReader reader , String field ) throws IOException { } FieldCacheImpl . Cache autoCache = new FieldCacheImpl . Cache ( ) { protected Object createValue ( IndexReader reader , Object fieldKey ) throws IOException { } } ; public Comparable [ ] getCustom ( IndexReader reader , String field , SortComparator comparator ) throws IOException { } FieldCacheImpl . Cache customCache = new FieldCacheImpl . Cache ( ) { protected Object createValue ( IndexReader reader , Object entryKey ) throws IOException { } } ; }

Fix:
innerCache . put ( key , value ) ;