Program: 19224
Project: 19224
Buggy source:
/** 
 * sets the time series profile data
 * @param featureProfileCollection 
 */
@Override public void setData(Object featureProfileCollection) throws IOException {
  this.tsProfileData=(StationProfileFeatureCollection)featureProfileCollection;
  String genericName=this.tsProfileData.getCollectionFeatureType().name() + "String_Node_Str";
  tsStationList=tsProfileData.getStations(reqStationNames);
  tsStationList=tsProfileData.getStations(reqStationNames);
  for (  String s : reqStationNames) {
    String[] urns=s.split("String_Node_Str");
    String statUrn=urns[urns.length - 1];
    Station st=tsProfileData.getStation(urns[urns.length - 1]);
    if (st != null) {
      tsStationList.add(st);
    }
 else     if (statUrn.startsWith(genericName)) {
      try {
        Integer sIndex=Integer.valueOf(statUrn.substring(genericName.length()));
        st=tsProfileData.getStations().get(sIndex);
        if (st != null) {
          tsStationList.add(st);
        }
      }
 catch (      Exception n) {
        n.printStackTrace();
      }
    }
  }
  setNumberOfStations(tsStationList.size());
  altMin=new ArrayList<Double>();
  altMax=new ArrayList<Double>();
  numberHeightsForStation=new HashMap<String,List<Double>>();
  DateTime curTime;
  DateTime dtStart=null;
  DateTime dtEnd=null;
  if (tsStationList.size() > 0) {
    for (int i=0; i < tsStationList.size(); i++) {
      StationProfileFeature sPFeature=tsProfileData.getStationProfileFeature(tsStationList.get(i));
      List<Date> times=sPFeature.getTimes();
      if (i == 0) {
        setInitialLatLonBoundaries(tsStationList);
        dtStart=new DateTime(times.get(0),chrono);
        dtEnd=new DateTime(times.get(0),chrono);
      }
 else {
        checkLatLonAltBoundaries(tsStationList,i);
      }
      for (int j=0; j < times.size(); j++) {
        curTime=new DateTime(times.get(j),chrono);
        if (curTime.isBefore(dtStart)) {
          dtStart=curTime;
        }
 else         if (curTime.isAfter(dtEnd)) {
          dtEnd=curTime;
        }
      }
    }
    setStartDate(df.toDateTimeStringISO(dtStart.toDate()));
    setEndDate(df.toDateTimeStringISO(dtEnd.toDate()));
    for (int j=0; j < tsStationList.size(); j++) {
      StationProfileFeature profile=tsProfileData.getStationProfileFeature(tsStationList.get(j));
      double altmin=Double.POSITIVE_INFINITY;
      double altmax=Double.NEGATIVE_INFINITY;
      List<Double> altVals=new ArrayList<Double>();
      for (profile.resetIteration(); profile.hasNext(); ) {
        ProfileFeature nProfile=profile.next();
        for (nProfile.resetIteration(); nProfile.hasNext(); ) {
          PointFeature point=nProfile.next();
          Object heightOb=null;
          if (this.heightAxis != null)           heightOb=point.getData().getScalarObject(this.heightAxis.getShortName());
          double alt;
          if (heightOb != null)           alt=Double.valueOf(heightOb.toString());
 else           alt=point.getLocation().getAltitude();
          if (!Double.toString(alt).equalsIgnoreCase("String_Node_Str")) {
            if (alt > altmax)             altmax=alt;
            if (alt < altmin)             altmin=alt;
            if (alt > upperAlt)             upperAlt=alt;
            if (alt < lowerAlt)             lowerAlt=alt;
          }
          if (!altVals.contains(alt))           altVals.add(alt);
        }
        if (!this.multDimTimVar)         break;
      }
      this.numberHeightsForStation.put(tsStationList.get(j).getName(),altVals);
      altMin.add(altmin);
      altMax.add(altmax);
    }
  }
}

Fixed version (ground truth):
/** 
 * sets the time series profile data
 * @param featureProfileCollection 
 */
@Override public void setData(Object featureProfileCollection) throws IOException {
  this.tsProfileData=(StationProfileFeatureCollection)featureProfileCollection;
  String genericName=this.tsProfileData.getCollectionFeatureType().name() + "String_Node_Str";
  tsStationList=tsProfileData.getStations(reqStationNames);
  tsStationList=tsProfileData.getStations(reqStationNames);
  for (  String s : reqStationNames) {
    String[] urns=s.split("String_Node_Str");
    String statUrn=urns[urns.length - 1];
    Station st=tsProfileData.getStation(urns[urns.length - 1]);
    if (st != null) {
      tsStationList.add(st);
    }
 else     if (statUrn.startsWith(genericName)) {
      try {
        Integer sIndex=Integer.valueOf(statUrn.substring(genericName.length()));
        st=tsProfileData.getStations().get(sIndex);
        if (st != null) {
          tsStationList.add(st);
        }
      }
 catch (      Exception n) {
        n.printStackTrace();
      }
    }
  }
  setNumberOfStations(tsStationList.size());
  altMin=new ArrayList<Double>();
  altMax=new ArrayList<Double>();
  numberHeightsForStation=new HashMap<String,List<Double>>();
  DateTime curTime;
  DateTime dtStart=null;
  DateTime dtEnd=null;
  if (tsStationList.size() > 0) {
    for (int i=0; i < tsStationList.size(); i++) {
      StationProfileFeature sPFeature=tsProfileData.getStationProfileFeature(tsStationList.get(i));
      List<Date> times=sPFeature.getTimes();
      if (i == 0) {
        setInitialLatLonBoundaries(tsStationList);
        dtStart=new DateTime(times.get(0),chrono);
        dtEnd=new DateTime(times.get(0),chrono);
      }
 else {
        checkLatLonAltBoundaries(tsStationList,i);
      }
      for (int j=0; j < times.size(); j++) {
        curTime=new DateTime(times.get(j),chrono);
        if (curTime.isBefore(dtStart)) {
          dtStart=curTime;
        }
 else         if (curTime.isAfter(dtEnd)) {
          dtEnd=curTime;
        }
      }
    }
    setStartDate(df.toDateTimeStringISO(dtStart.toDate()));
    setEndDate(df.toDateTimeStringISO(dtEnd.toDate()));
    for (int j=0; j < tsStationList.size(); j++) {
      StationProfileFeature profile=tsProfileData.getStationProfileFeature(tsStationList.get(j));
      double altmin=Double.POSITIVE_INFINITY;
      double altmax=Double.NEGATIVE_INFINITY;
      List<Double> altVals=new ArrayList<Double>();
      for (profile.resetIteration(); profile.hasNext(); ) {
        ProfileFeature nProfile=profile.next();
        for (nProfile.resetIteration(); nProfile.hasNext(); ) {
          PointFeature point=nProfile.next();
          Object heightOb=null;
          if (this.heightAxis != null)           heightOb=point.getData().getScalarObject(this.heightAxis.getShortName());
          double alt;
          if (heightOb != null)           alt=Double.valueOf(heightOb.toString());
 else           alt=point.getLocation().getAltitude();
          if (!Double.toString(alt).equalsIgnoreCase("String_Node_Str")) {
            if (alt > altmax)             altmax=alt;
            if (alt < altmin)             altmin=alt;
            if (alt > upperAlt)             upperAlt=alt;
            if (alt < lowerAlt)             lowerAlt=alt;
          }
          if (!altVals.contains(alt))           altVals.add(alt);
        }
      }
      this.numberHeightsForStation.put(tsStationList.get(j).getName(),altVals);
      altMin.add(altmin);
      altMax.add(altmax);
    }
  }
}