Program: 37914
Project: 37914
Buggy source:
/** 
 * Initialize this fragment with time series data and visualization options.
 * @param seriesType  The type of the time series as specified by the PersistencyManager (e.g. PersistencyManager.TIMESERIES_TYPE_TEMPERATURE)
 * @param seriesId  The individual Id of the time series to display
 * @param maxHistorySize  The max. history size (required for loading or creating a time series)
 * @param storageLocation  The location where the history is stored (required for loading a time series)
 * @param plotTitle  The title that shall be shown above the plot
 * @param plotLowerRangeBounday  The lower boundary of possible values
 * @param plotUpperRangeBoundary  The upper boundary of possible values
 * @param gradientColorStart  The start color of the gradient to fill the plot
 * @param gradientColorEnd  The end color of the gradient to fill the plot
 * @param gradientEndCoordinateY  The pixel y-index where the color gradient shall end (and be mirrored)
 * @param lineAndPointColor  The color of the line and all points
 */
public void init(String seriesType,String seriesId,int maxHistorySize,String storageLocation,String plotTitle,int plotLowerRangeBounday,int plotUpperRangeBoundary,int gradientColorStart,int gradientColorEnd,int gradientEndCoordinateY,int lineAndPointColor){
  this.seriesType=seriesType;
  this.seriesId=seriesId;
  this.maxHistorySize=maxHistorySize;
  this.storageLocation=storageLocation;
  PersistencyManager pm=PersistencyManager.getInstance(getActivity());
  try {
    timeSeries=pm.load(maxHistorySize,storageLocation,seriesType,seriesId);
  }
 catch (  Exception e) {
    timeSeries=pm.create(maxHistorySize,storageLocation,seriesType,seriesId);
    e.printStackTrace();
  }
  TextView title=(TextView)getView().findViewById(R.id.plot_title);
  title.setText(plotTitle);
  plot=(XYTimeSeriesPlot)getView().findViewById(R.id.plot);
  plot.init(timeSeries,plotTitle,plotLowerRangeBounday,plotUpperRangeBoundary,gradientColorStart,gradientColorEnd,gradientEndCoordinateY,lineAndPointColor);
}

Fixed version (ground truth):
/** 
 * Initialize this fragment with time series data and visualization options.
 * @param seriesType  The type of the time series as specified by the PersistencyManager (e.g. PersistencyManager.TIMESERIES_TYPE_TEMPERATURE)
 * @param seriesId  The individual Id of the time series to display
 * @param maxHistorySize  The max. history size (required for loading or creating a time series)
 * @param storageLocation  The location where the history is stored (required for loading a time series)
 * @param plotTitle  The title that shall be shown above the plot
 * @param gradientColorStart  The start color of the gradient to fill the plot
 * @param gradientColorEnd  The end color of the gradient to fill the plot
 * @param gradientEndCoordinateY  The pixel y-index where the color gradient shall end (and be mirrored)
 * @param lineAndPointColor  The color of the line and all points
 */
public void init(String seriesType,String seriesId,int maxHistorySize,String storageLocation,String plotTitle,int gradientColorStart,int gradientColorEnd,int gradientEndCoordinateY,int lineAndPointColor){
  this.seriesType=seriesType;
  this.seriesId=seriesId;
  this.maxHistorySize=maxHistorySize;
  this.storageLocation=storageLocation;
  PersistencyManager pm=PersistencyManager.getInstance(getActivity());
  try {
    timeSeries=pm.load(maxHistorySize,storageLocation,seriesType,seriesId);
  }
 catch (  Exception e) {
    timeSeries=pm.create(maxHistorySize,storageLocation,seriesType,seriesId);
    e.printStackTrace();
  }
  TextView title=(TextView)getView().findViewById(R.id.plot_title);
  title.setText(plotTitle);
  plot=(XYTimeSeriesPlot)getView().findViewById(R.id.plot);
  plot.init(timeSeries,plotTitle,(int)(timeSeries.getLowestValue() - (timeSeries.getLowestValue() / 10)),(int)(timeSeries.getHighestValue() + (timeSeries.getHighestValue() / 10)),gradientColorStart,gradientColorEnd,gradientEndCoordinateY,lineAndPointColor);
}