Program: 100793
Project: 100793
Buggy source:
/** 
 * Store job into temporary configuration files.
 * @throws IOException if writing configuration files failed
 */
public void write() throws IOException {
  OutputStream outStream=null;
  XMLStreamWriter out=null;
  try {
    outStream=new FileOutputStream(new File(tempDir,JOB_FILE));
    out=XMLOutputFactory.newInstance().createXMLStreamWriter(outStream);
    out.writeStartDocument();
    out.writeStartElement(ELEMENT_JOB);
    for (    final Map.Entry<String,Object> e : prop.entrySet()) {
      out.writeStartElement(ELEMENT_PROPERTY);
      out.writeAttribute(ATTRIBUTE_NAME,e.getKey());
      if (e.getValue() instanceof String) {
        out.writeStartElement(ELEMENT_STRING);
        out.writeCharacters(e.getValue().toString());
        out.writeEndElement();
      }
 else       if (e.getValue() instanceof Set) {
        out.writeStartElement(ELEMENT_SET);
        final Set<?> s=(Set<?>)e.getValue();
        for (        final Object o : s) {
          out.writeStartElement(ELEMENT_STRING);
          out.writeCharacters(o.toString());
          out.writeEndElement();
        }
        out.writeEndElement();
      }
 else       if (e.getValue() instanceof Map) {
        out.writeStartElement(ELEMENT_MAP);
        final Map<?,?> s=(Map<?,?>)e.getValue();
        for (        final Map.Entry<?,?> o : s.entrySet()) {
          out.writeStartElement(ELEMENT_ENTRY);
          out.writeAttribute(ATTRIBUTE_KEY,o.getKey().toString());
          out.writeStartElement(ELEMENT_STRING);
          out.writeCharacters(o.getValue().toString());
          out.writeEndElement();
          out.writeEndElement();
        }
        out.writeEndElement();
      }
 else {
        out.writeStartElement(e.getValue().getClass().getName());
        out.writeCharacters(e.getValue().toString());
        out.writeEndElement();
      }
      out.writeEndElement();
    }
    out.writeEndElement();
    out.writeEndDocument();
  }
 catch (  final IOException e) {
    throw new IOException("String_Node_Str" + e.getMessage());
  }
catch (  final XMLStreamException e) {
    throw new IOException("String_Node_Str" + e.getMessage());
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      final XMLStreamException e) {
        throw new IOException("String_Node_Str" + e.getMessage());
      }
    }
    if (outStream != null) {
      try {
        outStream.close();
      }
 catch (      final IOException e) {
        throw new IOException("String_Node_Str" + e.getMessage());
      }
    }
  }
  final Properties p=new Properties();
  for (  final Map.Entry<String,Object> e : prop.entrySet()) {
    if (e.getValue() instanceof Set) {
      p.put(e.getKey(),StringUtils.assembleString((Collection)e.getValue(),COMMA));
    }
 else     if (e.getValue() instanceof Map) {
      p.put(e.getKey(),StringUtils.assembleString((Map)e.getValue(),COMMA));
    }
 else {
      p.put(e.getKey(),e.getValue());
    }
  }
  FileOutputStream propertiesOutputStream=null;
  try {
    propertiesOutputStream=new FileOutputStream(new File(tempDir,FILE_NAME_DITA_LIST));
    p.store(propertiesOutputStream,null);
    propertiesOutputStream.flush();
  }
 catch (  final IOException e) {
    throw new IOException("String_Node_Str" + e.getMessage());
  }
 finally {
    if (propertiesOutputStream != null) {
      try {
        propertiesOutputStream.close();
      }
 catch (      final IOException e) {
        throw new IOException("String_Node_Str" + e.getMessage());
      }
    }
  }
  FileOutputStream xmlOutputStream=null;
  try {
    xmlOutputStream=new FileOutputStream(new File(tempDir,FILE_NAME_DITA_LIST_XML));
    p.storeToXML(xmlOutputStream,null);
    xmlOutputStream.flush();
  }
 catch (  final IOException e) {
    throw new IOException("String_Node_Str" + e.getMessage());
  }
 finally {
    if (xmlOutputStream != null) {
      try {
        xmlOutputStream.close();
      }
 catch (      final IOException e) {
        throw new IOException("String_Node_Str" + e.getMessage());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Store job into temporary configuration files.
 * @throws IOException if writing configuration files failed
 */
public void write() throws IOException {
  OutputStream outStream=null;
  XMLStreamWriter out=null;
  try {
    outStream=new FileOutputStream(new File(tempDir,JOB_FILE));
    out=XMLOutputFactory.newInstance().createXMLStreamWriter(outStream,"String_Node_Str");
    out.writeStartDocument();
    out.writeStartElement(ELEMENT_JOB);
    for (    final Map.Entry<String,Object> e : prop.entrySet()) {
      out.writeStartElement(ELEMENT_PROPERTY);
      out.writeAttribute(ATTRIBUTE_NAME,e.getKey());
      if (e.getValue() instanceof String) {
        out.writeStartElement(ELEMENT_STRING);
        out.writeCharacters(e.getValue().toString());
        out.writeEndElement();
      }
 else       if (e.getValue() instanceof Set) {
        out.writeStartElement(ELEMENT_SET);
        final Set<?> s=(Set<?>)e.getValue();
        for (        final Object o : s) {
          out.writeStartElement(ELEMENT_STRING);
          out.writeCharacters(o.toString());
          out.writeEndElement();
        }
        out.writeEndElement();
      }
 else       if (e.getValue() instanceof Map) {
        out.writeStartElement(ELEMENT_MAP);
        final Map<?,?> s=(Map<?,?>)e.getValue();
        for (        final Map.Entry<?,?> o : s.entrySet()) {
          out.writeStartElement(ELEMENT_ENTRY);
          out.writeAttribute(ATTRIBUTE_KEY,o.getKey().toString());
          out.writeStartElement(ELEMENT_STRING);
          out.writeCharacters(o.getValue().toString());
          out.writeEndElement();
          out.writeEndElement();
        }
        out.writeEndElement();
      }
 else {
        out.writeStartElement(e.getValue().getClass().getName());
        out.writeCharacters(e.getValue().toString());
        out.writeEndElement();
      }
      out.writeEndElement();
    }
    out.writeEndElement();
    out.writeEndDocument();
  }
 catch (  final IOException e) {
    throw new IOException("String_Node_Str" + e.getMessage());
  }
catch (  final XMLStreamException e) {
    throw new IOException("String_Node_Str" + e.getMessage());
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      final XMLStreamException e) {
        throw new IOException("String_Node_Str" + e.getMessage());
      }
    }
    if (outStream != null) {
      try {
        outStream.close();
      }
 catch (      final IOException e) {
        throw new IOException("String_Node_Str" + e.getMessage());
      }
    }
  }
  final Properties p=new Properties();
  for (  final Map.Entry<String,Object> e : prop.entrySet()) {
    if (e.getValue() instanceof Set) {
      p.put(e.getKey(),StringUtils.assembleString((Collection)e.getValue(),COMMA));
    }
 else     if (e.getValue() instanceof Map) {
      p.put(e.getKey(),StringUtils.assembleString((Map)e.getValue(),COMMA));
    }
 else {
      p.put(e.getKey(),e.getValue());
    }
  }
  FileOutputStream propertiesOutputStream=null;
  try {
    propertiesOutputStream=new FileOutputStream(new File(tempDir,FILE_NAME_DITA_LIST));
    p.store(propertiesOutputStream,null);
    propertiesOutputStream.flush();
  }
 catch (  final IOException e) {
    throw new IOException("String_Node_Str" + e.getMessage());
  }
 finally {
    if (propertiesOutputStream != null) {
      try {
        propertiesOutputStream.close();
      }
 catch (      final IOException e) {
        throw new IOException("String_Node_Str" + e.getMessage());
      }
    }
  }
  FileOutputStream xmlOutputStream=null;
  try {
    xmlOutputStream=new FileOutputStream(new File(tempDir,FILE_NAME_DITA_LIST_XML));
    p.storeToXML(xmlOutputStream,null);
    xmlOutputStream.flush();
  }
 catch (  final IOException e) {
    throw new IOException("String_Node_Str" + e.getMessage());
  }
 finally {
    if (xmlOutputStream != null) {
      try {
        xmlOutputStream.close();
      }
 catch (      final IOException e) {
        throw new IOException("String_Node_Str" + e.getMessage());
      }
    }
  }
}