Buggy code:
if ( conditionFieldValue instanceof String ) conditionFieldValue = OStringSerializerHelper . getStringContent ( conditionFieldValue ) ; final Object fieldValue = map . get ( 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 ( OMultiValue . isMultiValue ( value ) ) { final Object index = ODocumentHelper . getIndexPart ( iContext , indexPart ) ; final String indexAsString = ( index != null ) ? index . toString ( ) : null ; final List < String > indexParts = OStringSerializerHelper . smartSplit ( indexAsString , ',' ) ; final List < String > indexRanges = OStringSerializerHelper . smartSplit ( indexAsString , '-' ) ; final List < String > indexCondition = OStringSerializerHelper . smartSplit ( indexAsString , '=' , '<seq2seq4repair_space>' ) ; if ( ( ( ( indexParts . size ( ) ) == 1 ) && ( ( indexRanges . size ( ) ) == 1 ) ) && ( ( indexCondition . size ( ) ) == 1 ) ) { if ( value instanceof Map < ? , ? > ) value = ODocumentHelper . getMapEntry ( ( ( Map < String , ? > ) ( value ) ) , index ) ; else if ( Character . isDigit ( indexAsString . charAt ( 0 ) ) ) value = OMultiValue . getValue ( value , Integer . parseInt ( indexAsString ) ) ; else value = ODocumentHelper . getFieldValue ( value , indexAsString , iContext ) ; } else if ( ( indexParts . size ( ) ) > 1 ) { final Object [ ] values = new Object [ indexParts . size ( ) ] ; for ( int i = 0 ; i < ( indexParts . size ( ) ) ; ++ i ) values [ i ] = OMultiValue . getValue ( value , Integer . parseInt ( indexParts . get ( i ) ) ) ; value = values ; } else if ( ( indexRanges . size ( ) ) > 1 ) { String from = indexRanges . get ( 0 ) ; String to = indexRanges . get ( 1 ) ; final int rangeFrom = ( ( from != null ) && ( ! ( from . isEmpty ( ) ) ) ) ? Integer . parseInt ( from ) : 0 ; final int rangeTo = ( ( to != null ) && ( ! ( to . isEmpty ( ) ) ) ) ? Math . min ( Integer . parseInt ( to ) , ( ( OMultiValue . getSize ( value ) ) - 1 ) ) : ( OMultiValue . getSize ( value ) ) - 1 ; final Object [ ] values = new Object [ ( rangeTo - rangeFrom ) + 1 ] ; for ( int i = rangeFrom ; i <= rangeTo ; ++ i ) values [ ( i - rangeFrom ) ] = OMultiValue . getValue ( value , 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 HashSet < Object > values = new HashSet < Object > ( ) ; for ( Object v : OMultiValue . getMultiValueIterable ( value ) ) { Object filtered = ODocumentHelper . filterItem ( conditionFieldName , conditionFieldValue , v ) ; if ( filtered != null ) if ( filtered instanceof Collection < ? > ) values . addAll ( ( ( Collection < ? extends Object > ) ( filtered ) ) ) ; else values . add ( filtered ) ; } if ( values . isEmpty ( ) ) <START_BUG> value = null ; <END_BUG> else if ( ( values . size ( ) ) == 1 ) value = values . iterator ( ) . next ( ) ; else value = values ; } } } else { if ( ( fieldName . length ( ) ) == 0 ) { beginPos = ++ nextSeparatorPos ; continue ; } if ( fieldName . startsWith ( "$" ) ) value = iContext . getVariable ( fieldName ) ; else if ( fieldName . contains ( "(" ) ) value = ODocumentHelper . evaluateFunction ( value , fieldName , iContext ) ; else { final List < String > indexCondition = OStringSerializerHelper . smartSplit ( fieldName , '=' , '<seq2seq4repair_space>' ) ; if ( ( indexCondition . size ( ) ) == 2 ) { final String conditionFieldName = indexCondition . get ( 0 ) ; Object conditionFieldValue = ORecordSerializerStringAbstract . getTypeValue ( indexCondition . get ( 1 ) ) ; if ( conditionFieldValue instanceof String ) conditionFieldValue = OStringSerializerHelper . getStringContent ( conditionFieldValue ) ; value = ODocumentHelper . filterItem ( conditionFieldName , conditionFieldValue , value ) ; } else if ( currentRecord != null ) { value = ODocumentHelper . getIdentifiableValue ( currentRecord , fieldName ) ; if ( ( ( value != null ) && ( value instanceof ORecord ) ) && ( ( ( ( ORecord ) ( value ) ) . getInternalStatus ( ) ) == ( STATUS . NOT_LOADED ) ) ) ( ( ORecord ) ( value ) ) . reload ( ) ; }

Fix:
value = values ;