Program: 43434
Project: 43434
Buggy source:
public DatePicker(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  inflater.inflate(R.layout.date_picker,this,true);
  mDayPicker=(NumberPicker)findViewById(R.id.day);
  mDayPicker.setFormatter(NumberPicker.TWO_DIGIT_FORMATTER);
  mDayPicker.setSpeed(100);
  mDayPicker.setOnChangeListener(new OnChangedListener(){
    public void onChanged(    NumberPicker picker,    int oldVal,    int newVal){
      mDay=newVal;
      if (mOnDateChangedListener != null) {
        mOnDateChangedListener.onDateChanged(DatePicker.this,mYear,mMonth,mDay);
      }
    }
  }
);
  mMonthPicker=(NumberPicker)findViewById(R.id.month);
  mMonthPicker.setFormatter(NumberPicker.TWO_DIGIT_FORMATTER);
  DateFormatSymbols dfs=new DateFormatSymbols();
  mMonthPicker.setRange(1,12,dfs.getShortMonths());
  mMonthPicker.setSpeed(200);
  mMonthPicker.setOnChangeListener(new OnChangedListener(){
    public void onChanged(    NumberPicker picker,    int oldVal,    int newVal){
      mMonth=newVal - 1;
      if (mOnDateChangedListener != null) {
        mOnDateChangedListener.onDateChanged(DatePicker.this,mYear,mMonth,mDay);
      }
      updateDaySpinner();
    }
  }
);
  mYearPicker=(NumberPicker)findViewById(R.id.year);
  mYearPicker.setSpeed(100);
  mYearPicker.setOnChangeListener(new OnChangedListener(){
    public void onChanged(    NumberPicker picker,    int oldVal,    int newVal){
      mYear=newVal;
      if (mOnDateChangedListener != null) {
        mOnDateChangedListener.onDateChanged(DatePicker.this,mYear,mMonth,mDay);
      }
    }
  }
);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.DatePicker);
  int mStartYear=a.getInt(R.styleable.DatePicker_startYear,DEFAULT_START_YEAR);
  int mEndYear=a.getInt(R.styleable.DatePicker_endYear,DEFAULT_END_YEAR);
  mYearPicker.setRange(mStartYear,mEndYear);
  a.recycle();
  Calendar cal=Calendar.getInstance();
  init(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH),cal.get(Calendar.DAY_OF_MONTH),null);
  reorderPickers();
  if (!isEnabled()) {
    setEnabled(false);
  }
}

Fixed version (ground truth):
public DatePicker(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  inflater.inflate(R.layout.date_picker,this,true);
  mDayPicker=(NumberPicker)findViewById(R.id.day);
  mDayPicker.setFormatter(NumberPicker.TWO_DIGIT_FORMATTER);
  mDayPicker.setSpeed(100);
  mDayPicker.setOnChangeListener(new OnChangedListener(){
    public void onChanged(    NumberPicker picker,    int oldVal,    int newVal){
      mDay=newVal;
      if (mOnDateChangedListener != null) {
        mOnDateChangedListener.onDateChanged(DatePicker.this,mYear,mMonth,mDay);
      }
    }
  }
);
  mMonthPicker=(NumberPicker)findViewById(R.id.month);
  mMonthPicker.setFormatter(NumberPicker.TWO_DIGIT_FORMATTER);
  DateFormatSymbols dfs=new DateFormatSymbols();
  mMonthPicker.setRange(1,12,dfs.getShortMonths());
  mMonthPicker.setSpeed(200);
  mMonthPicker.setOnChangeListener(new OnChangedListener(){
    public void onChanged(    NumberPicker picker,    int oldVal,    int newVal){
      mMonth=newVal - 1;
      adjustMaxDay();
      if (mOnDateChangedListener != null) {
        mOnDateChangedListener.onDateChanged(DatePicker.this,mYear,mMonth,mDay);
      }
      updateDaySpinner();
    }
  }
);
  mYearPicker=(NumberPicker)findViewById(R.id.year);
  mYearPicker.setSpeed(100);
  mYearPicker.setOnChangeListener(new OnChangedListener(){
    public void onChanged(    NumberPicker picker,    int oldVal,    int newVal){
      mYear=newVal;
      adjustMaxDay();
      if (mOnDateChangedListener != null) {
        mOnDateChangedListener.onDateChanged(DatePicker.this,mYear,mMonth,mDay);
      }
      updateDaySpinner();
    }
  }
);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.DatePicker);
  int mStartYear=a.getInt(R.styleable.DatePicker_startYear,DEFAULT_START_YEAR);
  int mEndYear=a.getInt(R.styleable.DatePicker_endYear,DEFAULT_END_YEAR);
  mYearPicker.setRange(mStartYear,mEndYear);
  a.recycle();
  Calendar cal=Calendar.getInstance();
  init(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH),cal.get(Calendar.DAY_OF_MONTH),null);
  reorderPickers();
  if (!isEnabled()) {
    setEnabled(false);
  }
}