Program: 78151
Project: 78151
Buggy source:
private void drawGraph(Stock stock){
  if (stock.getHistoricalData() == null) {
    return;
  }
  lineChart.setVisibility(View.VISIBLE);
  int index=stock.getHistoricalData().size() - 1;
  Entry[] entries=new Entry[index + 1];
  HashMap<Integer,String> xAxisValueToTextMap=new HashMap<>();
  String key=stock.getLastUpdatedDate();
  while (index >= 0) {
    if (stock.getHistoricalData().containsKey(key)) {
      entries[index]=new Entry(index,stock.getHistoricalData().get(key).floatValue());
      xAxisValueToTextMap.put(index,key);
      index--;
    }
    Date date=DateUtils.convertStringToDate(key);
    date.setTime(date.getTime() - 2);
    key=DateUtils.convertDateToString(date);
  }
  Description description=new Description();
  description.setText(StringUtils.getString(R.string.stock_history));
  lineChart.setDescription(description);
  LineDataSet lineDataSet=new LineDataSet(Arrays.asList(entries),StringUtils.getString(R.string.stock_price));
  lineChart.getAxisRight().setEnabled(false);
  lineChart.getXAxis().setValueFormatter((value,axis) -> {
    Timber.d("String_Node_Str" + value + "String_Node_Str"+ xAxisValueToTextMap.get((int)value));
    return xAxisValueToTextMap.get((int)value);
  }
);
  lineDataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
  lineDataSet.setCubicIntensity(0.2f);
  lineDataSet.setDrawCircles(false);
  lineDataSet.setLineWidth(1.8f);
  lineDataSet.setCircleRadius(4f);
  lineDataSet.setCircleColor(Color.WHITE);
  lineDataSet.setHighLightColor(Color.rgb(244,117,117));
  lineDataSet.setColor(Color.WHITE);
  lineDataSet.setFillColor(Color.WHITE);
  lineDataSet.setFillAlpha(100);
  lineDataSet.setDrawHorizontalHighlightIndicator(false);
  lineDataSet.setFillFormatter(new IFillFormatter(){
    @Override public float getFillLinePosition(    ILineDataSet dataSet,    LineDataProvider dataProvider){
      return -10;
    }
  }
);
  LineData data=new LineData(lineDataSet);
  data.setValueTextSize(9f);
  data.setDrawValues(false);
  lineChart.setData(data);
  lineChart.setMaxVisibleValueCount(10);
  lineChart.setVisibleXRangeMaximum(10);
  lineChart.moveViewToX(100);
  lineChart.setScaleX(1);
  lineDataSet.setColor(ContextCompat.getColor(StockTrackerApp.getContext(),R.color.colorPrimary));
}

Fixed version (ground truth):
private void drawGraph(Stock stock){
  if (stock.getHistoricalData() == null || stock.getHistoricalData().size() == 0 || lineChart == null) {
    return;
  }
  lineChart.setVisibility(View.VISIBLE);
  int index=stock.getHistoricalData().size() - 1;
  Entry[] entries=new Entry[index + 1];
  HashMap<Integer,String> xAxisValueToTextMap=new HashMap<>();
  String key=stock.getLastUpdatedDate();
  while (index >= 0) {
    if (stock.getHistoricalData().containsKey(key)) {
      entries[index]=new Entry(index,stock.getHistoricalData().get(key).floatValue());
      xAxisValueToTextMap.put(index,key);
      index--;
    }
    Date date=DateUtils.convertStringToDate(key);
    date.setTime(date.getTime() - 2);
    key=DateUtils.convertDateToString(date);
  }
  Description description=new Description();
  description.setText(StringUtils.getString(R.string.stock_history));
  lineChart.setDescription(description);
  LineDataSet lineDataSet=new LineDataSet(Arrays.asList(entries),StringUtils.getString(R.string.stock_price));
  lineChart.getAxisRight().setEnabled(false);
  lineChart.getXAxis().setValueFormatter((value,axis) -> {
    Timber.d("String_Node_Str" + value + "String_Node_Str"+ xAxisValueToTextMap.get((int)value));
    return xAxisValueToTextMap.get((int)value);
  }
);
  lineDataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
  lineDataSet.setCubicIntensity(0.2f);
  lineDataSet.setDrawCircles(false);
  lineDataSet.setLineWidth(1.8f);
  lineDataSet.setCircleRadius(4f);
  lineDataSet.setCircleColor(Color.WHITE);
  lineDataSet.setHighLightColor(Color.rgb(244,117,117));
  lineDataSet.setColor(Color.WHITE);
  lineDataSet.setFillColor(Color.WHITE);
  lineDataSet.setFillAlpha(100);
  lineDataSet.setDrawHorizontalHighlightIndicator(false);
  lineDataSet.setFillFormatter(new IFillFormatter(){
    @Override public float getFillLinePosition(    ILineDataSet dataSet,    LineDataProvider dataProvider){
      return -10;
    }
  }
);
  LineData data=new LineData(lineDataSet);
  data.setValueTextSize(9f);
  data.setDrawValues(false);
  lineChart.setData(data);
  lineChart.setMaxVisibleValueCount(10);
  lineChart.setVisibleXRangeMaximum(10);
  lineChart.moveViewToX(100);
  lineChart.setScaleX(1);
  lineDataSet.setColor(ContextCompat.getColor(StockTrackerApp.getContext(),R.color.holo_orange_dark));
  lineDataSet.setFillColor(ContextCompat.getColor(StockTrackerApp.getContext(),R.color.holo_orange_dark));
}