Program: 113324
Project: 113324
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
  View view=inflater.inflate(R.layout.time_picker_dialog,null);
  KeyboardListener keyboardListener=new KeyboardListener();
  view.findViewById(R.id.time_picker_dialog).setOnKeyListener(keyboardListener);
  Resources res=getResources();
  mHourPickerDescription=res.getString(R.string.hour_picker_description);
  mSelectHours=res.getString(R.string.select_hours);
  mMinutePickerDescription=res.getString(R.string.minute_picker_description);
  mSelectMinutes=res.getString(R.string.select_minutes);
  mBlue=res.getColor(R.color.blue);
  mBlack=res.getColor(R.color.numbers_text_color);
  mHourView=(TextView)view.findViewById(R.id.hours);
  mHourView.setOnKeyListener(keyboardListener);
  mHourSpaceView=(TextView)view.findViewById(R.id.hour_space);
  mMinuteSpaceView=(TextView)view.findViewById(R.id.minutes_space);
  mMinuteView=(TextView)view.findViewById(R.id.minutes);
  mMinuteView.setOnKeyListener(keyboardListener);
  mAmPmTextView=(TextView)view.findViewById(R.id.ampm_label);
  mAmPmTextView.setOnKeyListener(keyboardListener);
  String[] amPmTexts=new DateFormatSymbols().getAmPmStrings();
  mAmText=amPmTexts[0];
  mPmText=amPmTexts[1];
  mTimePicker=(RadialPickerLayout)view.findViewById(R.id.time_picker);
  mTimePicker.setOnValueSelectedListener(this);
  mTimePicker.setOnKeyListener(keyboardListener);
  mTimePicker.initialize(getActivity(),mInitialHourOfDay,mInitialMinute,mIs24HourMode);
  int currentItemShowing=HOUR_INDEX;
  if (savedInstanceState != null && savedInstanceState.containsKey(KEY_CURRENT_ITEM_SHOWING)) {
    currentItemShowing=savedInstanceState.getInt(KEY_CURRENT_ITEM_SHOWING);
  }
  setCurrentItemShowing(currentItemShowing,false,true,true);
  mTimePicker.invalidate();
  mHourView.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      setCurrentItemShowing(HOUR_INDEX,true,false,true);
      mTimePicker.tryVibrate();
    }
  }
);
  mMinuteView.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      setCurrentItemShowing(MINUTE_INDEX,true,false,true);
      mTimePicker.tryVibrate();
    }
  }
);
  mDoneButton=(TextView)view.findViewById(R.id.done_button);
  mDoneButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (mInKbMode && isTypedTimeFullyLegal()) {
        finishKbMode(false);
      }
 else {
        mTimePicker.tryVibrate();
      }
      if (mCallback != null) {
        mCallback.onTimeSet(mTimePicker,mTimePicker.getHours(),mTimePicker.getMinutes());
      }
      dismiss();
    }
  }
);
  mDoneButton.setOnKeyListener(keyboardListener);
  mAmPmHitspace=view.findViewById(R.id.ampm_hitspace);
  if (mIs24HourMode) {
    mAmPmTextView.setVisibility(View.GONE);
    RelativeLayout.LayoutParams paramsSeparator=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
    paramsSeparator.addRule(RelativeLayout.CENTER_IN_PARENT);
    TextView separatorView=(TextView)view.findViewById(R.id.separator);
    separatorView.setLayoutParams(paramsSeparator);
  }
 else {
    mAmPmTextView.setVisibility(View.VISIBLE);
    updateAmPmDisplay(mInitialHourOfDay < 12 ? AM : PM);
    mAmPmHitspace.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        mTimePicker.tryVibrate();
        int amOrPm=mTimePicker.getIsCurrentlyAmOrPm();
        if (amOrPm == AM) {
          amOrPm=PM;
        }
 else         if (amOrPm == PM) {
          amOrPm=AM;
        }
        updateAmPmDisplay(amOrPm);
        mTimePicker.setAmOrPm(amOrPm);
      }
    }
);
  }
  mAllowAutoAdvance=true;
  setHour(mInitialHourOfDay,true);
  setMinute(mInitialMinute);
  mDoublePlaceholderText=res.getString(R.string.time_placeholder);
  mDeletedKeyFormat=res.getString(R.string.deleted_key);
  mPlaceholderText=mDoublePlaceholderText.charAt(0);
  mAmKeyCode=mPmKeyCode=-1;
  generateLegalTimesTree();
  if (mInKbMode) {
    mTypedTimes=savedInstanceState.getIntegerArrayList(KEY_TYPED_TIMES);
    tryStartingKbMode(-1);
    mHourView.invalidate();
  }
 else   if (mTypedTimes == null) {
    mTypedTimes=new ArrayList<Integer>();
  }
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
  View view=inflater.inflate(R.layout.time_picker_dialog,null);
  KeyboardListener keyboardListener=new KeyboardListener();
  view.findViewById(R.id.time_picker_dialog).setOnKeyListener(keyboardListener);
  Resources res=getResources();
  mHourPickerDescription=res.getString(R.string.hour_picker_description);
  mSelectHours=res.getString(R.string.select_hours);
  mMinutePickerDescription=res.getString(R.string.minute_picker_description);
  mSelectMinutes=res.getString(R.string.select_minutes);
  mBlue=res.getColor(R.color.blue);
  mBlack=res.getColor(R.color.numbers_text_color);
  mHourView=(TextView)view.findViewById(R.id.hours);
  mHourView.setOnKeyListener(keyboardListener);
  mHourSpaceView=(TextView)view.findViewById(R.id.hour_space);
  mMinuteSpaceView=(TextView)view.findViewById(R.id.minutes_space);
  mMinuteView=(TextView)view.findViewById(R.id.minutes);
  mMinuteView.setOnKeyListener(keyboardListener);
  mAmPmTextView=(TextView)view.findViewById(R.id.ampm_label);
  mAmPmTextView.setOnKeyListener(keyboardListener);
  String[] amPmTexts=new DateFormatSymbols().getAmPmStrings();
  mAmText=amPmTexts[0];
  mPmText=amPmTexts[1];
  mTimePicker=(RadialPickerLayout)view.findViewById(R.id.time_picker);
  mTimePicker.setOnValueSelectedListener(this);
  mTimePicker.setOnKeyListener(keyboardListener);
  mTimePicker.initialize(getActivity(),this,mInitialHourOfDay,mInitialMinute,mIs24HourMode);
  int currentItemShowing=HOUR_INDEX;
  if (savedInstanceState != null && savedInstanceState.containsKey(KEY_CURRENT_ITEM_SHOWING)) {
    currentItemShowing=savedInstanceState.getInt(KEY_CURRENT_ITEM_SHOWING);
  }
  setCurrentItemShowing(currentItemShowing,false,true,true);
  mTimePicker.invalidate();
  mHapticFeedbackController=new HapticFeedbackController(getActivity());
  mHourView.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      setCurrentItemShowing(HOUR_INDEX,true,false,true);
      tryVibrate();
    }
  }
);
  mMinuteView.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      setCurrentItemShowing(MINUTE_INDEX,true,false,true);
      tryVibrate();
    }
  }
);
  mDoneButton=(TextView)view.findViewById(R.id.done_button);
  mDoneButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (mInKbMode && isTypedTimeFullyLegal()) {
        finishKbMode(false);
      }
 else {
        tryVibrate();
      }
      if (mCallback != null) {
        mCallback.onTimeSet(mTimePicker,mTimePicker.getHours(),mTimePicker.getMinutes());
      }
      dismiss();
    }
  }
);
  mDoneButton.setOnKeyListener(keyboardListener);
  mAmPmHitspace=view.findViewById(R.id.ampm_hitspace);
  if (mIs24HourMode) {
    mAmPmTextView.setVisibility(View.GONE);
    RelativeLayout.LayoutParams paramsSeparator=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
    paramsSeparator.addRule(RelativeLayout.CENTER_IN_PARENT);
    TextView separatorView=(TextView)view.findViewById(R.id.separator);
    separatorView.setLayoutParams(paramsSeparator);
  }
 else {
    mAmPmTextView.setVisibility(View.VISIBLE);
    updateAmPmDisplay(mInitialHourOfDay < 12 ? AM : PM);
    mAmPmHitspace.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        tryVibrate();
        int amOrPm=mTimePicker.getIsCurrentlyAmOrPm();
        if (amOrPm == AM) {
          amOrPm=PM;
        }
 else         if (amOrPm == PM) {
          amOrPm=AM;
        }
        updateAmPmDisplay(amOrPm);
        mTimePicker.setAmOrPm(amOrPm);
      }
    }
);
  }
  mAllowAutoAdvance=true;
  setHour(mInitialHourOfDay,true);
  setMinute(mInitialMinute);
  mDoublePlaceholderText=res.getString(R.string.time_placeholder);
  mDeletedKeyFormat=res.getString(R.string.deleted_key);
  mPlaceholderText=mDoublePlaceholderText.charAt(0);
  mAmKeyCode=mPmKeyCode=-1;
  generateLegalTimesTree();
  if (mInKbMode) {
    mTypedTimes=savedInstanceState.getIntegerArrayList(KEY_TYPED_TIMES);
    tryStartingKbMode(-1);
    mHourView.invalidate();
  }
 else   if (mTypedTimes == null) {
    mTypedTimes=new ArrayList<Integer>();
  }
  return view;
}