Program: 110288
Project: 110288
Buggy source:
/** 
 * Creates a new time bar.
 */
public DefaultTimeBar(Context context,AttributeSet attrs){
  super(context,attrs);
  seekBounds=new Rect();
  progressBar=new Rect();
  bufferedBar=new Rect();
  scrubberBar=new Rect();
  progressPaint=new Paint();
  bufferedPaint=new Paint();
  scrubberPaint=new Paint();
  adMarkerPaint=new Paint();
  Resources res=context.getResources();
  DisplayMetrics displayMetrics=res.getDisplayMetrics();
  fineScrubYThreshold=dpToPx(displayMetrics,FINE_SCRUB_Y_THRESHOLD);
  int defaultBarHeight=dpToPx(displayMetrics,DEFAULT_BAR_HEIGHT);
  int defaultTouchTargetHeight=dpToPx(displayMetrics,DEFAULT_TOUCH_TARGET_HEIGHT);
  int defaultAdMarkerWidth=dpToPx(displayMetrics,DEFAULT_AD_MARKER_WIDTH);
  int defaultScrubberEnabledSize=dpToPx(displayMetrics,DEFAULT_SCRUBBER_ENABLED_SIZE);
  int defaultScrubberDisabledSize=dpToPx(displayMetrics,DEFAULT_SCRUBBER_DISABLED_SIZE);
  int defaultScrubberDraggedSize=dpToPx(displayMetrics,DEFAULT_SCRUBBER_DRAGGED_SIZE);
  if (attrs != null) {
    TypedArray a=context.getTheme().obtainStyledAttributes(attrs,R.styleable.DefaultTimeBar,0,0);
    try {
      barHeight=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_bar_height,defaultBarHeight);
      touchTargetHeight=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_touch_target_height,defaultTouchTargetHeight);
      adMarkerWidth=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_ad_marker_width,defaultAdMarkerWidth);
      scrubberEnabledSize=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_scrubber_enabled_size,defaultScrubberEnabledSize);
      scrubberDisabledSize=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_scrubber_disabled_size,defaultScrubberDisabledSize);
      scrubberDraggedSize=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_scrubber_dragged_size,defaultScrubberDraggedSize);
      int playedColor=a.getInt(R.styleable.DefaultTimeBar_played_color,DEFAULT_PLAYED_COLOR);
      int bufferedColor=a.getInt(R.styleable.DefaultTimeBar_buffered_color,DEFAULT_BUFFERED_COLOR);
      int adMarkerColor=a.getInt(R.styleable.DefaultTimeBar_ad_marker_color,DEFAULT_AD_MARKER_COLOR);
      progressPaint.setColor(playedColor);
      scrubberPaint.setColor(OPAQUE_COLOR | playedColor);
      bufferedPaint.setColor(bufferedColor);
      adMarkerPaint.setColor(adMarkerColor);
    }
  finally {
      a.recycle();
    }
  }
 else {
    barHeight=defaultBarHeight;
    touchTargetHeight=defaultTouchTargetHeight;
    adMarkerWidth=defaultAdMarkerWidth;
    scrubberEnabledSize=defaultScrubberEnabledSize;
    scrubberDisabledSize=defaultScrubberDisabledSize;
    scrubberDraggedSize=defaultScrubberDraggedSize;
    scrubberPaint.setColor(OPAQUE_COLOR | DEFAULT_PLAYED_COLOR);
    progressPaint.setColor(DEFAULT_PLAYED_COLOR);
    bufferedPaint.setColor(DEFAULT_BUFFERED_COLOR);
    adMarkerPaint.setColor(DEFAULT_AD_MARKER_COLOR);
  }
  formatBuilder=new StringBuilder();
  formatter=new Formatter(formatBuilder,Locale.getDefault());
  stopScrubbingRunnable=new Runnable(){
    @Override public void run(){
      stopScrubbing(false);
    }
  }
;
  scrubberSize=scrubberEnabledSize;
  scrubberPadding=(Math.max(scrubberDisabledSize,Math.max(scrubberEnabledSize,scrubberDraggedSize)) + 1) / 2;
  duration=C.TIME_UNSET;
  keyTimeIncrement=C.TIME_UNSET;
  keyCountIncrement=DEFAULT_INCREMENT_COUNT;
  setFocusable(true);
  if (Util.SDK_INT >= 16 && getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
    setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
  }
}

Fixed version (ground truth):
/** 
 * Creates a new time bar.
 */
public DefaultTimeBar(Context context,AttributeSet attrs){
  super(context,attrs);
  seekBounds=new Rect();
  progressBar=new Rect();
  bufferedBar=new Rect();
  scrubberBar=new Rect();
  progressPaint=new Paint();
  bufferedPaint=new Paint();
  scrubberPaint=new Paint();
  adMarkerPaint=new Paint();
  Resources res=context.getResources();
  DisplayMetrics displayMetrics=res.getDisplayMetrics();
  fineScrubYThreshold=dpToPx(displayMetrics,FINE_SCRUB_Y_THRESHOLD);
  int defaultBarHeight=dpToPx(displayMetrics,DEFAULT_BAR_HEIGHT);
  int defaultTouchTargetHeight=dpToPx(displayMetrics,DEFAULT_TOUCH_TARGET_HEIGHT);
  int defaultAdMarkerWidth=dpToPx(displayMetrics,DEFAULT_AD_MARKER_WIDTH);
  int defaultScrubberEnabledSize=dpToPx(displayMetrics,DEFAULT_SCRUBBER_ENABLED_SIZE);
  int defaultScrubberDisabledSize=dpToPx(displayMetrics,DEFAULT_SCRUBBER_DISABLED_SIZE);
  int defaultScrubberDraggedSize=dpToPx(displayMetrics,DEFAULT_SCRUBBER_DRAGGED_SIZE);
  if (attrs != null) {
    TypedArray a=context.getTheme().obtainStyledAttributes(attrs,R.styleable.DefaultTimeBar,0,0);
    try {
      barHeight=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_bar_height,defaultBarHeight);
      touchTargetHeight=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_touch_target_height,defaultTouchTargetHeight);
      adMarkerWidth=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_ad_marker_width,defaultAdMarkerWidth);
      scrubberEnabledSize=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_scrubber_enabled_size,defaultScrubberEnabledSize);
      scrubberDisabledSize=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_scrubber_disabled_size,defaultScrubberDisabledSize);
      scrubberDraggedSize=a.getDimensionPixelSize(R.styleable.DefaultTimeBar_scrubber_dragged_size,defaultScrubberDraggedSize);
      int playedColor=a.getInt(R.styleable.DefaultTimeBar_played_color,DEFAULT_PLAYED_COLOR);
      int bufferedColor=a.getInt(R.styleable.DefaultTimeBar_buffered_color,DEFAULT_BUFFERED_COLOR);
      int adMarkerColor=a.getInt(R.styleable.DefaultTimeBar_ad_marker_color,DEFAULT_AD_MARKER_COLOR);
      progressPaint.setColor(playedColor);
      scrubberPaint.setColor(OPAQUE_COLOR | playedColor);
      bufferedPaint.setColor(bufferedColor);
      adMarkerPaint.setColor(adMarkerColor);
    }
  finally {
      a.recycle();
    }
  }
 else {
    barHeight=defaultBarHeight;
    touchTargetHeight=defaultTouchTargetHeight;
    adMarkerWidth=defaultAdMarkerWidth;
    scrubberEnabledSize=defaultScrubberEnabledSize;
    scrubberDisabledSize=defaultScrubberDisabledSize;
    scrubberDraggedSize=defaultScrubberDraggedSize;
    scrubberPaint.setColor(OPAQUE_COLOR | DEFAULT_PLAYED_COLOR);
    progressPaint.setColor(DEFAULT_PLAYED_COLOR);
    bufferedPaint.setColor(DEFAULT_BUFFERED_COLOR);
    adMarkerPaint.setColor(DEFAULT_AD_MARKER_COLOR);
  }
  formatBuilder=new StringBuilder();
  formatter=new Formatter(formatBuilder,Locale.getDefault());
  stopScrubbingRunnable=new Runnable(){
    @Override public void run(){
      stopScrubbing(false);
    }
  }
;
  scrubberSize=scrubberEnabledSize;
  scrubberPadding=(Math.max(scrubberDisabledSize,Math.max(scrubberEnabledSize,scrubberDraggedSize)) + 1) / 2;
  duration=C.TIME_UNSET;
  keyTimeIncrement=C.TIME_UNSET;
  keyCountIncrement=DEFAULT_INCREMENT_COUNT;
  setFocusable(true);
  if (Util.SDK_INT >= 16) {
    maybeSetImportantForAccessibilityV16();
  }
}