public boolean setVariable ( Object key , Object value ) { boolean success = false ; Object object = null ; for ( int i = working . size ( ) - 1 ; i >= 0 ; -- i ) { Map < Object , Object > map = working . get ( i ) ; object = map . get ( key ) ; if ( object != null ) { map . put ( key , value ) ; success = true ; break ; } } if ( ! success ) { object = global . get ( key ) ; if ( object != null ) { global . put ( key , value ) ; success = true ; } } return success ; }
set an already defined variable first from the highest block hierarchy down to the global variables .