Program: 143341
Project: 143341
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.pid,container,false);
  if (v == null)   throw new RuntimeException();
  mKpView=(TextView)v.findViewById(R.id.textView1);
  mKiView=(TextView)v.findViewById(R.id.textView2);
  mKdView=(TextView)v.findViewById(R.id.textView3);
  mTargetAngleView=(TextView)v.findViewById(R.id.textView4);
  mTurningView=(TextView)v.findViewById(R.id.textView5);
  mKpSeekBar=(SeekBar)v.findViewById(R.id.KpSeekBar);
  mKpSeekBar.setMax(1000);
  final TextView mKpSeekBarValue=(TextView)v.findViewById(R.id.KpValue);
  mKpSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mKpSeekBarValue.setText(String.format("String_Node_Str",(float)progress / 100.0f));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mKpSeekBar.setProgress(mKpSeekBar.getMax() / 2);
  mKiSeekBar=(SeekBar)v.findViewById(R.id.KiSeekBar);
  mKiSeekBar.setMax(1000);
  final TextView mKiSeekBarValue=(TextView)v.findViewById(R.id.KiValue);
  mKiSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mKiSeekBarValue.setText(String.format("String_Node_Str",(float)progress / 100.0f));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mKiSeekBar.setProgress(mKiSeekBar.getMax() / 2);
  mKdSeekBar=(SeekBar)v.findViewById(R.id.KdSeekBar);
  mKdSeekBar.setMax(1000);
  final TextView mKdSeekBarValue=(TextView)v.findViewById(R.id.KdValue);
  mKdSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mKdSeekBarValue.setText(String.format("String_Node_Str",(float)progress / 100.0f));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mKdSeekBar.setProgress(mKdSeekBar.getMax() / 2);
  mTargetAngleSeekBar=(SeekBar)v.findViewById(R.id.TargetAngleSeekBar);
  mTargetAngleSeekBar.setMax(6000);
  final TextView mTargetAngleSeekBarValue=(TextView)v.findViewById(R.id.TargetAngleValue);
  mTargetAngleSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mTargetAngleSeekBarValue.setText(String.format("String_Node_Str",(float)progress / 100.0f - 30.0f));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mTargetAngleSeekBar.setProgress(mTargetAngleSeekBar.getMax() / 2);
  mTurningSeekBar=(SeekBar)v.findViewById(R.id.TurningSeekBar);
  mTurningSeekBar.setMax(100);
  final TextView mTurningSeekBarValue=(TextView)v.findViewById(R.id.TurningValue);
  mTurningSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mTurningSeekBarValue.setText(Integer.toString(progress));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mTurningSeekBar.setProgress(mTurningSeekBar.getMax() / 2);
  mButton=(Button)v.findViewById(R.id.button);
  mButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
      if (activity == null || activity.mChatService == null) {
        if (D)         Log.e(TAG,"String_Node_Str");
        return;
      }
      if (activity.mChatService.getState() == BluetoothChatService.STATE_CONNECTED) {
        if (mKpSeekBarValue.getText() != null && mKiSeekBarValue.getText() != null && mKdSeekBarValue.getText() != null && (!mKpSeekBarValue.getText().equals(oldKpValue) || !mKiSeekBarValue.getText().equals(oldKiValue) || !mKdSeekBarValue.getText().equals(oldKdValue))) {
          oldKpValue=mKpSeekBarValue.getText();
          oldKiValue=mKiSeekBarValue.getText();
          oldKdValue=mKdSeekBarValue.getText();
          mHandler.post(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.setPID((int)(Float.parseFloat(mKpSeekBarValue.getText().toString()) * 100.0f),(int)(Float.parseFloat(mKiSeekBarValue.getText().toString()) * 100.0f),(int)(Float.parseFloat(mKdSeekBarValue.getText().toString()) * 100.0f));
            }
          }
);
          counter+=25;
          mHandler.post(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.getPID();
            }
          }
);
          counter+=25;
        }
        if (mTargetAngleSeekBarValue.getText() != null && !mTargetAngleSeekBarValue.getText().equals(oldTargetAngleValue)) {
          oldTargetAngleValue=mTargetAngleSeekBarValue.getText();
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.setTarget((int)(Float.parseFloat(mTargetAngleSeekBarValue.getText().toString()) * 100.0f));
            }
          }
,counter);
          counter+=25;
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.getTarget();
            }
          }
,counter);
          counter+=25;
        }
        if (mTurningSeekBarValue.getText() != null && !mTurningSeekBarValue.getText().equals(oldTurningValue)) {
          oldTurningValue=mTurningSeekBarValue.getText();
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.setTurning(Byte.parseByte(mTurningSeekBarValue.getText().toString()));
            }
          }
,counter);
          counter+=25;
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.getTurning();
            }
          }
,counter);
          counter+=25;
        }
        counter=0;
      }
    }
  }
);
  Button mKpUpArrow=(Button)v.findViewById(R.id.KpUpArrow);
  Button mKpDownArrow=(Button)v.findViewById(R.id.KpDownArrow);
  Button mKiUpArrow=(Button)v.findViewById(R.id.KiUpArrow);
  Button mKiDownArrow=(Button)v.findViewById(R.id.KiDownArrow);
  Button mKdUpArrow=(Button)v.findViewById(R.id.KdUpArrow);
  Button mKdDownArrow=(Button)v.findViewById(R.id.KdDownArrow);
  Button mTargetAngleUpArrow=(Button)v.findViewById(R.id.TargetAngleUpArrow);
  Button mTargetAngleDownArrow=(Button)v.findViewById(R.id.TargetAngleDownArrow);
  Button mTurningUpArrow=(Button)v.findViewById(R.id.TurningUpArrow);
  Button mTurningDownArrow=(Button)v.findViewById(R.id.TurningDownArrow);
  mKpUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKpSeekBar.setProgress(round10(mKpSeekBar.getProgress() + 10));
    }
  }
);
  mKpDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKpSeekBar.setProgress(round10(mKpSeekBar.getProgress() - 10));
    }
  }
);
  mKiUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKiSeekBar.setProgress(round10(mKiSeekBar.getProgress() + 10));
    }
  }
);
  mKiDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKiSeekBar.setProgress(round10(mKiSeekBar.getProgress() - 10));
    }
  }
);
  mKdUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKdSeekBar.setProgress(round10(mKdSeekBar.getProgress() + 10));
    }
  }
);
  mKdDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKdSeekBar.setProgress(round10(mKdSeekBar.getProgress() - 10));
    }
  }
);
  mTargetAngleUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mTargetAngleSeekBar.setProgress(round10(mTargetAngleSeekBar.getProgress() + 10));
    }
  }
);
  mTargetAngleDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mTargetAngleSeekBar.setProgress(round10(mTargetAngleSeekBar.getProgress() - 10));
    }
  }
);
  mTurningUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mTurningSeekBar.setProgress(mTurningSeekBar.getProgress() + 1);
    }
  }
);
  mTurningDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mTurningSeekBar.setProgress(mTurningSeekBar.getProgress() - 1);
    }
  }
);
  updateButton();
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.pid,container,false);
  if (v == null)   throw new RuntimeException();
  mKpView=(TextView)v.findViewById(R.id.textView1);
  mKiView=(TextView)v.findViewById(R.id.textView2);
  mKdView=(TextView)v.findViewById(R.id.textView3);
  mTargetAngleView=(TextView)v.findViewById(R.id.textView4);
  mTurningView=(TextView)v.findViewById(R.id.textView5);
  mKpSeekBar=(SeekBar)v.findViewById(R.id.KpSeekBar);
  mKpSeekBar.setMax(1000);
  final TextView mKpSeekBarValue=(TextView)v.findViewById(R.id.KpValue);
  mKpSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mKpSeekBarValue.setText(String.format("String_Node_Str",(float)progress / 100.0f));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mKpSeekBar.setProgress(mKpSeekBar.getMax() / 2);
  mKiSeekBar=(SeekBar)v.findViewById(R.id.KiSeekBar);
  mKiSeekBar.setMax(1000);
  final TextView mKiSeekBarValue=(TextView)v.findViewById(R.id.KiValue);
  mKiSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mKiSeekBarValue.setText(String.format("String_Node_Str",(float)progress / 100.0f));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mKiSeekBar.setProgress(mKiSeekBar.getMax() / 2);
  mKdSeekBar=(SeekBar)v.findViewById(R.id.KdSeekBar);
  mKdSeekBar.setMax(1000);
  final TextView mKdSeekBarValue=(TextView)v.findViewById(R.id.KdValue);
  mKdSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mKdSeekBarValue.setText(String.format("String_Node_Str",(float)progress / 100.0f));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mKdSeekBar.setProgress(mKdSeekBar.getMax() / 2);
  mTargetAngleSeekBar=(SeekBar)v.findViewById(R.id.TargetAngleSeekBar);
  mTargetAngleSeekBar.setMax(6000);
  final TextView mTargetAngleSeekBarValue=(TextView)v.findViewById(R.id.TargetAngleValue);
  mTargetAngleSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mTargetAngleSeekBarValue.setText(String.format("String_Node_Str",(float)progress / 100.0f - 30.0f));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mTargetAngleSeekBar.setProgress(mTargetAngleSeekBar.getMax() / 2);
  mTurningSeekBar=(SeekBar)v.findViewById(R.id.TurningSeekBar);
  mTurningSeekBar.setMax(100);
  final TextView mTurningSeekBarValue=(TextView)v.findViewById(R.id.TurningValue);
  mTurningSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromTouch){
      mTurningSeekBarValue.setText(Integer.toString(progress));
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mTurningSeekBar.setProgress(mTurningSeekBar.getMax() / 2);
  mButton=(Button)v.findViewById(R.id.button);
  mButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
      if (activity == null || activity.mChatService == null) {
        if (D)         Log.e(TAG,"String_Node_Str");
        return;
      }
      if (activity.mChatService.getState() == BluetoothChatService.STATE_CONNECTED) {
        if (mKpSeekBarValue.getText() != null && mKiSeekBarValue.getText() != null && mKdSeekBarValue.getText() != null && (!mKpSeekBarValue.getText().equals(oldKpValue) || !mKiSeekBarValue.getText().equals(oldKiValue) || !mKdSeekBarValue.getText().equals(oldKdValue))) {
          oldKpValue=mKpSeekBarValue.getText();
          oldKiValue=mKiSeekBarValue.getText();
          oldKdValue=mKdSeekBarValue.getText();
          mHandler.post(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.setPID((int)(Float.parseFloat(mKpSeekBarValue.getText().toString()) * 100.0f),(int)(Float.parseFloat(mKiSeekBarValue.getText().toString()) * 100.0f),(int)(Float.parseFloat(mKdSeekBarValue.getText().toString()) * 100.0f));
            }
          }
);
          counter+=25;
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.getPID();
            }
          }
,counter);
          counter+=25;
        }
        if (mTargetAngleSeekBarValue.getText() != null && !mTargetAngleSeekBarValue.getText().equals(oldTargetAngleValue)) {
          oldTargetAngleValue=mTargetAngleSeekBarValue.getText();
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.setTarget((int)(Float.parseFloat(mTargetAngleSeekBarValue.getText().toString()) * 100.0f));
            }
          }
,counter);
          counter+=25;
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.getTarget();
            }
          }
,counter);
          counter+=25;
        }
        if (mTurningSeekBarValue.getText() != null && !mTurningSeekBarValue.getText().equals(oldTurningValue)) {
          oldTurningValue=mTurningSeekBarValue.getText();
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.setTurning(Byte.parseByte(mTurningSeekBarValue.getText().toString()));
            }
          }
,counter);
          counter+=25;
          mHandler.postDelayed(new Runnable(){
            public void run(){
              BalancingRobotFullSizeActivity activity=(BalancingRobotFullSizeActivity)getActivity();
              if (activity != null)               activity.mChatService.mBluetoothProtocol.getTurning();
            }
          }
,counter);
          counter+=25;
        }
        counter=0;
      }
    }
  }
);
  Button mKpUpArrow=(Button)v.findViewById(R.id.KpUpArrow);
  Button mKpDownArrow=(Button)v.findViewById(R.id.KpDownArrow);
  Button mKiUpArrow=(Button)v.findViewById(R.id.KiUpArrow);
  Button mKiDownArrow=(Button)v.findViewById(R.id.KiDownArrow);
  Button mKdUpArrow=(Button)v.findViewById(R.id.KdUpArrow);
  Button mKdDownArrow=(Button)v.findViewById(R.id.KdDownArrow);
  Button mTargetAngleUpArrow=(Button)v.findViewById(R.id.TargetAngleUpArrow);
  Button mTargetAngleDownArrow=(Button)v.findViewById(R.id.TargetAngleDownArrow);
  Button mTurningUpArrow=(Button)v.findViewById(R.id.TurningUpArrow);
  Button mTurningDownArrow=(Button)v.findViewById(R.id.TurningDownArrow);
  mKpUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKpSeekBar.setProgress(round10(mKpSeekBar.getProgress() + 10));
    }
  }
);
  mKpDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKpSeekBar.setProgress(round10(mKpSeekBar.getProgress() - 10));
    }
  }
);
  mKiUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKiSeekBar.setProgress(round10(mKiSeekBar.getProgress() + 10));
    }
  }
);
  mKiDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKiSeekBar.setProgress(round10(mKiSeekBar.getProgress() - 10));
    }
  }
);
  mKdUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKdSeekBar.setProgress(round10(mKdSeekBar.getProgress() + 10));
    }
  }
);
  mKdDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mKdSeekBar.setProgress(round10(mKdSeekBar.getProgress() - 10));
    }
  }
);
  mTargetAngleUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mTargetAngleSeekBar.setProgress(round10(mTargetAngleSeekBar.getProgress() + 10));
    }
  }
);
  mTargetAngleDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mTargetAngleSeekBar.setProgress(round10(mTargetAngleSeekBar.getProgress() - 10));
    }
  }
);
  mTurningUpArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mTurningSeekBar.setProgress(mTurningSeekBar.getProgress() + 1);
    }
  }
);
  mTurningDownArrow.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      mTurningSeekBar.setProgress(mTurningSeekBar.getProgress() - 1);
    }
  }
);
  updateButton();
  return v;
}