Buggy code:
static ModelNode processSecuritySettings ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > operations ) throws XMLStreamException { } static void parseSecurityRoles ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > operations ) throws XMLStreamException { } static void processConnectors ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } static void processAddressSettings ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > operations ) throws XMLStreamException { } static ModelNode parseAddressSettings ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } static void parseTransportConfigurationParams ( final XMLExtendedStreamReader reader , final ModelNode transportConfig , final boolean generic ) throws XMLStreamException { } static void parseDirectory ( final XMLExtendedStreamReader reader , final String name , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } private static void parseDiverts ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private static void parseDivert ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } static void unhandledElement ( XMLExtendedStreamReader reader , Element element ) throws XMLStreamException { } static void handleElementText ( final XMLExtendedStreamReader reader , final Element element , final ModelNode node ) throws XMLStreamException { } static void handleElementText ( final XMLExtendedStreamReader reader , final Element element , final String modelName , final ModelNode node ) throws XMLStreamException { } @ Deprecated static void handleElementText ( final XMLExtendedStreamReader reader , final Element element , final ModelNode node , final ModelType expectedType , final boolean allowNull , final boolean allowExpression ) throws XMLStreamException { } public void writeContent ( final XMLExtendedStreamWriter writer , final SubsystemMarshallingContext context ) throws XMLStreamException { } private void writeHornetQServer ( final XMLExtendedStreamWriter writer , final String serverName , final ModelNode node ) throws XMLStreamException { } private void writeConnectorServices ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } private void writeBridges ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } private void writeClusterConnections ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } private void writeGroupingHandler ( XMLExtendedStreamWriter writer , ModelNode node ) throws XMLStreamException { } static void writeAcceptors ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } static void writeConnectors ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } static void writeAcceptorAndConnectorContent ( final XMLExtendedStreamWriter writer , final Property property ) throws XMLStreamException { } private void writeSecuritySettings ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writePermission ( final XMLExtendedStreamWriter writer , final String type , final List < String > roles ) throws XMLStreamException { } private void writeAddressSettings ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeQueues ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeBroadcastGroups ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeDiscoveryGroups ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeDiverts ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeFilter ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } static void writeSimpleElement ( final XMLExtendedStreamWriter writer , final Element element , final ModelNode node ) throws XMLStreamException { } static void writeDirectory ( final XMLExtendedStreamWriter writer , final Element element , final ModelNode node ) throws XMLStreamException { final String localName = element . getLocalName ( ) ; if ( node . has ( localName ) ) { final String path = ( node . get ( localName ) . has ( CommonAttributes . PATH . getName ( ) ) ) ? node . get ( localName , CommonAttributes . PATH . getName ( ) ) . asString ( ) : null ; <START_BUG> final String relativeTo = ( node . get ( localName ) . has ( CommonAttributes . RELATIVE_TO . getName ( ) ) ) ? node . get ( localName , CommonAttributes . RELATIVE_TO . getName ( ) ) . asString ( ) : null ; <END_BUG> if ( ( path != null ) || ( relativeTo != null ) ) { writer . writeEmptyElement ( localName ) ; if ( path != null ) writer . writeAttribute ( CommonAttributes . PATH . getName ( ) , path ) ; if ( relativeTo != null ) writer . writeAttribute ( CommonAttributes . RELATIVE_TO . getName ( ) , relativeTo ) ; } } } private void writeConnectionFactories ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writePooledConnectionFactories ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeConnectionFactory ( XMLExtendedStreamWriter writer , String name , ModelNode factory ) throws XMLStreamException { } private void writeJmsQueues ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeTopics ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } private void writeTransactionTypeAttribute ( final XMLExtendedStreamWriter writer , final Element attr , final ModelNode value ) throws XMLStreamException { } static void writeAttribute ( final XMLExtendedStreamWriter writer , final Attribute attr , final ModelNode value ) throws XMLStreamException { } static void processJMSTopic ( final XMLExtendedStreamReader reader , ModelNode address , List < ModelNode > updates ) throws XMLStreamException { } static void processJMSQueue ( final XMLExtendedStreamReader reader , ModelNode address , List < ModelNode > updates ) throws XMLStreamException { } static void processConnectionFactory ( final XMLExtendedStreamReader reader , ModelNode address , List < ModelNode > updates ) throws XMLStreamException { } static void processPooledConnectionFactory ( final XMLExtendedStreamReader reader , ModelNode address , List < ModelNode > updates ) throws XMLStreamException { }

Fix:
final String relativeTo = ( node . get ( localName ) . hasDefined ( CommonAttributes . RELATIVE_TO . getName ( ) ) ) ? node . get ( localName , CommonAttributes . RELATIVE_TO . getName ( ) ) . asString ( ) : null ;