Program: 86984
Project: 86984
Buggy source:
private void addRadioButtonLists(LayoutInflater inflater){
  final List<OverlappingEnvironmentIdsWithResolved> environmentIdsWithResolved=SharedPreferencesHelper.getAllEnvironmentOverlaps(getActivity());
  for (  final OverlappingEnvironmentIdsWithResolved resolved : environmentIdsWithResolved) {
    ListView listView=new ListView(getActivity());
    AdapterView.OnItemClickListener listener=new AdapterView.OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> parent,      View view,      int position,      long id){
        resolved.setResolvedEnvId(resolved.getOverlappingEnvIds().get(position));
        resolved.getBareboneEnvironmentList(getActivity());
        SharedPreferencesHelper.setEnvironmentOverlapChoice(resolved.getBareboneEnvironmentList(getActivity()),resolved.getResolvedEnvId(),getActivity());
        getActivity().startService(BaseService.getServiceIntent(getActivity(),null,BaseService.ACTION_DETECT_ENVIRONMENT));
      }
    }
;
    RadioButtonListAdapter<Environment> adapter=new RadioButtonListAdapter<Environment>(getActivity(),R.layout.list_item_environment_overlap,R.id.radio_button_environment_overlap,resolved.getBareboneEnvironmentList(getActivity()),listener);
    listView.setAdapter(adapter);
    adapter.setSelectedPosition(resolved.getResolvedEnvIndex());
    LinearLayout.LayoutParams listParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,mListPreferredItemHeight * resolved.getOverlappingEnvIds().size());
    listParams.setMargins(mVerticalPadding,mHorizontalPadding,mVerticalPadding,0);
    listView.setLayoutParams(listParams);
    listView.setBackgroundColor(Color.WHITE);
    listView.setDividerHeight(0);
    mLinearLayout.addView(listView);
    View separatorView=inflater.inflate(R.layout.shadow_separator,mLinearLayout,false);
    LinearLayout.LayoutParams separatorParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    separatorParams.setMargins(mVerticalPadding,0,mVerticalPadding,0);
    separatorView.setLayoutParams(separatorParams);
    mLinearLayout.addView(separatorView);
  }
}

Fixed version (ground truth):
private void addRadioButtonLists(LayoutInflater inflater){
  final List<OverlappingEnvironmentIdsWithResolved> environmentIdsWithResolved=SharedPreferencesHelper.getAllEnvironmentOverlaps(getActivity());
  if (environmentIdsWithResolved == null || environmentIdsWithResolved.size() == 0) {
    isEmpty=true;
    return;
  }
  for (  final OverlappingEnvironmentIdsWithResolved resolved : environmentIdsWithResolved) {
    ListView listView=new ListView(getActivity());
    AdapterView.OnItemClickListener listener=new AdapterView.OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> parent,      View view,      int position,      long id){
        resolved.setResolvedEnvId(resolved.getOverlappingEnvIds().get(position));
        resolved.getBareboneEnvironmentList(getActivity());
        SharedPreferencesHelper.setEnvironmentOverlapChoice(resolved.getBareboneEnvironmentList(getActivity()),resolved.getResolvedEnvId(),getActivity());
        getActivity().startService(BaseService.getServiceIntent(getActivity(),null,BaseService.ACTION_DETECT_ENVIRONMENT));
      }
    }
;
    RadioButtonListAdapter<Environment> adapter=new RadioButtonListAdapter<Environment>(getActivity(),R.layout.list_item_environment_overlap,R.id.radio_button_environment_overlap,resolved.getBareboneEnvironmentList(getActivity()),listener);
    listView.setAdapter(adapter);
    adapter.setSelectedPosition(resolved.getResolvedEnvIndex());
    LinearLayout.LayoutParams listParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,mListPreferredItemHeight * resolved.getOverlappingEnvIds().size());
    listParams.setMargins(mVerticalPadding,mHorizontalPadding,mVerticalPadding,0);
    listView.setLayoutParams(listParams);
    listView.setBackgroundColor(Color.WHITE);
    listView.setDividerHeight(0);
    mLinearLayout.addView(listView);
    View separatorView=inflater.inflate(R.layout.shadow_separator,mLinearLayout,false);
    LinearLayout.LayoutParams separatorParams=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
    separatorParams.setMargins(mVerticalPadding,0,mVerticalPadding,0);
    separatorView.setLayoutParams(separatorParams);
    mLinearLayout.addView(separatorView);
  }
}