Program: 167938
Project: 167938
Buggy source:
protected void parseSocketBindingGroupRef(final XMLExtendedStreamReader reader,final ModelNode address,final List<ModelNode> updates) throws XMLStreamException {
  String name=null;
  int offset=-1;
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (!isNoNamespaceAttribute(reader,i)) {
      throw ParseUtils.unexpectedAttribute(reader,i);
    }
 else {
      final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case REF:
{
          if (name != null)           throw ParseUtils.duplicateAttribute(reader,attribute.getLocalName());
          name=value;
          break;
        }
case PORT_OFFSET:
{
        try {
          if (offset != -1)           throw ParseUtils.duplicateAttribute(reader,attribute.getLocalName());
          offset=Integer.parseInt(value);
          if (offset < 0) {
            throw new XMLStreamException(offset + "String_Node_Str" + attribute.getLocalName()+ "String_Node_Str",reader.getLocation());
          }
        }
 catch (        final NumberFormatException e) {
          throw new XMLStreamException(offset + "String_Node_Str" + attribute.getLocalName(),reader.getLocation(),e);
        }
        break;
      }
default :
    throw ParseUtils.unexpectedAttribute(reader,i);
}
}
}
if (name == null) {
throw ParseUtils.missingRequired(reader,Collections.singleton(Attribute.REF));
}
ParseUtils.requireNoContent(reader);
ModelNode update=Util.getWriteAttributeOperation(address,SOCKET_BINDING_GROUP,name);
updates.add(update);
if (offset < 0) {
offset=0;
}
if (offset > 0) {
update=Util.getWriteAttributeOperation(address,SOCKET_BINDING_PORT_OFFSET,offset);
}
updates.add(update);
}

Fixed version (ground truth):
protected void parseSocketBindingGroupRef(final XMLExtendedStreamReader reader,final ModelNode address,final List<ModelNode> updates) throws XMLStreamException {
  String name=null;
  int offset=-1;
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (!isNoNamespaceAttribute(reader,i)) {
      throw ParseUtils.unexpectedAttribute(reader,i);
    }
 else {
      final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case REF:
{
          if (name != null)           throw ParseUtils.duplicateAttribute(reader,attribute.getLocalName());
          name=value;
          break;
        }
case PORT_OFFSET:
{
        try {
          if (offset != -1)           throw ParseUtils.duplicateAttribute(reader,attribute.getLocalName());
          offset=Integer.parseInt(value);
          if (offset < 0) {
            throw new XMLStreamException(offset + "String_Node_Str" + attribute.getLocalName()+ "String_Node_Str",reader.getLocation());
          }
        }
 catch (        final NumberFormatException e) {
          throw new XMLStreamException(offset + "String_Node_Str" + attribute.getLocalName(),reader.getLocation(),e);
        }
        break;
      }
default :
    throw ParseUtils.unexpectedAttribute(reader,i);
}
}
}
if (name == null) {
throw ParseUtils.missingRequired(reader,Collections.singleton(Attribute.REF));
}
ParseUtils.requireNoContent(reader);
ModelNode update=Util.getWriteAttributeOperation(address,SOCKET_BINDING_GROUP,name);
updates.add(update);
if (offset < 0) {
offset=0;
}
if (offset >= 0) {
update=Util.getWriteAttributeOperation(address,SOCKET_BINDING_PORT_OFFSET,offset);
}
updates.add(update);
}