Program: 167956
Project: 167956
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void writeContent(XMLExtendedStreamWriter writer,SubsystemMarshallingContext context) throws XMLStreamException {
  context.startSubsystemElement(Namespace.CURRENT.getUriString(),false);
  ModelNode scanners=context.getModelNode();
  for (  final Property list : scanners.asPropertyList()) {
    final ModelNode node=list.getValue();
    for (    final Property scanner : node.asPropertyList()) {
      writer.writeEmptyElement(Element.DEPLOYMENT_SCANNER.getLocalName());
      writer.writeAttribute(Attribute.NAME.getLocalName(),scanner.getName());
      ModelNode configuration=scanner.getValue();
      if (configuration.hasDefined(CommonAttributes.PATH)) {
        writer.writeAttribute(Attribute.PATH.getLocalName(),configuration.get(CommonAttributes.PATH).asString());
      }
      if (configuration.hasDefined(CommonAttributes.SCAN_ENABLED)) {
        writer.writeAttribute(Attribute.SCAN_ENABLED.getLocalName(),configuration.get(CommonAttributes.SCAN_ENABLED).asString());
      }
      if (configuration.hasDefined(CommonAttributes.SCAN_INTERVAL)) {
        writer.writeAttribute(Attribute.SCAN_INTERVAL.getLocalName(),configuration.get(CommonAttributes.SCAN_INTERVAL).asString());
      }
      if (configuration.hasDefined(CommonAttributes.RELATIVE_TO)) {
        writer.writeAttribute(Attribute.RELATIVE_TO.getLocalName(),configuration.get(CommonAttributes.RELATIVE_TO).asString());
      }
      if (configuration.hasDefined(CommonAttributes.AUTO_DEPLOY_ZIPPED)) {
        if (!configuration.get(CommonAttributes.AUTO_DEPLOY_ZIPPED).asBoolean()) {
          writer.writeAttribute(Attribute.AUTO_DEPLOY_ZIPPED.getLocalName(),Boolean.FALSE.toString());
        }
      }
      if (configuration.hasDefined(CommonAttributes.AUTO_DEPLOY_EXPLODED)) {
        if (configuration.get(CommonAttributes.AUTO_DEPLOY_ZIPPED).asBoolean()) {
          writer.writeAttribute(Attribute.AUTO_DEPLOY_ZIPPED.getLocalName(),Boolean.TRUE.toString());
        }
      }
      if (configuration.hasDefined(CommonAttributes.DEPLOYMENT_TIMEOUT)) {
        writer.writeAttribute(Attribute.DEPLOYMENT_TIMEOUT.getLocalName(),configuration.get(CommonAttributes.DEPLOYMENT_TIMEOUT).asString());
      }
    }
    writer.writeEndElement();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void writeContent(XMLExtendedStreamWriter writer,SubsystemMarshallingContext context) throws XMLStreamException {
  context.startSubsystemElement(Namespace.CURRENT.getUriString(),false);
  ModelNode scanners=context.getModelNode();
  for (  final Property list : scanners.asPropertyList()) {
    final ModelNode node=list.getValue();
    for (    final Property scanner : node.asPropertyList()) {
      writer.writeEmptyElement(Element.DEPLOYMENT_SCANNER.getLocalName());
      writer.writeAttribute(Attribute.NAME.getLocalName(),scanner.getName());
      ModelNode configuration=scanner.getValue();
      if (configuration.hasDefined(CommonAttributes.PATH)) {
        writer.writeAttribute(Attribute.PATH.getLocalName(),configuration.get(CommonAttributes.PATH).asString());
      }
      if (configuration.hasDefined(CommonAttributes.SCAN_ENABLED)) {
        writer.writeAttribute(Attribute.SCAN_ENABLED.getLocalName(),configuration.get(CommonAttributes.SCAN_ENABLED).asString());
      }
      if (configuration.hasDefined(CommonAttributes.SCAN_INTERVAL)) {
        writer.writeAttribute(Attribute.SCAN_INTERVAL.getLocalName(),configuration.get(CommonAttributes.SCAN_INTERVAL).asString());
      }
      if (configuration.hasDefined(CommonAttributes.RELATIVE_TO)) {
        writer.writeAttribute(Attribute.RELATIVE_TO.getLocalName(),configuration.get(CommonAttributes.RELATIVE_TO).asString());
      }
      if (configuration.hasDefined(CommonAttributes.AUTO_DEPLOY_ZIPPED)) {
        if (!configuration.get(CommonAttributes.AUTO_DEPLOY_ZIPPED).asBoolean()) {
          writer.writeAttribute(Attribute.AUTO_DEPLOY_ZIPPED.getLocalName(),Boolean.FALSE.toString());
        }
      }
      if (configuration.hasDefined(CommonAttributes.AUTO_DEPLOY_EXPLODED)) {
        if (configuration.get(CommonAttributes.AUTO_DEPLOY_EXPLODED).asBoolean()) {
          writer.writeAttribute(Attribute.AUTO_DEPLOY_EXPLODED.getLocalName(),Boolean.TRUE.toString());
        }
      }
      if (configuration.hasDefined(CommonAttributes.DEPLOYMENT_TIMEOUT)) {
        writer.writeAttribute(Attribute.DEPLOYMENT_TIMEOUT.getLocalName(),configuration.get(CommonAttributes.DEPLOYMENT_TIMEOUT).asString());
      }
    }
    writer.writeEndElement();
  }
}