Program: 94107
Project: 94107
Buggy source:
public View onCreateView(final LayoutInflater inflater,final ViewGroup container,Bundle savedInstanceState){
  int lensListSize=(int)MainActivity.lensDBHelper.getRowCount();
  int selectedLensSize=MainActivity.lensDBHelper.getActiveLensCount();
  View view=inflater.inflate(R.layout.lensloader_layout,container,false);
  Button lensLoaderButton=(Button)view.findViewById(R.id.btnLensSelector);
  TextView totalLensesTextView=(TextView)view.findViewById(R.id.textview_total_lens_count);
  final TextView loadedLensesTextView=(TextView)view.findViewById(R.id.textview_loaded_lens_count);
  Switch loadLensSwitch=(Switch)view.findViewById(R.id.lensloader_toggle);
  Switch collectLensSwitch=(Switch)view.findViewById(R.id.lenscollector_toggle);
  Switch autoEnableSwitch=(Switch)view.findViewById(R.id.autoenable_switch);
  loadLensSwitch.setChecked(Preferences.getBool(Prefs.LENSES_LOAD));
  collectLensSwitch.setChecked(Preferences.getBool(Prefs.LENSES_COLLECT));
  autoEnableSwitch.setChecked(Preferences.getBool(Prefs.LENSES_AUTO_ENABLE));
  loadLensSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      Preferences.putBool(Prefs.LENSES_LOAD.key,isChecked);
    }
  }
);
  collectLensSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      Preferences.putBool(Prefs.LENSES_COLLECT.key,isChecked);
    }
  }
);
  autoEnableSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton compoundButton,    boolean isChecked){
      Preferences.putBool(Prefs.LENSES_AUTO_ENABLE.key,isChecked);
    }
  }
);
  totalLensesTextView.setText(String.format("String_Node_Str",lensListSize));
  loadedLensesTextView.setText(String.format("String_Node_Str",selectedLensSize));
  lensLoaderButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      DialogHelper.lensDialog(getContext(),loadedLensesTextView,inflater,container);
    }
  }
);
  return view;
}

Fixed version (ground truth):
public View onCreateView(final LayoutInflater inflater,final ViewGroup container,Bundle savedInstanceState){
  final int lensListSize=(int)MainActivity.lensDBHelper.getRowCount();
  int selectedLensSize=MainActivity.lensDBHelper.getActiveLensCount();
  View view=inflater.inflate(R.layout.lensloader_layout,container,false);
  Button lensLoaderButton=(Button)view.findViewById(R.id.btnLensSelector);
  TextView totalLensesTextView=(TextView)view.findViewById(R.id.textview_total_lens_count);
  final TextView loadedLensesTextView=(TextView)view.findViewById(R.id.textview_loaded_lens_count);
  Switch loadLensSwitch=(Switch)view.findViewById(R.id.lensloader_toggle);
  Switch collectLensSwitch=(Switch)view.findViewById(R.id.lenscollector_toggle);
  Switch autoEnableSwitch=(Switch)view.findViewById(R.id.autoenable_switch);
  loadLensSwitch.setChecked(Preferences.getBool(Prefs.LENSES_LOAD));
  collectLensSwitch.setChecked(Preferences.getBool(Prefs.LENSES_COLLECT));
  autoEnableSwitch.setChecked(Preferences.getBool(Prefs.LENSES_AUTO_ENABLE));
  loadLensSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      Preferences.putBool(Prefs.LENSES_LOAD.key,isChecked);
    }
  }
);
  collectLensSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      Preferences.putBool(Prefs.LENSES_COLLECT.key,isChecked);
    }
  }
);
  autoEnableSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton compoundButton,    boolean isChecked){
      Preferences.putBool(Prefs.LENSES_AUTO_ENABLE.key,isChecked);
    }
  }
);
  totalLensesTextView.setText(String.format("String_Node_Str",lensListSize));
  loadedLensesTextView.setText(String.format("String_Node_Str",selectedLensSize));
  lensLoaderButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (lensListSize > 0)       DialogHelper.lensDialog(getContext(),loadedLensesTextView,inflater,container);
 else       Toast.makeText(v.getContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
);
  return view;
}