Buggy code:
final ModelNode model = resource . getModel ( ) ; if ( model . isDefined ( ) ) { for ( String key : model . keys ( ) ) { if ( ! ( childrenByType . containsKey ( key ) ) ) { directAttributes . put ( key , model . get ( key ) ) ; } } if ( defaults ) { final DescriptionProvider descriptionProvider = registry . getModelDescription ( EMPTY_ADDRESS ) ; final Locale locale = GlobalOperationHandlers . getLocale ( context , operation ) ; final ModelNode nodeDescription = descriptionProvider . getModelDescription ( locale ) ; if ( ( nodeDescription . isDefined ( ) ) && ( nodeDescription . hasDefined ( ATTRIBUTES ) ) ) { for ( String key : nodeDescription . get ( ATTRIBUTES ) . keys ( ) ) { if ( ( ( ( ! ( childrenByType . containsKey ( key ) ) ) && ( ( ! ( directAttributes . containsKey ( key ) ) ) || ( ! ( directAttributes . get ( key ) . isDefined ( ) ) ) ) ) && ( nodeDescription . get ( ATTRIBUTES ) . hasDefined ( key ) ) ) && ( nodeDescription . get ( ATTRIBUTES , key ) . hasDefined ( DEFAULT ) ) ) { directAttributes . put ( key , nodeDescription . get ( ATTRIBUTES , key , DEFAULT ) ) ; } } } } } if ( ! attributesOnly ) { 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 ) { 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 ( ControllerMessages . MESSAGES . noChildRegistry ( childType , child ) ) ) ; } boolean proxy = childReg . isRemote ( ) ; boolean runtimeResource = childReg . isRuntimeOnly ( ) ; boolean getChild = ( ( ! runtimeResource ) || ( queryRuntime && ( ! proxy ) ) ) || ( proxies && proxy ) ; if ( ( ! aliases ) && ( childReg . isAlias ( ) ) ) { getChild = false ; } if ( getChild ) { final int newDepth = ( recursiveDepth > 0 ) ? recursiveDepth - 1 : 0 ; ModelNode rrOp = new ModelNode ( ) ; rrOp . get ( OP ) . set ( opName ) ; rrOp . get ( OP_ADDR ) . set ( PathAddress . pathAddress ( address , childPE ) . toModelNode ( ) ) ; rrOp . get ( RECURSIVE ) . set ( operation . get ( RECURSIVE ) ) ; rrOp . get ( RECURSIVE_DEPTH ) . set ( newDepth ) ; rrOp . get ( PROXIES ) . set ( proxies ) ; rrOp . get ( INCLUDE_RUNTIME ) . set ( queryRuntime ) ; rrOp . get ( INCLUDE_ALIASES ) . set ( aliases ) ; ModelNode rrRsp = new ModelNode ( ) ; childResources . put ( childPE , rrRsp ) ; OperationStepHandler rrHandler = childReg . getOperationHandler ( EMPTY_ADDRESS , opName ) ; context . addStep ( rrRsp , rrOp , rrHandler , IMMEDIATE ) ; } } else { 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 ) ; <START_BUG> if ( access == null ) { <END_BUG> 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 ) ; final ModelNode attributeOperation = new ModelNode ( ) ; attributeOperation . get ( OP_ADDR ) . set ( opAddr ) ; attributeOperation . get ( OP ) . set ( READ_ATTRIBUTE_OPERATION ) ; attributeOperation . get ( NAME ) . set ( attributeName ) ; final ModelNode attrResponse = new ModelNode ( ) ; if ( type == ( AccessType . METRIC ) ) { metrics . put ( attributeName , attrResponse ) ; } else { otherAttributes . put ( attributeName , attrResponse ) ; } context . addStep ( attrResponse , attributeOperation , handler , IMMEDIATE ) ; } } } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } private static Resource nullSafeReadResource ( final OperationContext context , final ImmutableManagementResourceRegistration registry ) { } } private static class ReadResourceAssemblyHandler implements OperationStepHandler { private final Map < String , ModelNode > directAttributes ; private final Map < String , ModelNode > directChildren ; private final Map < String , ModelNode > metrics ;

Fix:
if ( ( access == null ) || ( ( access . getFlags ( ) . contains ( ALIAS ) ) && ( ! aliases ) ) ) {