Buggy code:
public abstract class CommonXml implements XMLElementReader < List < ModelNode > > , XMLElementWriter < ModelMarshallingContext > { protected static final Set < String > RESTRICTED_PATHS ; private static final char [ ] NEW_LINE = new char [ ] { '\n' } ; protected CommonXml ( ) { } protected void parseNamespaces ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > nodes ) { } protected void readHeadComment ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > nodes ) throws XMLStreamException { } protected void readTailComment ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > nodes ) throws XMLStreamException { } protected void parseSchemaLocations ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > updateList , final int idx ) throws XMLStreamException { } protected void writeSchemaLocation ( final XMLExtendedStreamWriter writer , final ModelNode modelNode ) throws XMLStreamException { } protected void writeNamespaces ( final XMLExtendedStreamWriter writer , final ModelNode modelNode ) throws XMLStreamException { <START_BUG> final boolean needXsd = modelNode . hasDefined ( SCHEMA_LOCATIONS ) ; <END_BUG> final boolean hasNamepaces = modelNode . hasDefined ( NAMESPACES ) ; if ( ( ! needXsd ) && ( ! hasNamepaces ) ) { return ; } boolean wroteXsd = false ; final String xsdUri = XML_SCHEMA_INSTANCE . getUriString ( ) ; if ( hasNamepaces ) { for ( final Property property : modelNode . get ( NAMESPACES ) . asPropertyList ( ) ) { final String uri = property . getValue ( ) . asString ( ) ; writer . writeNamespace ( property . getName ( ) , uri ) ; if ( ( ! wroteXsd ) && ( xsdUri . equals ( uri ) ) ) { wroteXsd = true ; } } } if ( needXsd && ( ! wroteXsd ) ) { writer . writeNamespace ( "xsd" , xsdUri ) ; } } protected static void writeElement ( final XMLExtendedStreamWriter writer , final Element element ) throws XMLStreamException { } protected void writePaths ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { } protected void parseFSBaseType ( final XMLExtendedStreamReader reader , final ModelNode parent , final boolean isArchive ) throws XMLStreamException { } protected void parsePaths ( final XMLExtendedStreamReader reader , final ModelNode address , final Namespace expectedNs , final List < ModelNode > list , final boolean requirePath ) throws XMLStreamException { } protected void parsePath ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list , final boolean requirePath , final Set < String > defined ) throws XMLStreamException { } protected void parseSystemProperties ( final XMLExtendedStreamReader reader , final ModelNode address , final Namespace expectedNs , final List < ModelNode > updates , boolean standalone ) throws XMLStreamException { } public static ModelNode parseProperties ( final XMLExtendedStreamReader reader , final Namespace expectedNs ) throws XMLStreamException { } protected void parseInterfaceCriteria ( final XMLExtendedStreamReader reader , final Namespace expectedNs , final ModelNode interfaceModel ) throws XMLStreamException { } protected void parseCompoundInterfaceCriterion ( final XMLExtendedStreamReader reader , final Namespace expectedNs , final ModelNode subModel ) throws XMLStreamException { } protected void parseContentType ( final XMLExtendedStreamReader reader , final ModelNode parent ) throws XMLStreamException { } protected void parseSimpleInterfaceCriterion ( final XMLExtendedStreamReader reader , final ModelNode subModel , boolean nested ) throws XMLStreamException { } private void validateAddressMask ( String value , Location location ) throws XMLStreamException { } protected void parseInterfaces ( final XMLExtendedStreamReader reader , final Set < String > names , final ModelNode address , final Namespace expectedNs , final List < ModelNode > list , final boolean checkSpecified ) throws XMLStreamException { } protected void parseSocketBindingGroupRef ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } protected String parseSocketBinding ( final XMLExtendedStreamReader reader , final Set < String > interfaces , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } private ModelNode parseClientMapping ( XMLExtendedStreamReader reader ) throws XMLStreamException { } protected String parseOutboundSocketBinding ( final XMLExtendedStreamReader reader , final Set < String > interfaces , final String socketBindingGroupName , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } private void parseLocalDestinationOutboundSocketBinding ( final XMLExtendedStreamReader reader , final String outboundSocketBindingName , final ModelNode outboundSocketBindingAddOperation ) throws XMLStreamException { } private void parseRemoteDestinationOutboundSocketBinding ( final XMLExtendedStreamReader reader , final String outboundSocketBindingName , final ModelNode outboundSocketBindingAddOperation ) throws XMLStreamException { } protected void parseDeployments ( final XMLExtendedStreamReader reader , final ModelNode address , final Namespace expectedNs , final List < ModelNode > list , final boolean allowEnabled ) throws XMLStreamException { } protected void parseVault ( final XMLExtendedStreamReader reader , final ModelNode address , final Namespace expectedNs , final List < ModelNode > list ) throws XMLStreamException { } protected void parseModuleOption ( XMLExtendedStreamReader reader , ModelNode moduleOptions ) throws XMLStreamException { } protected void writeInterfaces ( final XMLExtendedStreamWriter writer , final ModelNode modelNode ) throws XMLStreamException { } private void writeInterfaceCriteria ( final XMLExtendedStreamWriter writer , final ModelNode subModel , final boolean nested ) throws XMLStreamException { } private void writeInterfaceCriteria ( final XMLExtendedStreamWriter writer , final Property property , final boolean nested ) throws XMLStreamException { } private static void writeInterfaceCriteria ( final XMLExtendedStreamWriter writer , final Element element , final Attribute attribute , final ModelNode subModel , boolean asList ) throws XMLStreamException { } private static void writeSingleElement ( final XMLExtendedStreamWriter writer , final Element element , final Attribute attribute , final ModelNode subModel ) throws XMLStreamException { } private static void writeListAsMultipleElements ( final XMLExtendedStreamWriter writer , final Element element , Attribute attribute , final ModelNode subModel ) throws XMLStreamException { } protected void writeSocketBindingGroup ( XMLExtendedStreamWriter writer , ModelNode bindingGroup , boolean fromServer ) throws XMLStreamException { } protected void writeProperties ( final XMLExtendedStreamWriter writer , final ModelNode modelNode , Element element , boolean standalone ) throws XMLStreamException { }

Fix:
final boolean needXsd = ( modelNode . hasDefined ( SCHEMA_LOCATIONS ) ) && ( ( modelNode . get ( SCHEMA_LOCATIONS ) . asInt ( ) ) > 0 ) ;