Buggy code:
public class GlobalOperationHandlers { public static final OperationStepHandler READ_RESOURCE = new GlobalOperationHandlers . ReadResourceHandler ( ) ; public static final OperationStepHandler READ_ATTRIBUTE = new GlobalOperationHandlers . ReadAttributeHandler ( ) ; public static final OperationStepHandler READ_CHILDREN_NAMES = new GlobalOperationHandlers . ReadChildrenNamesOperationHandler ( ) ; public static final OperationStepHandler READ_CHILDREN_RESOURCES = new GlobalOperationHandlers . ReadChildrenResourcesOperationHandler ( ) ; public static final OperationStepHandler WRITE_ATTRIBUTE = new GlobalOperationHandlers . WriteAttributeHandler ( ) ; private GlobalOperationHandlers ( ) { } public static class ReadResourceHandler extends GlobalOperationHandlers . AbstractMultiTargetHandler implements OperationStepHandler { private final ParametersValidator validator = new ParametersValidator ( ) ; public ReadResourceHandler ( ) { } @ Override public void doExecute ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; final String opName = operation . require ( OP ) . asString ( ) ; final ModelNode opAddr = operation . get ( OP_ADDR ) ; final PathAddress address = PathAddress . pathAddress ( opAddr ) ; final boolean recursive = operation . get ( RECURSIVE ) . asBoolean ( false ) ; final boolean queryRuntime = ( ! recursive ) && ( operation . get ( INCLUDE_RUNTIME ) . asBoolean ( false ) ) ; final boolean proxies = operation . get ( PROXIES ) . asBoolean ( false ) ; final Map < String , ModelNode > directAttributes = new HashMap < String , ModelNode > ( ) ; final Map < String , ModelNode > directChildren = new HashMap < String , ModelNode > ( ) ; final Map < String , ModelNode > metrics = ( queryRuntime ) ? new HashMap < String , ModelNode > ( ) : Collections . < String , ModelNode > emptyMap ( ) ; final Map < String , ModelNode > otherAttributes = new HashMap < String , ModelNode > ( ) ; final Map < PathElement , ModelNode > childResources = ( recursive ) ? new HashMap < PathElement , ModelNode > ( ) : Collections . < PathElement , ModelNode > emptyMap ( ) ; final GlobalOperationHandlers . ReadResourceAssemblyHandler assemblyHandler = new GlobalOperationHandlers . ReadResourceAssemblyHandler ( directAttributes , metrics , otherAttributes , directChildren , childResources ) ; <START_BUG> context . addStep ( assemblyHandler , IMMEDIATE ) ; <END_BUG> final ImmutableManagementResourceRegistration registry = context . getResourceRegistration ( ) ; final Resource resource = context . readResource ( EMPTY_ADDRESS ) ; final ModelNode model = resource . getModel ( ) ; final Map < String , Set < String > > childrenByType = ( registry != null ) ? GlobalOperationHandlers . getChildAddresses ( registry , resource , null ) : Collections . < String , Set < String > > emptyMap ( ) ; if ( model . isDefined ( ) ) { for ( String key : model . keys ( ) ) { if ( ! ( childrenByType . containsKey ( key ) ) ) { directAttributes . put ( key , model . get ( key ) ) ; } } } for ( Map . Entry < String , Set < String > > entry : childrenByType . entrySet ( ) ) { String childType = entry . getKey ( ) ; Set < String > children = entry . getValue ( ) ; if ( children . isEmpty ( ) ) { directAttributes . put ( childType , new ModelNode ( ) ) ; } else { for ( String child : children ) { boolean storeDirect = ! recursive ; if ( recursive ) { PathElement childPE = PathElement . pathElement ( childType , child ) ; PathAddress relativeAddr = PathAddress . pathAddress ( childPE ) ; ImmutableManagementResourceRegistration childReg = registry . getSubModel ( relativeAddr ) ; if ( childReg == null ) { throw new OperationFailedException ( new ModelNode ( ) . set ( String . format ( "no<seq2seq4repair_space>child<seq2seq4repair_space>registry<seq2seq4repair_space>for<seq2seq4repair_space>(%s,<seq2seq4repair_space>%s)" , childType , child ) ) ) ; } if ( ( childReg . isRuntimeOnly ( ) ) && ( ( ! proxies ) || ( ! ( childReg . isRemote ( ) ) ) ) ) { storeDirect = true ; } else { ModelNode rrOp = new ModelNode ( ) ; rrOp . get ( OP ) . set ( opName ) ; rrOp . get ( OP_ADDR ) . set ( PathAddress . pathAddress ( address , childPE ) . toModelNode ( ) ) ; rrOp . get ( RECURSIVE ) . set ( true ) ; rrOp . get ( PROXIES ) . set ( proxies ) ; rrOp . get ( INCLUDE_RUNTIME ) . set ( queryRuntime ) ; ModelNode rrRsp = new ModelNode ( ) ; childResources . put ( childPE , rrRsp ) ; OperationStepHandler rrHandler = childReg . getOperationHandler ( relativeAddr , opName ) ; context . addStep ( rrRsp , rrOp , rrHandler , IMMEDIATE ) ; } } if ( storeDirect ) { ModelNode childMap = directChildren . get ( childType ) ; if ( childMap == null ) { childMap = new ModelNode ( ) ; childMap . setEmptyObject ( ) ; directChildren . put ( childType , childMap ) ; } childMap . get ( child ) ; } } } } final Set < String > attributeNames = ( registry != null ) ? registry . getAttributeNames ( EMPTY_ADDRESS ) : Collections . < String > emptySet ( ) ; for ( final String attributeName : attributeNames ) { final AttributeAccess access = registry . getAttributeAccess ( EMPTY_ADDRESS , attributeName ) ; if ( access == null ) { continue ; } else { final AttributeAccess . Storage storage = access . getStorageType ( ) ; if ( ( ! queryRuntime ) && ( storage != ( Storage . CONFIGURATION ) ) ) { continue ; } final AccessType type = access . getAccessType ( ) ; final OperationStepHandler handler = access . getReadHandler ( ) ; if ( handler != null ) { directAttributes . remove ( attributeName ) ;

Fix:
context . addStep ( assemblyHandler , ( queryRuntime ? Stage . VERIFY : Stage . IMMEDIATE ) ) ;