Program: 146466
Project: 146466
Buggy source:
@Override public void createChartViews(@NonNull View rootView){
  LinearLayout chartsContainer=(LinearLayout)rootView.findViewById(R.id.ChartsContainer);
  chartsContainer.removeAllViews();
  chartsMap=new HashMap<>();
  List<String> pairs=appPreferences.getChartsToDisplay();
  LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
  lp.gravity=Gravity.CENTER;
  TextView noCharts=new TextView(getActivity());
  noCharts.setLayoutParams(lp);
  noCharts.setGravity(Gravity.CENTER);
  noCharts.setText(getString(R.string.no_charts_text));
  noCharts.setTypeface(Typeface.DEFAULT_BOLD);
  if (pairs.isEmpty()) {
    chartsContainer.addView(noCharts);
  }
  for (  String pair : pairs) {
    View chartView=LayoutInflater.from(getActivity()).inflate(R.layout.chart_item,chartsContainer,false);
    TextView namePriceView=(TextView)chartView.findViewById(R.id.chart_name_price);
    namePriceView.setText(String.format("String_Node_Str",pair));
    View tradeButton=chartView.findViewById(R.id.chart_trade_button);
    tradeButton.setEnabled(false);
    tradeButton.setOnClickListener(null);
    chartsContainer.addView(chartView);
    chartsMap.put(pair,chartView);
  }
  CompoundButton.OnCheckedChangeListener indicatorChangeStateListener=new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      ViewGroup viewGroup;
      if (getResources().getConfiguration().screenWidthDp >= 350) {
        viewGroup=(ViewGroup)buttonView.getParent().getParent().getParent();
      }
 else {
        viewGroup=(ViewGroup)buttonView.getParent();
      }
      StockChartView stockChartView=(StockChartView)viewGroup.findViewById(R.id.stockChartView);
      IndicatorManager iManager=stockChartView.getIndicatorManager();
      SeriesBase priceSeries=stockChartView.findSeriesByName(PRICE_SERIES_NAME);
      if (priceSeries != null) {
        if (isChecked) {
          onIndicatorEnabled(stockChartView,buttonView,priceSeries);
        }
 else {
          onIndicatorDisabled(stockChartView,buttonView);
        }
        stockChartView.recalcIndicators();
        stockChartView.recalc();
        stockChartView.invalidate();
      }
 else {
        SwitchCompat sw=(SwitchCompat)buttonView;
        sw.setChecked(!isChecked);
      }
    }
  }
;
  for (  String pair : chartsMap.keySet()) {
    View chartView=chartsMap.get(pair);
    ((SwitchCompat)chartView.findViewById(R.id.enableEMAIndicator)).setOnCheckedChangeListener(indicatorChangeStateListener);
    ((SwitchCompat)chartView.findViewById(R.id.enableRSIIndicator)).setOnCheckedChangeListener(indicatorChangeStateListener);
    ((SwitchCompat)chartView.findViewById(R.id.enableSMAIndicator)).setOnCheckedChangeListener(indicatorChangeStateListener);
    ((SwitchCompat)chartView.findViewById(R.id.enableMACDIndicator)).setOnCheckedChangeListener(indicatorChangeStateListener);
  }
}

Fixed version (ground truth):
@Override public void createChartViews(@NonNull View rootView){
  LinearLayout chartsContainer=(LinearLayout)rootView.findViewById(R.id.ChartsContainer);
  chartsContainer.removeAllViews();
  chartsMap=new HashMap<>();
  List<String> pairs=appPreferences.getChartsToDisplay();
  LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
  lp.gravity=Gravity.CENTER;
  TextView noCharts=new TextView(getActivity());
  noCharts.setLayoutParams(lp);
  noCharts.setGravity(Gravity.CENTER);
  noCharts.setText(getString(R.string.no_charts_text));
  noCharts.setTypeface(Typeface.DEFAULT_BOLD);
  if (pairs.isEmpty()) {
    chartsContainer.addView(noCharts);
  }
  for (  String pair : pairs) {
    View chartView=LayoutInflater.from(getActivity()).inflate(R.layout.chart_item,chartsContainer,false);
    TextView namePriceView=(TextView)chartView.findViewById(R.id.chart_name_price);
    namePriceView.setText(String.format("String_Node_Str",pair));
    View tradeButton=chartView.findViewById(R.id.chart_trade_button);
    tradeButton.setEnabled(false);
    tradeButton.setOnClickListener(null);
    chartsContainer.addView(chartView);
    chartsMap.put(pair,chartView);
  }
  CompoundButton.OnCheckedChangeListener indicatorChangeStateListener=new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      ViewGroup viewGroup;
      if (getResources().getConfiguration().screenWidthDp >= 350) {
        viewGroup=(ViewGroup)buttonView.getParent().getParent().getParent();
      }
 else {
        viewGroup=(ViewGroup)buttonView.getParent();
      }
      StockChartView stockChartView=(StockChartView)viewGroup.findViewById(R.id.stockChartView);
      SeriesBase priceSeries=stockChartView.findSeriesByName(PRICE_SERIES_NAME);
      if (priceSeries != null) {
        if (isChecked) {
          onIndicatorEnabled(stockChartView,buttonView,priceSeries);
        }
 else {
          onIndicatorDisabled(stockChartView,buttonView);
        }
        stockChartView.recalcIndicators();
        stockChartView.recalc();
        stockChartView.invalidate();
      }
 else {
        SwitchCompat sw=(SwitchCompat)buttonView;
        sw.setChecked(!isChecked);
      }
    }
  }
;
  for (  String pair : chartsMap.keySet()) {
    View chartView=chartsMap.get(pair);
    ((SwitchCompat)chartView.findViewById(R.id.enableEMAIndicator)).setOnCheckedChangeListener(indicatorChangeStateListener);
    ((SwitchCompat)chartView.findViewById(R.id.enableRSIIndicator)).setOnCheckedChangeListener(indicatorChangeStateListener);
    ((SwitchCompat)chartView.findViewById(R.id.enableSMAIndicator)).setOnCheckedChangeListener(indicatorChangeStateListener);
    ((SwitchCompat)chartView.findViewById(R.id.enableMACDIndicator)).setOnCheckedChangeListener(indicatorChangeStateListener);
  }
}