Buggy code:
class RemotingSubsystem11Parser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { static final RemotingSubsystem11Parser INSTANCE = new RemotingSubsystem11Parser ( ) ; @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } void parseWorkerThreadPool ( final XMLExtendedStreamReader reader , final ModelNode subsystemAdd ) throws XMLStreamException { } void parseConnector ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } void parseSaslElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } ModelNode parsePolicyElement ( XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void parseProperties ( XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void parseOutboundConnections ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > operations ) throws XMLStreamException { } private void parseRemoteOutboundConnection ( final XMLExtendedStreamReader reader , final ModelNode parentAddress , final List < ModelNode > operations ) throws XMLStreamException { final EnumSet < Attribute > required = EnumSet . of ( NAME , OUTBOUND_SOCKET_BINDING_REF ) ; final int count = reader . getAttributeCount ( ) ; String name = null ; String outboundSocketBindingRef = null ; ModelNode username = null ; String securityRealm = null ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; required . remove ( attribute ) ; switch ( attribute ) { case NAME : { name = value ; break ; } case CommonAttributes . OUTBOUND_SOCKET_BINDING_REF : { outboundSocketBindingRef = value ; break ; } case USERNAME : { <START_BUG> username = USERNAME . parse ( value , reader . getLocation ( ) ) ; <END_BUG> break ; } case CommonAttributes . SECURITY_REALM : { securityRealm = value ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } if ( ! ( required . isEmpty ( ) ) ) { throw missingRequired ( reader , required ) ; } final PathAddress address = PathAddress . pathAddress ( PathAddress . pathAddress ( parentAddress ) , PathElement . pathElement ( REMOTE_OUTBOUND_CONNECTION , name ) ) ; operations . add ( RemotingSubsystem11Parser . getConnectionAddOperation ( name , outboundSocketBindingRef , username , securityRealm , address ) ) ; final EnumSet < Element > visited = EnumSet . noneOf ( Element . class ) ; while ( ( reader . hasNext ( ) ) && ( ( reader . nextTag ( ) ) != ( XMLStreamConstants . END_ELEMENT ) ) ) { final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( visited . contains ( element ) ) { throw ParseUtils . unexpectedElement ( reader ) ; } visited . add ( element ) ; switch ( element ) { case PROPERTIES : { parseProperties ( reader , address . toModelNode ( ) , operations ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } } } private void parseLocalOutboundConnection ( final XMLExtendedStreamReader reader , final ModelNode parentAddress , final List < ModelNode > operations ) throws XMLStreamException { } private void parseOutboundConnection ( final XMLExtendedStreamReader reader , final ModelNode parentAddress , final List < ModelNode > operations ) throws XMLStreamException { } static ModelNode getConnectionAddOperation ( final String connectionName , final String outboundSocketBindingRef , PathAddress address ) { } static ModelNode getConnectionAddOperation ( final String connectionName , final String outboundSocketBindingRef , final ModelNode userName , final String securityRealm , PathAddress address ) { } @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } private void writeWorkerThreadPoolIfAttributesSet ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeConnector ( final XMLExtendedStreamWriter writer , final ModelNode node , final String name ) throws XMLStreamException { } private void writeProperties ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeSasl ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writePolicy ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeOutboundConnection ( final XMLExtendedStreamWriter writer , final String connectionName , final ModelNode model ) throws XMLStreamException { } private void writeRemoteOutboundConnection ( final XMLExtendedStreamWriter writer , final String connectionName , final ModelNode model ) throws XMLStreamException { } private void writeLocalOutboundConnection ( final XMLExtendedStreamWriter writer , final String connectionName , final ModelNode model ) throws XMLStreamException { } }

Fix:
username = USERNAME . parse ( value , reader ) ;