Program: 32295
Project: 32295
Buggy source:
void gpx(HttpServletResponse response,Device device,Date from,Date to,boolean filter) throws IOException, XMLStreamException {
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  TimeZone tz=TimeZone.getTimeZone("String_Node_Str");
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(tz);
  XMLStreamWriter xsw=XMLOutputFactory.newFactory().createXMLStreamWriter(response.getOutputStream());
  xsw.writeStartDocument("String_Node_Str","String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters("String_Node_Str");
  xsw.writeEndElement();
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters(dateFormat.format(new Date()));
  xsw.writeEndElement();
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters(device.getName());
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters("String_Node_Str" + device.getName() + "String_Node_Str"+ dateFormat.format(from)+ "String_Node_Str"+ dateFormat.format(to));
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters("String_Node_Str");
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  for (  Position p : dataService.getPositions(device,from,to,filter)) {
    xsw.writeStartElement("String_Node_Str");
    xsw.writeAttribute("String_Node_Str",p.getLatitude().toString());
    xsw.writeAttribute("String_Node_Str",p.getLongitude().toString());
    if (p.getAltitude() != null && p.getAltitude() != 0) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(p.getAltitude().toString());
      xsw.writeEndElement();
    }
    xsw.writeStartElement("String_Node_Str");
    xsw.writeCharacters(dateFormat.format(p.getTime()));
    xsw.writeEndElement();
    xsw.writeStartElement("String_Node_Str");
    if (p.getAddress() != null && !p.getAddress().trim().isEmpty()) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(StringEscapeUtils.escapeXml(p.getAddress()));
      xsw.writeEndElement();
    }
    if (p.getSpeed() != null) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(p.getSpeed().toString());
      xsw.writeEndElement();
    }
    if (p.getCourse() != null) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(p.getCourse().toString());
      xsw.writeEndElement();
    }
    if (p.getPower() != null) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(p.getPower().toString());
      xsw.writeEndElement();
    }
    if (p.getOther() != null && !p.getOther().trim().isEmpty()) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(StringEscapeUtils.escapeXml(p.getOther()));
      xsw.writeEndElement();
    }
    xsw.writeEndElement();
    xsw.writeEndElement();
  }
  xsw.writeEndElement();
  xsw.writeEndElement();
  xsw.writeEndElement();
  xsw.writeEndDocument();
  xsw.flush();
}

Fixed version (ground truth):
void gpx(HttpServletResponse response,Device device,Date from,Date to,boolean filter) throws IOException, XMLStreamException {
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  TimeZone tz=TimeZone.getTimeZone("String_Node_Str");
  DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  dateFormat.setTimeZone(tz);
  XMLStreamWriter xsw=XMLOutputFactory.newFactory().createXMLStreamWriter(response.getOutputStream(),"String_Node_Str");
  xsw.writeStartDocument("String_Node_Str","String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeAttribute("String_Node_Str","String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters("String_Node_Str");
  xsw.writeEndElement();
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters(dateFormat.format(new Date()));
  xsw.writeEndElement();
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters(device.getName());
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters("String_Node_Str" + device.getName() + "String_Node_Str"+ dateFormat.format(from)+ "String_Node_Str"+ dateFormat.format(to));
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  xsw.writeCharacters("String_Node_Str");
  xsw.writeEndElement();
  xsw.writeStartElement("String_Node_Str");
  for (  Position p : dataService.getPositions(device,from,to,filter)) {
    xsw.writeStartElement("String_Node_Str");
    xsw.writeAttribute("String_Node_Str",p.getLatitude().toString());
    xsw.writeAttribute("String_Node_Str",p.getLongitude().toString());
    if (p.getAltitude() != null && p.getAltitude() != 0) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(p.getAltitude().toString());
      xsw.writeEndElement();
    }
    xsw.writeStartElement("String_Node_Str");
    xsw.writeCharacters(dateFormat.format(p.getTime()));
    xsw.writeEndElement();
    xsw.writeStartElement("String_Node_Str");
    if (p.getAddress() != null && !p.getAddress().trim().isEmpty()) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(StringEscapeUtils.escapeXml(p.getAddress()));
      xsw.writeEndElement();
    }
    if (p.getSpeed() != null) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(p.getSpeed().toString());
      xsw.writeEndElement();
    }
    if (p.getCourse() != null) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(p.getCourse().toString());
      xsw.writeEndElement();
    }
    if (p.getPower() != null) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(p.getPower().toString());
      xsw.writeEndElement();
    }
    if (p.getOther() != null && !p.getOther().trim().isEmpty()) {
      xsw.writeStartElement("String_Node_Str");
      xsw.writeCharacters(StringEscapeUtils.escapeXml(p.getOther()));
      xsw.writeEndElement();
    }
    xsw.writeEndElement();
    xsw.writeEndElement();
  }
  xsw.writeEndElement();
  xsw.writeEndElement();
  xsw.writeEndElement();
  xsw.writeEndDocument();
  xsw.flush();
}