Program: 146464
Project: 146464
Buggy source:
private void updateChart(@NonNull View chartView,@NonNull final String pair,@NonNull final ChartData data){
  StockChartView stockChartView=(StockChartView)chartView.findViewById(R.id.stockChartView);
  View tradeButton=chartView.findViewById(R.id.chart_trade_button);
  TextView namePriceView=(TextView)chartView.findViewById(R.id.chart_name_price);
  if (data.last != null) {
    tradeButton.setEnabled(true);
    tradeButton.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        mainNavigator.openTradingSection(pair,new BigDecimal(data.last));
      }
    }
);
    namePriceView.setText(String.format("String_Node_Str",pair,data.last));
  }
 else {
    tradeButton.setEnabled(false);
    tradeButton.setOnClickListener(null);
    namePriceView.setText(String.format("String_Node_Str",pair,"String_Node_Str"));
  }
  stockChartView.reset();
  stockChartView.getCrosshair().setAuto(true);
  final StockSeries priceSeries=new StockSeries();
  priceSeries.setViewType(StockSeries.ViewType.CANDLESTICK);
  priceSeries.setName(PRICE_SERIES_NAME);
  Appearance riseAppearance=priceSeries.getFallAppearance();
  riseAppearance.setFillColors(RISING_FILL_COLOR);
  riseAppearance.setOutlineColor(STICK_COLOR);
  Appearance fallAppearance=priceSeries.getRiseAppearance();
  fallAppearance.setFillColors(FALLING_FILL_COLOR);
  fallAppearance.setOutlineColor(STICK_COLOR);
  final BarSeries volumeSeries=new BarSeries();
  volumeSeries.setName(VOLUME_SERIES_NAME);
  volumeSeries.setYAxisSide(Axis.Side.LEFT);
  volumeSeries.getAppearance().setAllColors(VOLUME_BAR_COLOR);
  Area area=stockChartView.addArea();
  area.getAppearance().setOutlineColor(Color.TRANSPARENT);
  TypedValue a=new TypedValue();
  getActivity().getTheme().resolveAttribute(android.R.attr.windowBackground,a,true);
  if (a.type >= TypedValue.TYPE_FIRST_COLOR_INT && a.type <= TypedValue.TYPE_LAST_COLOR_INT) {
    int color=a.data;
    area.getAppearance().setPrimaryFillColor(color);
  }
  for (  HistoryItem historyItem : data.history) {
    priceSeries.addPoint(historyItem.open,historyItem.high,historyItem.low,historyItem.close);
    volumeSeries.addPoint(0,historyItem.volume);
  }
  area.getSeries().add(volumeSeries);
  area.getSeries().add(priceSeries);
  Axis.ILabelFormatProvider bottomLfp=new Axis.ILabelFormatProvider(){
    @Override public String getAxisLabel(    Axis axis,    double v){
      int index=priceSeries.convertToArrayIndex(v);
      if (index < 0)       index=0;
      if (index >= 0) {
        if (index >= priceSeries.getPointCount())         index=priceSeries.getPointCount() - 1;
        return data.history.get(index).time.replace("String_Node_Str","String_Node_Str");
      }
      return null;
    }
  }
;
  Crosshair.ILabelFormatProvider dp=new Crosshair.ILabelFormatProvider(){
    @Override public String getLabel(    Crosshair crosshair,    Plot plot,    double v,    double v2){
      int index=priceSeries.convertToArrayIndex(v);
      if (index < 0)       index=0;
      if (index >= 0) {
        if (index >= priceSeries.getPointCount())         index=priceSeries.getPointCount() - 1;
        return data.history.get(index).time.replace("String_Node_Str","String_Node_Str") + String.format("String_Node_Str",priceText) + PRICE_DECIMAL_FORMAT.format(v2)+ String.format("String_Node_Str",volumeText)+ String.valueOf((int)(data.history.get(index).volume + 0.5f));
      }
      return null;
    }
  }
;
  stockChartView.getCrosshair().setLabelFormatProvider(dp);
  area.getRightAxis().setLabelFormatProvider(new Axis.ILabelFormatProvider(){
    @Override public String getAxisLabel(    Axis axis,    double v){
      return PRICE_DECIMAL_FORMAT.format(v);
    }
  }
);
  area.getBottomAxis().setLabelFormatProvider(bottomLfp);
  area.getLeftAxis().setVisible(false);
  Activity activity=getActivity();
  if (activity == null) {
    return;
  }
  Resources resources=getResources();
  float axisFontSize=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,13,resources.getDisplayMetrics());
  area.getBottomAxis().setSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,15,resources.getDisplayMetrics()));
  area.getRightAxis().setSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,42,resources.getDisplayMetrics()));
  area.getBottomAxis().getAppearance().getFont().setSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,12,resources.getDisplayMetrics()));
  area.getRightAxis().getAppearance().getFont().setSize(axisFontSize);
  stockChartView.getCrosshair().getAppearance().getFont().setSize(axisFontSize);
  stockChartView.invalidate();
}

Fixed version (ground truth):
private void updateChart(@NonNull View chartView,@NonNull final String pair,@NonNull final ChartData data){
  StockChartView stockChartView=(StockChartView)chartView.findViewById(R.id.stockChartView);
  View tradeButton=chartView.findViewById(R.id.chart_trade_button);
  TextView namePriceView=(TextView)chartView.findViewById(R.id.chart_name_price);
  if (data.last != null) {
    tradeButton.setEnabled(true);
    tradeButton.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        mainNavigator.openTradingSection(pair,new BigDecimal(data.last));
      }
    }
);
    namePriceView.setText(String.format("String_Node_Str",pair,data.last));
  }
 else {
    tradeButton.setEnabled(false);
    tradeButton.setOnClickListener(null);
    namePriceView.setText(String.format("String_Node_Str",pair,"String_Node_Str"));
  }
  stockChartView.reset();
  stockChartView.getCrosshair().setAuto(true);
  final StockSeries priceSeries=new StockSeries();
  priceSeries.setViewType(StockSeries.ViewType.CANDLESTICK);
  priceSeries.setName(PRICE_SERIES_NAME);
  Appearance riseAppearance=priceSeries.getFallAppearance();
  riseAppearance.setFillColors(RISING_FILL_COLOR);
  riseAppearance.setOutlineColor(STICK_COLOR);
  Appearance fallAppearance=priceSeries.getRiseAppearance();
  fallAppearance.setFillColors(FALLING_FILL_COLOR);
  fallAppearance.setOutlineColor(STICK_COLOR);
  final BarSeries volumeSeries=new BarSeries();
  volumeSeries.setName(VOLUME_SERIES_NAME);
  volumeSeries.setYAxisSide(Axis.Side.LEFT);
  volumeSeries.getAppearance().setAllColors(VOLUME_BAR_COLOR);
  Area area=stockChartView.addArea();
  area.getAppearance().setOutlineColor(Color.TRANSPARENT);
  TypedValue a=new TypedValue();
  getActivity().getTheme().resolveAttribute(android.R.attr.windowBackground,a,true);
  if (a.type >= TypedValue.TYPE_FIRST_COLOR_INT && a.type <= TypedValue.TYPE_LAST_COLOR_INT) {
    int color=a.data;
    area.getAppearance().setPrimaryFillColor(color);
  }
  for (  HistoryItem historyItem : data.history) {
    priceSeries.addPoint(historyItem.open,historyItem.high,historyItem.low,historyItem.close);
    volumeSeries.addPoint(0,historyItem.volume);
  }
  area.getSeries().add(volumeSeries);
  area.getSeries().add(priceSeries);
  Axis.ILabelFormatProvider bottomLfp=new Axis.ILabelFormatProvider(){
    @Override public String getAxisLabel(    Axis axis,    double v){
      int index=priceSeries.convertToArrayIndex(v);
      if (index < 0) {
        index=0;
      }
      if (index >= 0) {
        if (index >= priceSeries.getPointCount()) {
          index=priceSeries.getPointCount() - 1;
        }
        return data.history.get(index).time.replace("String_Node_Str","String_Node_Str");
      }
      return null;
    }
  }
;
  Crosshair.ILabelFormatProvider dp=new Crosshair.ILabelFormatProvider(){
    @Override public String getLabel(    Crosshair crosshair,    Plot plot,    double v,    double v2){
      int index=priceSeries.convertToArrayIndex(v);
      if (index < 0) {
        index=0;
      }
      if (index >= 0) {
        if (index >= priceSeries.getPointCount()) {
          index=priceSeries.getPointCount() - 1;
        }
        return data.history.get(index).time.replace("String_Node_Str","String_Node_Str") + String.format("String_Node_Str",priceText) + PRICE_DECIMAL_FORMAT.format(v2)+ String.format("String_Node_Str",volumeText)+ String.valueOf((int)(data.history.get(index).volume + 0.5f));
      }
      return null;
    }
  }
;
  stockChartView.getCrosshair().setLabelFormatProvider(dp);
  area.getRightAxis().setLabelFormatProvider(new Axis.ILabelFormatProvider(){
    @Override public String getAxisLabel(    Axis axis,    double v){
      return PRICE_DECIMAL_FORMAT.format(v);
    }
  }
);
  area.getBottomAxis().setLabelFormatProvider(bottomLfp);
  area.getLeftAxis().setVisible(false);
  Activity activity=getActivity();
  if (activity == null) {
    return;
  }
  Resources resources=getResources();
  float axisFontSize=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,13,resources.getDisplayMetrics());
  area.getBottomAxis().setSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,15,resources.getDisplayMetrics()));
  area.getRightAxis().setSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,42,resources.getDisplayMetrics()));
  area.getBottomAxis().getAppearance().getFont().setSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,12,resources.getDisplayMetrics()));
  area.getRightAxis().getAppearance().getFont().setSize(axisFontSize);
  stockChartView.getCrosshair().getAppearance().getFont().setSize(axisFontSize);
  stockChartView.invalidate();
}