Program: 34315
Project: 34315
Buggy source:
public static List<PortableTimeSeries> parse(InputStreamReader xmlBuffer,DataFlowStructure dsd,String dataflow,boolean data) throws XMLStreamException, UnsupportedEncodingException, SdmxException {
  final String sourceMethod="String_Node_Str";
  logger.entering(sourceClass,sourceMethod);
  List<PortableTimeSeries> tsList=new ArrayList<PortableTimeSeries>();
  XMLInputFactory inputFactory=XMLInputFactory.newInstance();
  XMLEventReader eventReader=inputFactory.createXMLEventReader(xmlBuffer);
  PortableTimeSeries ts=null;
  String currentAction=null;
  String currentValidFromDate=null;
  String currentValidToDate=null;
  while (eventReader.hasNext()) {
    XMLEvent event=eventReader.nextEvent();
    logger.finest(event.toString());
    if (event.isStartElement()) {
      StartElement startElement=event.asStartElement();
      if (startElement.getName().getLocalPart() == (DATASET)) {
        logger.finer("String_Node_Str");
        @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=startElement.getAttributes();
        while (attributes.hasNext()) {
          Attribute attr=attributes.next();
          String id=attr.getName().getLocalPart().toString();
          String value=attr.getValue();
          if (id.equalsIgnoreCase(ACTION)) {
            logger.finer("String_Node_Str" + value);
            currentAction=value;
          }
 else           if (id.equalsIgnoreCase(VALID_FROM)) {
            logger.finer("String_Node_Str" + value);
            currentValidFromDate=value;
          }
 else           if (id.equalsIgnoreCase(VALID_TO)) {
            logger.finer("String_Node_Str" + value);
            currentValidToDate=value;
          }
        }
      }
      if (startElement.getName().getLocalPart() == (MESSAGE)) {
        String errorCode=null;
        String errorSeverity=null;
        LocalizedText errorMsg=new LocalizedText(Configuration.getLang());
        @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=startElement.getAttributes();
        while (attributes.hasNext()) {
          Attribute attr=attributes.next();
          String id=attr.getName().toString();
          String value=attr.getValue();
          if (id.equalsIgnoreCase(CODE)) {
            errorCode=value;
          }
 else           if (id.equalsIgnoreCase(SEVERITY)) {
            errorSeverity=value;
          }
        }
        eventReader.nextEvent();
        errorMsg.setText(startElement,eventReader);
        throw new SdmxException("String_Node_Str" + errorCode + "String_Node_Str"+ errorSeverity+ "String_Node_Str"+ errorMsg.getText());
      }
      if (startElement.getName().getLocalPart() == (SERIES)) {
        logger.finer("String_Node_Str");
        ts=new PortableTimeSeries();
        ts.setDataflow(dataflow);
        @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=startElement.getAttributes();
        setMetadata(ts,dsd,attributes,currentAction,currentValidFromDate,currentValidToDate);
      }
      if (startElement.getName().getLocalPart().equals(OBS) && data) {
        event=eventReader.nextEvent();
        logger.finest(event.toString());
        @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=startElement.getAttributes();
        String time=null;
        String obs_val=null;
        Hashtable<String,String> obs_attr=new Hashtable<String,String>();
        while (attributes.hasNext()) {
          Attribute attribute=attributes.next();
          String name=attribute.getName().toString();
          if (name.equals(dsd.getTimeDimension())) {
            time=attribute.getValue();
          }
 else           if (name.equals(dsd.getMeasure())) {
            obs_val=attribute.getValue();
          }
 else {
            obs_attr.put(name,attribute.getValue());
          }
        }
        if (time != null && !time.isEmpty() && obs_val != null && !obs_val.isEmpty()) {
          ts.addObservation(new Double(obs_val),time,obs_attr);
        }
 else {
          throw new RuntimeException("String_Node_Str" + time + "String_Node_Str"+ obs_val);
        }
        continue;
      }
    }
    if (event.isEndElement()) {
      EndElement endElement=event.asEndElement();
      if (endElement.getName().getLocalPart() == (SERIES)) {
        logger.finer("String_Node_Str" + ts);
        List<String> dates=ts.getTimeSlots();
        int n=dates.size();
        if (n > 1) {
          if (dates.get(n - 1).compareToIgnoreCase(dates.get(0)) < 0) {
            ts.reverse();
          }
        }
        tsList.add(ts);
      }
    }
  }
  logger.exiting(sourceClass,sourceMethod);
  return tsList;
}

Fixed version (ground truth):
public static List<PortableTimeSeries> parse(InputStreamReader xmlBuffer,DataFlowStructure dsd,String dataflow,boolean data) throws XMLStreamException, UnsupportedEncodingException, SdmxException {
  final String sourceMethod="String_Node_Str";
  logger.entering(sourceClass,sourceMethod);
  List<PortableTimeSeries> tsList=new ArrayList<PortableTimeSeries>();
  XMLInputFactory inputFactory=XMLInputFactory.newInstance();
  BufferedReader br=GenericDataParser.skipBOM(xmlBuffer);
  XMLEventReader eventReader=inputFactory.createXMLEventReader(br);
  PortableTimeSeries ts=null;
  String currentAction=null;
  String currentValidFromDate=null;
  String currentValidToDate=null;
  while (eventReader.hasNext()) {
    XMLEvent event=eventReader.nextEvent();
    logger.finest(event.toString());
    if (event.isStartElement()) {
      StartElement startElement=event.asStartElement();
      if (startElement.getName().getLocalPart() == (DATASET)) {
        logger.finer("String_Node_Str");
        @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=startElement.getAttributes();
        while (attributes.hasNext()) {
          Attribute attr=attributes.next();
          String id=attr.getName().getLocalPart().toString();
          String value=attr.getValue();
          if (id.equalsIgnoreCase(ACTION)) {
            logger.finer("String_Node_Str" + value);
            currentAction=value;
          }
 else           if (id.equalsIgnoreCase(VALID_FROM)) {
            logger.finer("String_Node_Str" + value);
            currentValidFromDate=value;
          }
 else           if (id.equalsIgnoreCase(VALID_TO)) {
            logger.finer("String_Node_Str" + value);
            currentValidToDate=value;
          }
        }
      }
      if (startElement.getName().getLocalPart() == (MESSAGE)) {
        String errorCode=null;
        String errorSeverity=null;
        LocalizedText errorMsg=new LocalizedText(Configuration.getLang());
        @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=startElement.getAttributes();
        while (attributes.hasNext()) {
          Attribute attr=attributes.next();
          String id=attr.getName().toString();
          String value=attr.getValue();
          if (id.equalsIgnoreCase(CODE)) {
            errorCode=value;
          }
 else           if (id.equalsIgnoreCase(SEVERITY)) {
            errorSeverity=value;
          }
        }
        eventReader.nextEvent();
        errorMsg.setText(startElement,eventReader);
        throw new SdmxException("String_Node_Str" + errorCode + "String_Node_Str"+ errorSeverity+ "String_Node_Str"+ errorMsg.getText());
      }
      if (startElement.getName().getLocalPart() == (SERIES)) {
        logger.finer("String_Node_Str");
        ts=new PortableTimeSeries();
        ts.setDataflow(dataflow);
        @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=startElement.getAttributes();
        setMetadata(ts,dsd,attributes,currentAction,currentValidFromDate,currentValidToDate);
      }
      if (startElement.getName().getLocalPart().equals(OBS) && data) {
        event=eventReader.nextEvent();
        logger.finest(event.toString());
        @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=startElement.getAttributes();
        String time=null;
        String obs_val=null;
        Hashtable<String,String> obs_attr=new Hashtable<String,String>();
        while (attributes.hasNext()) {
          Attribute attribute=attributes.next();
          String name=attribute.getName().toString();
          if (name.equals(dsd.getTimeDimension())) {
            time=attribute.getValue();
          }
 else           if (name.equals(dsd.getMeasure())) {
            obs_val=attribute.getValue();
          }
 else {
            obs_attr.put(name,attribute.getValue());
          }
        }
        if (time != null && !time.isEmpty() && obs_val != null && !obs_val.isEmpty()) {
          ts.addObservation(new Double(obs_val),time,obs_attr);
        }
 else {
          throw new RuntimeException("String_Node_Str" + time + "String_Node_Str"+ obs_val);
        }
        continue;
      }
    }
    if (event.isEndElement()) {
      EndElement endElement=event.asEndElement();
      if (endElement.getName().getLocalPart() == (SERIES)) {
        logger.finer("String_Node_Str" + ts);
        List<String> dates=ts.getTimeSlots();
        int n=dates.size();
        if (n > 1) {
          if (dates.get(n - 1).compareToIgnoreCase(dates.get(0)) < 0) {
            ts.reverse();
          }
        }
        tsList.add(ts);
      }
    }
  }
  logger.exiting(sourceClass,sourceMethod);
  return tsList;
}