Program: 35960
Project: 35960
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View v=inflater.inflate(R.layout.main_activity,container,false);
  radioLayout=(LinearLayout)v.findViewById(R.id.radioAudio);
  tabletLayout=(LinearLayout)v.findViewById(R.id.tabletAudio);
  bindServices(true);
  getActivity().getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);
  mPlayerPrevBtn=(ImageButton)v.findViewById(R.id.playerPrevBtn);
  mPlayerControlBtn=(ImageButton)v.findViewById(R.id.playerPlayPauseBtn);
  mPlayerNextBtn=(ImageButton)v.findViewById(R.id.playerNextBtn);
  mPlayerTitleText=(TextView)v.findViewById(R.id.playerTitleField);
  mPlayerAlbumText=(TextView)v.findViewById(R.id.playerAlbumField);
  mPlayerArtistText=(TextView)v.findViewById(R.id.playerArtistField);
  mPlayerArtwork=(ImageView)v.findViewById(R.id.albumArt);
  mPlayerScrubBar=(SeekBar)v.findViewById(R.id.playerTrackBar);
  OnClickListener playerClickListener=new OnClickListener(){
    @Override public void onClick(    View v){
      if (mPlayerBound) {
switch (v.getId()) {
case R.id.playerPrevBtn:
          mPlayerService.sendPreviousKey();
        break;
case R.id.playerNextBtn:
      mPlayerService.sendNextKey();
    break;
case R.id.playerPlayPauseBtn:
  if (mIsPlaying) {
    mPlayerService.sendPauseKey();
  }
 else {
    mPlayerService.sendPlayKey();
  }
break;
}
}
}
}
;
mPlayerPrevBtn.setOnClickListener(playerClickListener);
mPlayerNextBtn.setOnClickListener(playerClickListener);
mPlayerControlBtn.setOnClickListener(playerClickListener);
mPlayerScrubBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
if (mPlayerBound && fromUser) {
mPlayerService.seekTo(mSongDuration * progress / seekBar.getMax());
}
}
@Override public void onStartTrackingTouch(SeekBar seekBar){
mPlayerHandler.removeCallbacks(mUpdateSeekBar);
}
@Override public void onStopTrackingTouch(SeekBar seekBar){
mPlayerHandler.post(mUpdateSeekBar);
}
}
);
ImageButton btnVolUp=(ImageButton)v.findViewById(R.id.btnVolUp);
ImageButton btnVolDown=(ImageButton)v.findViewById(R.id.btnVolDown);
Button btnRadioFM=(Button)v.findViewById(R.id.btnRadioFM);
Button btnRadioAM=(Button)v.findViewById(R.id.btnRadioAM);
Switch btnMusicMode=(Switch)v.findViewById(R.id.btnMusicMode);
ImageButton btnPrev=(ImageButton)v.findViewById(R.id.btnPrev);
ImageButton btnNext=(ImageButton)v.findViewById(R.id.btnNext);
stationText=(TextView)v.findViewById(R.id.stationText);
radioRDSIndicatorField=(TextView)v.findViewById(R.id.radioRDSIndicator);
radioStereoIndicatorField=(TextView)v.findViewById(R.id.radioStereoIndicator);
radioProgramField=(TextView)v.findViewById(R.id.radioProgram);
radioBroadcastField=(TextView)v.findViewById(R.id.radioBroadcast);
speedField=(TextView)v.findViewById(R.id.speedField);
rpmField=(TextView)v.findViewById(R.id.rpmField);
rangeField=(TextView)v.findViewById(R.id.rangeField);
fuel1Field=(TextView)v.findViewById(R.id.consumption1);
fuel2Field=(TextView)v.findViewById(R.id.consumption2);
avgSpeedField=(TextView)v.findViewById(R.id.avgSpeed);
outTempField=(TextView)v.findViewById(R.id.outdoorTempField);
coolantTempField=(TextView)v.findViewById(R.id.coolantTempField);
geoCoordinatesField=(TextView)v.findViewById(R.id.geoCoordinatesField);
geoStreetField=(TextView)v.findViewById(R.id.geoStreetField);
geoLocaleField=(TextView)v.findViewById(R.id.geoLocaleField);
geoAltitudeField=(TextView)v.findViewById(R.id.geoAltitudeField);
dateField=(TextView)v.findViewById(R.id.dateField);
timeField=(TextView)v.findViewById(R.id.timeField);
btnVolUp.setTag(IBusCommands.BMToRadioVolumeUp.name());
btnVolDown.setTag(IBusCommands.BMToRadioVolumeDown.name());
btnRadioFM.setTag("String_Node_Str");
btnRadioAM.setTag("String_Node_Str");
btnPrev.setTag("String_Node_Str");
btnNext.setTag("String_Node_Str");
btnMusicMode.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
if (isChecked) {
radioLayout.setVisibility(View.GONE);
tabletLayout.setVisibility(View.VISIBLE);
if (!currentRadioMode.equals("String_Node_Str")) changeRadioMode(radioModes.AUX);
}
 else {
if (mIsPlaying) mPlayerService.sendPauseKey();
radioLayout.setVisibility(View.VISIBLE);
tabletLayout.setVisibility(View.GONE);
if (currentRadioMode.equals("String_Node_Str") || currentRadioMode.equals("String_Node_Str")) changeRadioMode(radioModes.Radio);
}
}
}
);
OnLongClickListener valueResetter=new OnLongClickListener(){
@Override public boolean onLongClick(View v){
IBusCommands action=IBusCommands.valueOf(v.getTag().toString());
switch (action) {
case BMToIKEResetFuel1:
showToast("String_Node_Str");
break;
case BMToIKEResetFuel2:
showToast("String_Node_Str");
break;
case BMToIKEResetAvgSpeed:
showToast("String_Node_Str");
break;
default :
break;
}
sendIBusCommand(action);
return true;
}
}
;
fuel1Field.setTag(IBusCommands.BMToIKEResetFuel1.name());
fuel2Field.setTag(IBusCommands.BMToIKEResetFuel1.name());
avgSpeedField.setTag(IBusCommands.BMToIKEResetAvgSpeed.name());
fuel1Field.setOnLongClickListener(valueResetter);
fuel2Field.setOnLongClickListener(valueResetter);
avgSpeedField.setOnLongClickListener(valueResetter);
OnClickListener clickSingleAction=new OnClickListener(){
@Override public void onClick(View v){
sendIBusCommand(IBusCommands.valueOf(v.getTag().toString()));
}
}
;
OnTouchListener touchAction=new OnTouchListener(){
@Override public boolean onTouch(View v,MotionEvent event){
String action=(event.getAction() == MotionEvent.ACTION_DOWN) ? "String_Node_Str" : "String_Node_Str";
sendIBusCommand(IBusCommands.valueOf(v.getTag().toString() + action));
return false;
}
}
;
btnVolUp.setOnClickListener(clickSingleAction);
btnVolDown.setOnClickListener(clickSingleAction);
btnRadioFM.setOnTouchListener(touchAction);
btnRadioAM.setOnTouchListener(touchAction);
btnPrev.setOnTouchListener(touchAction);
btnNext.setOnTouchListener(touchAction);
return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View v=inflater.inflate(R.layout.main_activity,container,false);
  radioLayout=(LinearLayout)v.findViewById(R.id.radioAudio);
  tabletLayout=(LinearLayout)v.findViewById(R.id.tabletAudio);
  bindServices();
  getActivity().getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);
  mPlayerPrevBtn=(ImageButton)v.findViewById(R.id.playerPrevBtn);
  mPlayerControlBtn=(ImageButton)v.findViewById(R.id.playerPlayPauseBtn);
  mPlayerNextBtn=(ImageButton)v.findViewById(R.id.playerNextBtn);
  mPlayerTitleText=(TextView)v.findViewById(R.id.playerTitleField);
  mPlayerAlbumText=(TextView)v.findViewById(R.id.playerAlbumField);
  mPlayerArtistText=(TextView)v.findViewById(R.id.playerArtistField);
  mPlayerArtwork=(ImageView)v.findViewById(R.id.albumArt);
  mPlayerScrubBar=(SeekBar)v.findViewById(R.id.playerTrackBar);
  OnClickListener playerClickListener=new OnClickListener(){
    @Override public void onClick(    View v){
      if (mPlayerBound) {
switch (v.getId()) {
case R.id.playerPrevBtn:
          mPlayerService.sendPreviousKey();
        break;
case R.id.playerNextBtn:
      mPlayerService.sendNextKey();
    break;
case R.id.playerPlayPauseBtn:
  if (mIsPlaying) {
    mPlayerService.sendPauseKey();
  }
 else {
    mPlayerService.sendPlayKey();
  }
break;
}
}
}
}
;
mPlayerPrevBtn.setOnClickListener(playerClickListener);
mPlayerNextBtn.setOnClickListener(playerClickListener);
mPlayerControlBtn.setOnClickListener(playerClickListener);
mPlayerScrubBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
if (mPlayerBound && fromUser) {
mPlayerService.seekTo(mSongDuration * progress / seekBar.getMax());
}
}
@Override public void onStartTrackingTouch(SeekBar seekBar){
mPlayerHandler.removeCallbacks(mUpdateSeekBar);
}
@Override public void onStopTrackingTouch(SeekBar seekBar){
mPlayerHandler.post(mUpdateSeekBar);
}
}
);
ImageButton btnVolUp=(ImageButton)v.findViewById(R.id.btnVolUp);
ImageButton btnVolDown=(ImageButton)v.findViewById(R.id.btnVolDown);
Button btnRadioFM=(Button)v.findViewById(R.id.btnRadioFM);
Button btnRadioAM=(Button)v.findViewById(R.id.btnRadioAM);
Switch btnMusicMode=(Switch)v.findViewById(R.id.btnMusicMode);
ImageButton btnPrev=(ImageButton)v.findViewById(R.id.btnPrev);
ImageButton btnNext=(ImageButton)v.findViewById(R.id.btnNext);
stationText=(TextView)v.findViewById(R.id.stationText);
radioRDSIndicatorField=(TextView)v.findViewById(R.id.radioRDSIndicator);
radioStereoIndicatorField=(TextView)v.findViewById(R.id.radioStereoIndicator);
radioProgramField=(TextView)v.findViewById(R.id.radioProgram);
radioBroadcastField=(TextView)v.findViewById(R.id.radioBroadcast);
speedField=(TextView)v.findViewById(R.id.speedField);
rpmField=(TextView)v.findViewById(R.id.rpmField);
rangeField=(TextView)v.findViewById(R.id.rangeField);
fuel1Field=(TextView)v.findViewById(R.id.consumption1);
fuel2Field=(TextView)v.findViewById(R.id.consumption2);
avgSpeedField=(TextView)v.findViewById(R.id.avgSpeed);
outTempField=(TextView)v.findViewById(R.id.outdoorTempField);
coolantTempField=(TextView)v.findViewById(R.id.coolantTempField);
geoCoordinatesField=(TextView)v.findViewById(R.id.geoCoordinatesField);
geoStreetField=(TextView)v.findViewById(R.id.geoStreetField);
geoLocaleField=(TextView)v.findViewById(R.id.geoLocaleField);
geoAltitudeField=(TextView)v.findViewById(R.id.geoAltitudeField);
dateField=(TextView)v.findViewById(R.id.dateField);
timeField=(TextView)v.findViewById(R.id.timeField);
btnVolUp.setTag(IBusCommands.BMToRadioVolumeUp.name());
btnVolDown.setTag(IBusCommands.BMToRadioVolumeDown.name());
btnRadioFM.setTag("String_Node_Str");
btnRadioAM.setTag("String_Node_Str");
btnPrev.setTag("String_Node_Str");
btnNext.setTag("String_Node_Str");
btnMusicMode.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
if (isChecked) {
radioLayout.setVisibility(View.GONE);
tabletLayout.setVisibility(View.VISIBLE);
if (!currentRadioMode.equals("String_Node_Str")) changeRadioMode(radioModes.AUX);
}
 else {
if (mIsPlaying) mPlayerService.sendPauseKey();
radioLayout.setVisibility(View.VISIBLE);
tabletLayout.setVisibility(View.GONE);
if (currentRadioMode.equals("String_Node_Str") || currentRadioMode.equals("String_Node_Str")) changeRadioMode(radioModes.Radio);
}
}
}
);
OnLongClickListener valueResetter=new OnLongClickListener(){
@Override public boolean onLongClick(View v){
IBusCommands action=IBusCommands.valueOf(v.getTag().toString());
switch (action) {
case BMToIKEResetFuel1:
showToast("String_Node_Str");
break;
case BMToIKEResetFuel2:
showToast("String_Node_Str");
break;
case BMToIKEResetAvgSpeed:
showToast("String_Node_Str");
break;
default :
break;
}
sendIBusCommand(action);
return true;
}
}
;
fuel1Field.setTag(IBusCommands.BMToIKEResetFuel1.name());
fuel2Field.setTag(IBusCommands.BMToIKEResetFuel1.name());
avgSpeedField.setTag(IBusCommands.BMToIKEResetAvgSpeed.name());
fuel1Field.setOnLongClickListener(valueResetter);
fuel2Field.setOnLongClickListener(valueResetter);
avgSpeedField.setOnLongClickListener(valueResetter);
OnClickListener clickSingleAction=new OnClickListener(){
@Override public void onClick(View v){
sendIBusCommand(IBusCommands.valueOf(v.getTag().toString()));
}
}
;
OnTouchListener touchAction=new OnTouchListener(){
@Override public boolean onTouch(View v,MotionEvent event){
String action=(event.getAction() == MotionEvent.ACTION_DOWN) ? "String_Node_Str" : "String_Node_Str";
sendIBusCommand(IBusCommands.valueOf(v.getTag().toString() + action));
return false;
}
}
;
btnVolUp.setOnClickListener(clickSingleAction);
btnVolDown.setOnClickListener(clickSingleAction);
btnRadioFM.setOnTouchListener(touchAction);
btnRadioAM.setOnTouchListener(touchAction);
btnPrev.setOnTouchListener(touchAction);
btnNext.setOnTouchListener(touchAction);
return v;
}