Program: 35934
Project: 35934
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View v=inflater.inflate(R.layout.dashboard,container,false);
  Log.d(TAG,"String_Node_Str");
  mSettings=PreferenceManager.getDefaultSharedPreferences(getActivity());
  speedUnit=(TextView)v.findViewById(R.id.speedFieldUnit);
  avgSpeedUnit=(TextView)v.findViewById(R.id.avgSpeedUnit);
  rangeFieldUnit=(TextView)v.findViewById(R.id.rangeFieldUnit);
  consumption1Unit=(TextView)v.findViewById(R.id.consumption1Unit);
  consumption2Unit=(TextView)v.findViewById(R.id.consumption2Unit);
  outdoorTempUnit=(TextView)v.findViewById(R.id.outdoorTempUnit);
  coolantTempUnit=(TextView)v.findViewById(R.id.coolantTempUnit);
  updateDisplayedUnits();
  String radioType=mSettings.getString("String_Node_Str","String_Node_Str");
  mRadioType=(radioType.equals("String_Node_Str")) ? RadioTypes.BM53 : RadioTypes.CD53;
  changeScreenState(true);
  dashboardLayout=(RelativeLayout)v.findViewById(R.id.dashboardLayout);
  radioLayout=(LinearLayout)v.findViewById(R.id.radioAudio);
  tabletLayout=(LinearLayout)v.findViewById(R.id.tabletAudio);
  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) {
    mIsPlaying=false;
    mPlayerService.sendPauseKey();
  }
 else {
    mIsPlaying=true;
    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){
mHandler.removeCallbacks(mUpdateSeekBar);
}
@Override public void onStopTrackingTouch(SeekBar seekBar){
mHandler.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);
mBtnMusicMode=(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);
if (mRadioType == RadioTypes.BM53) {
btnVolUp.setTag(IBusCommandsEnum.BMToRadioVolumeUp.name());
btnVolDown.setTag(IBusCommandsEnum.BMToRadioVolumeDown.name());
btnPrev.setTag("String_Node_Str");
btnNext.setTag("String_Node_Str");
}
 else {
btnVolUp.setTag(IBusCommandsEnum.SWToRadioVolumeUp.name());
btnVolDown.setTag(IBusCommandsEnum.SWToRadioVolumeDown.name());
btnPrev.setTag("String_Node_Str");
btnNext.setTag("String_Node_Str");
}
btnRadioFM.setTag("String_Node_Str");
btnRadioAM.setTag("String_Node_Str");
mBtnMusicMode.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
Log.d(TAG,"String_Node_Str");
if (isChecked) {
if (!(mCurrentRadioMode == RadioModes.AUX) && mRadioType == RadioTypes.BM53) {
changeRadioMode(RadioModes.AUX);
}
radioLayout.setVisibility(View.GONE);
tabletLayout.setVisibility(View.VISIBLE);
}
 else {
if (mIsPlaying) {
mPlayerService.sendPauseKey();
}
if ((mCurrentRadioMode == RadioModes.AUX || mCurrentRadioMode == RadioModes.CD) && mRadioType == RadioTypes.BM53) {
changeRadioMode(RadioModes.Radio);
}
radioLayout.setVisibility(View.VISIBLE);
tabletLayout.setVisibility(View.GONE);
}
}
}
);
if (mRadioType == RadioTypes.CD53) {
mBtnMusicMode.setVisibility(View.GONE);
radioLayout.setVisibility(View.GONE);
tabletLayout.setVisibility(View.VISIBLE);
}
OnLongClickListener valueResetter=new OnLongClickListener(){
@Override public boolean onLongClick(View v){
IBusCommandsEnum action=IBusCommandsEnum.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(IBusCommandsEnum.BMToIKEResetFuel1.name());
fuel2Field.setTag(IBusCommandsEnum.BMToIKEResetFuel1.name());
avgSpeedField.setTag(IBusCommandsEnum.BMToIKEResetAvgSpeed.name());
fuel1Field.setOnLongClickListener(valueResetter);
fuel2Field.setOnLongClickListener(valueResetter);
avgSpeedField.setOnLongClickListener(valueResetter);
OnClickListener clickSingleAction=new OnClickListener(){
@Override public void onClick(View v){
sendIBusCommand(IBusCommandsEnum.valueOf(v.getTag().toString()));
}
}
;
OnTouchListener touchAction=new OnTouchListener(){
@SuppressLint("String_Node_Str") @Override public boolean onTouch(View v,MotionEvent event){
String action=(event.getAction() == MotionEvent.ACTION_DOWN) ? "String_Node_Str" : "String_Node_Str";
sendIBusCommand(IBusCommandsEnum.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);
boolean geoAvailable=mSettings.getBoolean("String_Node_Str",false);
if (!geoAvailable) {
int layoutMargin=(int)(230 * getResources().getDisplayMetrics().density + 0.5f);
View geoLayout=v.findViewById(R.id.geoLayout);
View geoLocation=v.findViewById(R.id.geoLocation);
geoLayout.setVisibility(View.GONE);
geoLocation.setVisibility(View.GONE);
LinearLayout.LayoutParams tempLayoutParams=(LinearLayout.LayoutParams)v.findViewById(R.id.tempLayout).getLayoutParams();
tempLayoutParams.setMargins(layoutMargin,0,0,0);
LinearLayout.LayoutParams consumptionLayoutParams=(LinearLayout.LayoutParams)v.findViewById(R.id.consumptionLayout).getLayoutParams();
consumptionLayoutParams.setMargins(layoutMargin,0,0,0);
}
return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View v=inflater.inflate(R.layout.dashboard,container,false);
  Log.d(TAG,"String_Node_Str");
  mSettings=PreferenceManager.getDefaultSharedPreferences(getActivity());
  speedUnit=(TextView)v.findViewById(R.id.speedFieldUnit);
  avgSpeedUnit=(TextView)v.findViewById(R.id.avgSpeedUnit);
  rangeFieldUnit=(TextView)v.findViewById(R.id.rangeFieldUnit);
  consumption1Unit=(TextView)v.findViewById(R.id.consumption1Unit);
  consumption2Unit=(TextView)v.findViewById(R.id.consumption2Unit);
  outdoorTempUnit=(TextView)v.findViewById(R.id.outdoorTempUnit);
  coolantTempUnit=(TextView)v.findViewById(R.id.coolantTempUnit);
  updateDisplayedUnits();
  String radioType=mSettings.getString("String_Node_Str","String_Node_Str");
  mRadioType=(radioType.equals("String_Node_Str")) ? RadioTypes.BM53 : RadioTypes.CD53;
  changeScreenState(true);
  dashboardLayout=(RelativeLayout)v.findViewById(R.id.dashboardLayout);
  radioLayout=(LinearLayout)v.findViewById(R.id.radioAudio);
  tabletLayout=(LinearLayout)v.findViewById(R.id.tabletAudio);
  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) {
    mIsPlaying=false;
    mPlayerService.sendPauseKey();
  }
 else {
    mIsPlaying=true;
    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){
mHandler.removeCallbacks(mUpdateSeekBar);
}
@Override public void onStopTrackingTouch(SeekBar seekBar){
mHandler.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);
mBtnMusicMode=(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);
if (mRadioType == RadioTypes.BM53) {
btnVolUp.setTag(IBusCommandsEnum.BMToRadioVolumeUp.name());
btnVolDown.setTag(IBusCommandsEnum.BMToRadioVolumeDown.name());
btnPrev.setTag("String_Node_Str");
btnNext.setTag("String_Node_Str");
}
 else {
btnVolUp.setTag(IBusCommandsEnum.SWToRadioVolumeUp.name());
btnVolDown.setTag(IBusCommandsEnum.SWToRadioVolumeDown.name());
btnPrev.setTag("String_Node_Str");
btnNext.setTag("String_Node_Str");
}
btnRadioFM.setTag("String_Node_Str");
btnRadioAM.setTag("String_Node_Str");
mBtnMusicMode.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
Log.d(TAG,"String_Node_Str");
if (isChecked) {
if (!(mCurrentRadioMode == RadioModes.AUX) && mRadioType == RadioTypes.BM53) {
changeRadioMode(RadioModes.AUX);
}
radioLayout.setVisibility(View.GONE);
tabletLayout.setVisibility(View.VISIBLE);
}
 else {
if (mIsPlaying) {
mPlayerService.sendPauseKey();
}
if ((mCurrentRadioMode == RadioModes.AUX || mCurrentRadioMode == RadioModes.CD) && mRadioType == RadioTypes.BM53) {
changeRadioMode(RadioModes.Radio);
}
radioLayout.setVisibility(View.VISIBLE);
tabletLayout.setVisibility(View.GONE);
}
}
}
);
if (mRadioType == RadioTypes.CD53) {
mCurrentRadioMode=RadioModes.AUX;
mBtnMusicMode.setVisibility(View.GONE);
radioLayout.setVisibility(View.GONE);
tabletLayout.setVisibility(View.VISIBLE);
}
OnLongClickListener valueResetter=new OnLongClickListener(){
@Override public boolean onLongClick(View v){
IBusCommandsEnum action=IBusCommandsEnum.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(IBusCommandsEnum.BMToIKEResetFuel1.name());
fuel2Field.setTag(IBusCommandsEnum.BMToIKEResetFuel1.name());
avgSpeedField.setTag(IBusCommandsEnum.BMToIKEResetAvgSpeed.name());
fuel1Field.setOnLongClickListener(valueResetter);
fuel2Field.setOnLongClickListener(valueResetter);
avgSpeedField.setOnLongClickListener(valueResetter);
OnClickListener clickSingleAction=new OnClickListener(){
@Override public void onClick(View v){
sendIBusCommand(IBusCommandsEnum.valueOf(v.getTag().toString()));
}
}
;
OnTouchListener touchAction=new OnTouchListener(){
@SuppressLint("String_Node_Str") @Override public boolean onTouch(View v,MotionEvent event){
String action=(event.getAction() == MotionEvent.ACTION_DOWN) ? "String_Node_Str" : "String_Node_Str";
sendIBusCommand(IBusCommandsEnum.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);
boolean geoAvailable=mSettings.getBoolean("String_Node_Str",false);
if (!geoAvailable) {
int layoutMargin=(int)(230 * getResources().getDisplayMetrics().density + 0.5f);
View geoLayout=v.findViewById(R.id.geoLayout);
View geoLocation=v.findViewById(R.id.geoLocation);
geoLayout.setVisibility(View.GONE);
geoLocation.setVisibility(View.GONE);
LinearLayout.LayoutParams tempLayoutParams=(LinearLayout.LayoutParams)v.findViewById(R.id.tempLayout).getLayoutParams();
tempLayoutParams.setMargins(layoutMargin,0,0,0);
LinearLayout.LayoutParams consumptionLayoutParams=(LinearLayout.LayoutParams)v.findViewById(R.id.consumptionLayout).getLayoutParams();
consumptionLayoutParams.setMargins(layoutMargin,0,0,0);
}
return v;
}