Buggy code:
public class HostXml extends CommonXml { public HostXml ( final ModuleLoader loader ) { } @ Override public void readElement ( final XMLExtendedStreamReader reader , final List < ModelNode > operationList ) throws XMLStreamException { } @ Override public void writeContent ( final XMLExtendedStreamWriter writer , final ModelMarshallingContext context ) throws XMLStreamException { } private void readHostElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void addLocalHost ( final ModelNode address , final List < ModelNode > operationList , final String hostName ) { } private void parseDomainController ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void parseRemoteDomainController ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void parseJvms ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void parseServers ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void parseServer ( final XMLExtendedStreamReader reader , final ModelNode parentAddress , final List < ModelNode > list , final Set < String > serverNames ) throws XMLStreamException { } private void writeDomainController ( final XMLExtendedStreamWriter writer , final ModelNode modelNode ) throws XMLStreamException { } private void writeServers ( final XMLExtendedStreamWriter writer , final ModelNode modelNode ) throws XMLStreamException { writer . writeStartElement ( SERVERS . getLocalName ( ) ) ; for ( Property prop : modelNode . asPropertyList ( ) ) { final ModelNode server = prop . getValue ( ) ; writer . writeStartElement ( SERVER . getLocalName ( ) ) ; writeAttribute ( writer , NAME , prop . getName ( ) ) ; if ( server . hasDefined ( GROUP ) ) { writeAttribute ( writer , Attribute . GROUP , server . get ( GROUP ) . asString ( ) ) ; } if ( server . hasDefined ( AUTO_START ) ) { writeAttribute ( writer , Attribute . AUTO_START , server . get ( AUTO_START ) . asString ( ) ) ; } if ( server . hasDefined ( PATH ) ) { writePaths ( writer , server . get ( PATH ) ) ; } if ( server . hasDefined ( SYSTEM_PROPERTY ) ) { writeProperties ( writer , server . get ( SYSTEM_PROPERTY ) , SYSTEM_PROPERTIES , false ) ; } if ( server . hasDefined ( INTERFACE ) ) { writeInterfaces ( writer , server . get ( INTERFACE ) ) ; } if ( server . hasDefined ( JVM ) ) { for ( final Property jvm : server . get ( JVM ) . asPropertyList ( ) ) { writeJVMElement ( writer , jvm . getName ( ) , jvm . getValue ( ) ) ; break ; } } if ( server . hasDefined ( SOCKET_BINDING_GROUP ) ) { writer . writeStartElement ( Element . SOCKET_BINDING_GROUP . getLocalName ( ) ) ; writeAttribute ( writer , REF , server . get ( SOCKET_BINDING_GROUP ) . asString ( ) ) ; <START_BUG> if ( server . has ( SOCKET_BINDING_PORT_OFFSET ) ) { <END_BUG> writeAttribute ( writer , PORT_OFFSET , server . get ( SOCKET_BINDING_PORT_OFFSET ) . asString ( ) ) ; } writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; } }

Fix:
if ( ( server . hasDefined ( SOCKET_BINDING_PORT_OFFSET ) ) && ( ( server . get ( SOCKET_BINDING_PORT_OFFSET ) . asInt ( ) ) > 0 ) ) {