Buggy code:
final List < String > indexParts = OStringSerializerHelper . smartSplit ( indexAsString , ',' , DEFAULT_IGNORE_CHARS ) ; final List < String > indexRanges = OStringSerializerHelper . smartSplit ( indexAsString , '-' , '<seq2seq4repair_space>' ) ; final List < String > indexCondition = OStringSerializerHelper . smartSplit ( indexAsString , '=' , '<seq2seq4repair_space>' ) ; if ( ( ( ( indexParts . size ( ) ) == 1 ) && ( ( indexCondition . size ( ) ) == 1 ) ) && ( ( indexRanges . size ( ) ) == 1 ) ) value = ( ( ODocument ) ( record ) ) . field ( indexAsString ) ; else if ( ( indexParts . size ( ) ) > 1 ) { final Object [ ] values = new Object [ indexParts . size ( ) ] ; for ( int i = 0 ; i < ( indexParts . size ( ) ) ; ++ i ) { values [ i ] = ( ( ODocument ) ( record ) ) . field ( OStringSerializerHelper . getStringContent ( indexParts . get ( i ) ) ) ; } value = values ; } else if ( ( indexRanges . size ( ) ) > 1 ) { String from = indexRanges . get ( 0 ) ; String to = indexRanges . get ( 1 ) ; final ODocument doc = ( ( ODocument ) ( record ) ) ; final String [ ] fieldNames = doc . fieldNames ( ) ; final int rangeFrom = ( ( from != null ) && ( ! ( from . isEmpty ( ) ) ) ) ? Integer . parseInt ( from ) : 0 ; final int rangeTo = ( ( to != null ) && ( ! ( to . isEmpty ( ) ) ) ) ? Math . min ( Integer . parseInt ( to ) , ( ( fieldNames . length ) - 1 ) ) : ( fieldNames . length ) - 1 ; final Object [ ] values = new Object [ ( rangeTo - rangeFrom ) + 1 ] ; for ( int i = rangeFrom ; i <= rangeTo ; ++ i ) values [ ( i - rangeFrom ) ] = doc . field ( fieldNames [ i ] ) ; value = values ; } else if ( ! ( indexCondition . isEmpty ( ) ) ) { final String conditionFieldName = indexCondition . get ( 0 ) ; Object conditionFieldValue = ORecordSerializerStringAbstract . getTypeValue ( indexCondition . get ( 1 ) ) ; if ( conditionFieldValue instanceof String ) conditionFieldValue = OStringSerializerHelper . getStringContent ( conditionFieldValue ) ; final Object fieldValue = ODocumentHelper . getFieldValue ( currentRecord , conditionFieldName ) ; if ( ( conditionFieldValue != null ) && ( fieldValue != null ) ) conditionFieldValue = OType . convert ( conditionFieldValue , fieldValue . getClass ( ) ) ; if ( ( ( fieldValue == null ) && ( ! ( conditionFieldValue . equals ( "null" ) ) ) ) || ( ( fieldValue != null ) && ( ! ( fieldValue . equals ( conditionFieldValue ) ) ) ) ) value = null ; } } else if ( value instanceof Map < ? , ? > ) { final Object index = ODocumentHelper . getIndexPart ( iContext , indexPart ) ; final String indexAsString = ( index != null ) ? index . toString ( ) : null ; final List < String > indexParts = OStringSerializerHelper . smartSplit ( indexAsString , ',' , DEFAULT_IGNORE_CHARS ) ; final List < String > indexRanges = OStringSerializerHelper . smartSplit ( indexAsString , '-' , '<seq2seq4repair_space>' ) ; final List < String > indexCondition = OStringSerializerHelper . smartSplit ( indexAsString , '=' , '<seq2seq4repair_space>' ) ; final Map < String , ? > map = ( ( Map < String , ? > ) ( value ) ) ; if ( ( ( ( indexParts . size ( ) ) == 1 ) && ( ( indexCondition . size ( ) ) == 1 ) ) && ( ( indexRanges . size ( ) ) == 1 ) ) <START_BUG> value = map . get ( indexAsString ) ; <END_BUG> else if ( ( indexParts . size ( ) ) > 1 ) { final Object [ ] values = new Object [ indexParts . size ( ) ] ; for ( int i = 0 ; i < ( indexParts . size ( ) ) ; ++ i ) { values [ i ] = map . get ( OStringSerializerHelper . getStringContent ( indexParts . get ( i ) ) ) ; } value = values ; } else if ( ( indexRanges . size ( ) ) > 1 ) { String from = indexRanges . get ( 0 ) ; String to = indexRanges . get ( 1 ) ; final List < String > fieldNames = new ArrayList < String > ( map . keySet ( ) ) ; final int rangeFrom = ( ( from != null ) && ( ! ( from . isEmpty ( ) ) ) ) ? Integer . parseInt ( from ) : 0 ; final int rangeTo = ( ( to != null ) && ( ! ( to . isEmpty ( ) ) ) ) ? Math . min ( Integer . parseInt ( to ) , ( ( fieldNames . size ( ) ) - 1 ) ) : ( fieldNames . size ( ) ) - 1 ; final Object [ ] values = new Object [ ( rangeTo - rangeFrom ) + 1 ] ; for ( int i = rangeFrom ; i <= rangeTo ; ++ i ) values [ ( i - rangeFrom ) ] = map . get ( fieldNames . get ( i ) ) ; value = values ; }

Fix:
value = map . get ( index ) ;