Program: 53114
Project: 53114
Buggy source:
private void setUp(int color){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View layout=inflater.inflate(R.layout.dialog_color_picker,null);
  setContentView(layout);
  setTitle(R.string.dialog_color_picker);
  mColorPicker=(ColorPickerView)layout.findViewById(R.id.color_picker_view);
  mOldColor=(ColorPickerPanelView)layout.findViewById(R.id.old_color_panel);
  mNewColor=(ColorPickerPanelView)layout.findViewById(R.id.new_color_panel);
  mHexVal=(EditText)layout.findViewById(R.id.hex_val);
  mHexDefaultTextColor=mHexVal.getTextColors();
  mHexVal.addTextChangedListener(new TextWatcher(){
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void afterTextChanged(    Editable s){
      if (mHexValueEnabled) {
        if (mHexInternalTextChange)         return;
        if (s.length() > 5 || s.length() < 10) {
          try {
            int c=ColorPickerPreference.convertToColorInt(s.toString());
            mColorPicker.setColor(c,true);
            mHexVal.setTextColor(mHexDefaultTextColor);
          }
 catch (          NumberFormatException e) {
            mHexVal.setTextColor(Color.RED);
          }
        }
 else         mHexVal.setTextColor(Color.RED);
      }
    }
  }
);
  setHexValueEnabled(true);
  ((LinearLayout)mOldColor.getParent()).setPadding(Math.round(mColorPicker.getDrawingOffset()),0,Math.round(mColorPicker.getDrawingOffset()),0);
  mOldColor.setOnClickListener(this);
  mNewColor.setOnClickListener(this);
  mColorPicker.setOnColorChangedListener(this);
  mOldColor.setColor(color);
  mColorPicker.setColor(color,true);
}

Fixed version (ground truth):
private void setUp(int color){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View layout=inflater.inflate(R.layout.dialog_color_picker,null);
  setContentView(layout);
  setTitle(R.string.dialog_color_picker);
  mColorPicker=(ColorPickerView)layout.findViewById(R.id.color_picker_view);
  mOldColor=(ColorPickerPanelView)layout.findViewById(R.id.old_color_panel);
  mNewColor=(ColorPickerPanelView)layout.findViewById(R.id.new_color_panel);
  mHexVal=(EditText)layout.findViewById(R.id.hex_val);
  mHexDefaultTextColor=mHexVal.getTextColors();
  mHexVal.addTextChangedListener(new TextWatcher(){
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void afterTextChanged(    Editable s){
      if (mHexValueEnabled) {
        if (mHexInternalTextChange)         return;
        if (s.length() > 5 || s.length() < 10) {
          try {
            int c=ColorPickerPreference.convertToColorInt(s.toString());
            mHexInternalTextChange=true;
            mColorPicker.setColor(c,true);
            mHexInternalTextChange=false;
            mHexVal.setTextColor(mHexDefaultTextColor);
          }
 catch (          NumberFormatException e) {
            mHexVal.setTextColor(Color.RED);
          }
        }
 else         mHexVal.setTextColor(Color.RED);
      }
    }
  }
);
  setHexValueEnabled(true);
  ((LinearLayout)mOldColor.getParent()).setPadding(Math.round(mColorPicker.getDrawingOffset()),0,Math.round(mColorPicker.getDrawingOffset()),0);
  mOldColor.setOnClickListener(this);
  mNewColor.setOnClickListener(this);
  mColorPicker.setOnColorChangedListener(this);
  mOldColor.setColor(color);
  mColorPicker.setColor(color,true);
}