Program: 167806
Project: 167806
Buggy source:
/** 
 * Read the <server/> element based on version 1.4 of the schema.
 * @param reader  the xml stream reader
 * @param address address of the parent resource of any resources this method will add
 * @param list    the list of boot operations to which any new operations should be added
 * @throws XMLStreamException if a parsing error occurs
 */
private void readServerElement_1_4(final Namespace namespace,final XMLExtendedStreamReader reader,final ModelNode address,final List<ModelNode> list) throws XMLStreamException {
  parseNamespaces(reader,address,list);
  ModelNode serverName=null;
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
switch (Namespace.forUri(reader.getAttributeNamespace(i))) {
case NONE:
{
        final String value=reader.getAttributeValue(i);
        final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case NAME:
{
            serverName=ServerRootResourceDefinition.NAME.parse(value,reader.getLocation());
            break;
          }
default :
        throw unexpectedAttribute(reader,i);
    }
    break;
  }
case XML_SCHEMA_INSTANCE:
{
switch (Attribute.forName(reader.getAttributeLocalName(i))) {
case SCHEMA_LOCATION:
{
      parseSchemaLocations(reader,address,list,i);
      break;
    }
case NO_NAMESPACE_SCHEMA_LOCATION:
{
    break;
  }
default :
{
  throw unexpectedAttribute(reader,i);
}
}
break;
}
default :
throw unexpectedAttribute(reader,i);
}
}
setServerName(address,list,serverName);
Element element=nextElement(reader,namespace);
if (element == Element.EXTENSIONS) {
extensionXml.parseExtensions(reader,address,namespace,list);
element=nextElement(reader,namespace);
}
if (element == Element.SYSTEM_PROPERTIES) {
parseSystemProperties(reader,address,namespace,list,true);
element=nextElement(reader,namespace);
}
if (element == Element.PATHS) {
parsePaths(reader,address,namespace,list,true);
element=nextElement(reader,namespace);
}
if (element == Element.VAULT) {
parseVault(reader,address,namespace,list);
element=nextElement(reader,namespace);
}
if (element == Element.MANAGEMENT) {
ManagementXml managementXml=new ManagementXml(this);
managementXml.parseManagement(reader,address,namespace,list,true,false);
element=nextElement(reader,namespace);
}
if (element == Element.PROFILE) {
parseServerProfile(reader,address,list);
element=nextElement(reader,namespace);
}
final Set<String> interfaceNames=new HashSet<String>();
if (element == Element.INTERFACES) {
parseInterfaces(reader,interfaceNames,address,namespace,list,true);
element=nextElement(reader,namespace);
}
if (element == Element.SOCKET_BINDING_GROUP) {
parseSocketBindingGroup_1_1(reader,interfaceNames,address,namespace,list);
element=nextElement(reader,namespace);
}
if (element == Element.DEPLOYMENTS) {
parseDeployments(reader,address,namespace,list,EnumSet.of(Attribute.NAME,Attribute.RUNTIME_NAME,Attribute.ENABLED),EnumSet.of(Element.CONTENT,Element.FS_ARCHIVE,Element.FS_EXPLODED));
element=nextElement(reader,namespace);
}
if (element == Element.DEPLOYMENT_OVERLAYS) {
parseDeploymentOverlays(reader,namespace,new ModelNode(),list);
element=nextElement(reader,namespace);
}
if (element != null) {
throw unexpectedElement(reader);
}
}

Fixed version (ground truth):
/** 
 * Read the <server/> element based on version 1.4 of the schema.
 * @param reader  the xml stream reader
 * @param address address of the parent resource of any resources this method will add
 * @param list    the list of boot operations to which any new operations should be added
 * @throws XMLStreamException if a parsing error occurs
 */
private void readServerElement_1_4(final Namespace namespace,final XMLExtendedStreamReader reader,final ModelNode address,final List<ModelNode> list) throws XMLStreamException {
  parseNamespaces(reader,address,list);
  ModelNode serverName=null;
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
switch (Namespace.forUri(reader.getAttributeNamespace(i))) {
case NONE:
{
        final String value=reader.getAttributeValue(i);
        final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case NAME:
{
            serverName=ServerRootResourceDefinition.NAME.parse(value,reader.getLocation());
            break;
          }
default :
        throw unexpectedAttribute(reader,i);
    }
    break;
  }
case XML_SCHEMA_INSTANCE:
{
switch (Attribute.forName(reader.getAttributeLocalName(i))) {
case SCHEMA_LOCATION:
{
      parseSchemaLocations(reader,address,list,i);
      break;
    }
case NO_NAMESPACE_SCHEMA_LOCATION:
{
    break;
  }
default :
{
  throw unexpectedAttribute(reader,i);
}
}
break;
}
default :
throw unexpectedAttribute(reader,i);
}
}
setServerName(address,list,serverName);
Element element=nextElement(reader,namespace);
if (element == Element.EXTENSIONS) {
extensionXml.parseExtensions(reader,address,namespace,list);
element=nextElement(reader,namespace);
}
if (element == Element.SYSTEM_PROPERTIES) {
parseSystemProperties(reader,address,namespace,list,true);
element=nextElement(reader,namespace);
}
if (element == Element.PATHS) {
parsePaths(reader,address,namespace,list,true);
element=nextElement(reader,namespace);
}
if (element == Element.VAULT) {
parseVault(reader,address,namespace,list);
element=nextElement(reader,namespace);
}
if (element == Element.MANAGEMENT) {
ManagementXml managementXml=new ManagementXml(this);
managementXml.parseManagement(reader,address,namespace,list,true,false);
element=nextElement(reader,namespace);
}
if (element == Element.PROFILE) {
parseServerProfile(reader,address,list);
element=nextElement(reader,namespace);
}
final Set<String> interfaceNames=new HashSet<String>();
if (element == Element.INTERFACES) {
parseInterfaces(reader,interfaceNames,address,namespace,list,true);
element=nextElement(reader,namespace);
}
if (element == Element.SOCKET_BINDING_GROUP) {
parseSocketBindingGroup_1_1(reader,interfaceNames,address,namespace,list);
element=nextElement(reader,namespace);
}
if (element == Element.DEPLOYMENTS) {
parseDeployments(reader,address,namespace,list,EnumSet.of(Attribute.NAME,Attribute.RUNTIME_NAME,Attribute.ENABLED),EnumSet.of(Element.CONTENT,Element.FS_ARCHIVE,Element.FS_EXPLODED));
element=nextElement(reader,namespace);
}
if (element == Element.DEPLOYMENT_OVERLAYS) {
parseDeploymentOverlays(reader,namespace,new ModelNode(),list,true,true);
element=nextElement(reader,namespace);
}
if (element != null) {
throw unexpectedElement(reader);
}
}