Buggy code:
public class ORuntimeResult { private final Object fieldValue ; private final Map < String , Object > projections ; private final ODocument value ; private OCommandContext context ; public ORuntimeResult ( final Object iFieldValue , final Map < String , Object > iProjections , final int iProgressive , final OCommandContext iContext ) { } public static ODocument createProjectionDocument ( final int iProgressive ) { } @ SuppressWarnings ( "unchecked" ) public static ODocument applyRecord ( final ODocument iValue , final Map < String , Object > iProjections , final OCommandContext iContext , final OIdentifiable iRecord ) { final ODocument inputDocument = ( ( ODocument ) ( ( iRecord != null ) ? iRecord . getRecord ( ) : null ) ) ; if ( iProjections . isEmpty ( ) ) inputDocument . copyTo ( iValue ) ; else { for ( Map . Entry < String , Object > projection : iProjections . entrySet ( ) ) { final String prjName = projection . getKey ( ) ; final Object v = projection . getValue ( ) ; if ( v == null ) continue ; final Object projectionValue ; if ( v . equals ( "*" ) ) { inputDocument . copyTo ( iValue ) ; projectionValue = null ; } else if ( ( v instanceof OSQLFilterItemVariable ) || ( v instanceof OSQLFilterItemField ) ) { final OSQLFilterItemAbstract var = ( ( OSQLFilterItemAbstract ) ( v ) ) ; final OPair < OSQLMethodRuntime , Object [ ] > last = var . getLastChainOperator ( ) ; if ( ( ( ( ( last != null ) && ( ( last . getKey ( ) . getMethod ( ) ) instanceof OSQLMethodField ) ) && ( ( last . getValue ( ) ) != null ) ) && ( ( last . getValue ( ) . length ) == 1 ) ) && ( last . getValue ( ) [ 0 ] . equals ( "*" ) ) ) { final Object value = ( ( OSQLFilterItemAbstract ) ( v ) ) . getValue ( inputDocument , iValue , iContext ) ; if ( ( ( ( inputDocument != null ) && ( value != null ) ) && ( inputDocument instanceof ODocument ) ) && ( value instanceof ODocument ) ) { for ( String fieldName : ( ( ODocument ) ( value ) ) . fieldNames ( ) ) { <START_BUG> iValue . field ( ( ( prjName + "_" ) + fieldName ) , ( ( ODocument ) ( value ) ) . field ( fieldName ) ) ; <END_BUG> } } projectionValue = null ; } else projectionValue = ( ( OSQLFilterItemAbstract ) ( v ) ) . getValue ( inputDocument , iValue , iContext ) ; } else if ( v instanceof OSQLFunctionRuntime ) { final OSQLFunctionRuntime f = ( ( OSQLFunctionRuntime ) ( v ) ) ; projectionValue = f . execute ( inputDocument , inputDocument , iValue , iContext ) ; } else projectionValue = v ; if ( projectionValue != null ) if ( projectionValue instanceof ORidBag ) iValue . field ( prjName , new ORidBag ( ( ( ORidBag ) ( projectionValue ) ) ) ) ; else if ( ( ( projectionValue instanceof OIdentifiable ) && ( ! ( projectionValue instanceof ORID ) ) ) && ( ! ( projectionValue instanceof ORecord ) ) ) iValue . field ( prjName , ( ( OIdentifiable ) ( projectionValue ) ) . getRecord ( ) ) ; else if ( projectionValue instanceof Iterator ) { boolean link = true ; if ( projectionValue instanceof OResettable ) ( ( OResettable ) ( projectionValue ) ) . reset ( ) ; final List < Object > iteratorValues = new ArrayList < Object > ( ) ; final Iterator projectionValueIterator = ( ( Iterator ) ( projectionValue ) ) ; while ( projectionValueIterator . hasNext ( ) ) { Object value = projectionValueIterator . next ( ) ; if ( value instanceof OIdentifiable ) { value = ( ( OIdentifiable ) ( value ) ) . getRecord ( ) ; if ( ! ( ( ( OIdentifiable ) ( value ) ) . getIdentity ( ) . isPersistent ( ) ) ) link = false ; } if ( value != null ) iteratorValues . add ( value ) ; } iValue . field ( prjName , iteratorValues , ( link ? OType . LINKLIST : OType . EMBEDDEDLIST ) ) ; } else if ( ( projectionValue instanceof ODocument ) && ( ! ( ( ( ODocument ) ( projectionValue ) ) . getIdentity ( ) . isPersistent ( ) ) ) ) { iValue . field ( prjName , projectionValue , EMBEDDED ) ; } else if ( projectionValue instanceof Set < ? > ) { OType type = OType . getTypeByValue ( projectionValue ) ; if ( ( type == ( OType . LINKSET ) ) && ( ! ( ORuntimeResult . entriesPersistent ( ( ( Collection < OIdentifiable > ) ( projectionValue ) ) ) ) ) ) type = OType . EMBEDDEDSET ; iValue . field ( prjName , projectionValue , type ) ; } else if ( projectionValue instanceof Map < ? , ? > ) { OType type = OType . getTypeByValue ( projectionValue ) ; if ( ( type == ( OType . LINKMAP ) ) && ( ! ( ORuntimeResult . entriesPersistent ( ( ( Map < ? , OIdentifiable > ) ( projectionValue ) ) . values ( ) ) ) ) ) type = OType . EMBEDDEDMAP ; iValue . field ( prjName , projectionValue , type ) ; } else if ( projectionValue instanceof List < ? > ) { OType type = OType . getTypeByValue ( projectionValue ) ;

Fix:
iValue . field ( ( prjName + fieldName ) , ( ( ODocument ) ( value ) ) . field ( fieldName ) ) ;