nus-yam/ex-repair huggingface dataset:
Program: 25473
Project: 25473
Buggy source:
public static void main(String args[]) throws IOException, SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, URISyntaxException, DocumentException, SAXException, ParseException {
  refreshReportPubDatesForStockSH(jdbcConnection(),"String_Node_Str",1804,2008);
}

Fixed version (ground truth):
public static void main(String args[]) throws IOException, SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, URISyntaxException, DocumentException, SAXException, ParseException {
  updateReportPubDates();
}
Program: 25475
Project: 25475
Buggy source:
public static void updateReportPubDates() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException, IOException {
  Connection con=jdbcConnection();
  Statement st=con.createStatement();
  int y;
  ResultSet rs=st.executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  String stockCode;
  int stockId, currentYear=new Date().getYear() + 1900;
  while (rs.next()) {
    stockCode=rs.getString("String_Node_Str");
    stockId=rs.getInt("String_Node_Str");
    y=rs.getInt("String_Node_Str");
    if (stockCode.startsWith("String_Node_Str") || stockCode.startsWith("String_Node_Str")) {
      stockCode=FinDataConstants.ABShareCodeRef.get(stockCode);
    }
    refreshReportPubDatesForStockSH(con,stockCode,stockId,y);
  }
}

Fixed version (ground truth):
public static void updateReportPubDates() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException, IOException {
  Connection con=jdbcConnection();
  Statement st=con.createStatement();
  int y;
  ResultSet rs=st.executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  String stockCode;
  int stockId, currentYear=new Date().getYear() + 1900;
  while (rs.next()) {
    stockCode=rs.getString("String_Node_Str");
    stockId=rs.getInt("String_Node_Str");
    y=rs.getInt("String_Node_Str");
    if (stockCode.startsWith("String_Node_Str") || stockCode.startsWith("String_Node_Str")) {
      stockCode=FinDataConstants.ABShareCodeRef.get(stockCode);
    }
    refreshReportPubDatesForStock(con,stockCode,stockId,y);
  }
}
Program: 25476
Project: 25476
Buggy source:
public static void main(String[] args) throws IOException, ParseException {
  System.out.println(new SHSEReportPublicationData("String_Node_Str",2002,2).getReportPublication().getDate());
  new SHSEReportPublicationData("String_Node_Str",2002,3);
  new SHSEReportPublicationData("String_Node_Str",2002,4);
  new SHSEReportPublicationData("String_Node_Str",2003,1);
  new SHSEReportPublicationData("String_Node_Str",2003,2);
  new SHSEReportPublicationData("String_Node_Str",2003,3);
  new SHSEReportPublicationData("String_Node_Str",2003,4);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, ParseException {
  System.out.println(new SHSEReportPublicationData("String_Node_Str",2002,2).getReportPublication().getDate());
  System.out.println(new SHSEReportPublicationData("String_Node_Str",2002,3).getReportPublication().getDate());
  System.out.println(new SHSEReportPublicationData("String_Node_Str",2002,4).getReportPublication().getDate());
}
Program: 25478
Project: 25478
Buggy source:
public static void main(String[] args) throws IOException, ParseException {
  new SZSEReportPublicationData("String_Node_Str",2007,1);
  new SZSEReportPublicationData("String_Node_Str",2007,2);
  new SZSEReportPublicationData("String_Node_Str",2007,3);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, ParseException {
  new SZSEReportPublicationData("String_Node_Str",2007,1);
  new SZSEReportPublicationData("String_Node_Str",2007,2);
  new SZSEReportPublicationData("String_Node_Str",2007,3);
  new SZSEReportPublicationData("String_Node_Str",2007,4);
}
Program: 25479
Project: 25479
Buggy source:
/** 
 * Adds a panel slide listener
 * @param listener
 */
public void addPanelSlideListener(PanelSlideListener listener){
  mPanelSlideListeners.add(listener);
}

Fixed version (ground truth):
/** 
 * Adds a panel slide listener
 * @param listener
 */
public void addPanelSlideListener(PanelSlideListener listener){
synchronized (mPanelSlideListeners) {
    mPanelSlideListeners.add(listener);
  }
}
Program: 25480
Project: 25480
Buggy source:
/** 
 * Removes a panel slide listener
 * @param listener
 */
public void removePanelSlideListener(PanelSlideListener listener){
  mPanelSlideListeners.remove(listener);
}

Fixed version (ground truth):
/** 
 * Removes a panel slide listener
 * @param listener
 */
public void removePanelSlideListener(PanelSlideListener listener){
synchronized (mPanelSlideListeners) {
    mPanelSlideListeners.remove(listener);
  }
}
Program: 25481
Project: 25481
Buggy source:
void dispatchOnPanelSlide(View panel){
  for (  PanelSlideListener l : mPanelSlideListeners) {
    l.onPanelSlide(panel,mSlideOffset);
  }
}

Fixed version (ground truth):
void dispatchOnPanelSlide(View panel){
synchronized (mPanelSlideListeners) {
    for (    PanelSlideListener l : mPanelSlideListeners) {
      l.onPanelSlide(panel,mSlideOffset);
    }
  }
}
Program: 25482
Project: 25482
Buggy source:
void dispatchOnPanelStateChanged(View panel,PanelState previousState,PanelState newState){
  for (  PanelSlideListener l : mPanelSlideListeners) {
    l.onPanelStateChanged(panel,previousState,newState);
  }
  sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}

Fixed version (ground truth):
void dispatchOnPanelStateChanged(View panel,PanelState previousState,PanelState newState){
synchronized (mPanelSlideListeners) {
    for (    PanelSlideListener l : mPanelSlideListeners) {
      l.onPanelStateChanged(panel,previousState,newState);
    }
  }
  sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
Program: 25484
Project: 25484
Buggy source:
/** 
 * Change panel state to the given state with
 * @param state - new panel state
 */
public void setPanelState(PanelState state){
  if (state == null || state == PanelState.DRAGGING) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!isEnabled() || (!mFirstLayout && mSlideableView == null) || state == mSlideState || mSlideState == PanelState.DRAGGING)   return;
  if (mFirstLayout) {
    setPanelStateInternal(state);
  }
 else {
    if (mSlideState == PanelState.HIDDEN) {
      mSlideableView.setVisibility(View.VISIBLE);
      requestLayout();
    }
switch (state) {
case ANCHORED:
      smoothSlideTo(mAnchorPoint,0);
    break;
case COLLAPSED:
  smoothSlideTo(0,0);
break;
case EXPANDED:
smoothSlideTo(1.0f,0);
break;
case HIDDEN:
int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
smoothSlideTo(computeSlideOffset(newTop),0);
break;
}
}
}

Fixed version (ground truth):
/** 
 * Change panel state to the given state with
 * @param state - new panel state
 */
public void setPanelState(PanelState state){
  if (mDragHelper.getViewDragState() == ViewDragHelper.STATE_SETTLING) {
    Log.d(TAG,"String_Node_Str");
    mDragHelper.abort();
  }
  if (state == null || state == PanelState.DRAGGING) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!isEnabled() || (!mFirstLayout && mSlideableView == null) || state == mSlideState || mSlideState == PanelState.DRAGGING)   return;
  if (mFirstLayout) {
    setPanelStateInternal(state);
  }
 else {
    if (mSlideState == PanelState.HIDDEN) {
      mSlideableView.setVisibility(View.VISIBLE);
      requestLayout();
    }
switch (state) {
case ANCHORED:
      smoothSlideTo(mAnchorPoint,0);
    break;
case COLLAPSED:
  smoothSlideTo(0,0);
break;
case EXPANDED:
smoothSlideTo(1.0f,0);
break;
case HIDDEN:
int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
smoothSlideTo(computeSlideOffset(newTop),0);
break;
}
}
}
Program: 25485
Project: 25485
Buggy source:
/** 
 * Change panel state to the given state with
 * @param state - new panel state
 */
public void setPanelState(PanelState state){
  if (state == null || state == PanelState.DRAGGING) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!isEnabled() || (!mFirstLayout && mSlideableView == null) || state == mSlideState || mSlideState == PanelState.DRAGGING)   return;
  if (mFirstLayout) {
    setPanelStateInternal(state);
  }
 else {
    if (mSlideState == PanelState.HIDDEN) {
      mSlideableView.setVisibility(View.VISIBLE);
      requestLayout();
    }
switch (state) {
case ANCHORED:
      smoothSlideTo(mAnchorPoint,0);
    break;
case COLLAPSED:
  smoothSlideTo(0,0);
break;
case EXPANDED:
smoothSlideTo(1.0f,0);
break;
case HIDDEN:
int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
smoothSlideTo(computeSlideOffset(newTop),0);
break;
}
}
}

Fixed version (ground truth):
/** 
 * Change panel state to the given state with
 * @param state - new panel state
 */
public void setPanelState(PanelState state){
  if (mDragHelper.getViewDragState() == ViewDragHelper.STATE_SETTLING) {
    Log.d(TAG,"String_Node_Str");
    mDragHelper.abort();
  }
  if (state == null || state == PanelState.DRAGGING) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!isEnabled() || (!mFirstLayout && mSlideableView == null) || state == mSlideState || mSlideState == PanelState.DRAGGING)   return;
  if (mFirstLayout) {
    setPanelStateInternal(state);
  }
 else {
    if (mSlideState == PanelState.HIDDEN) {
      mSlideableView.setVisibility(View.VISIBLE);
      requestLayout();
    }
switch (state) {
case ANCHORED:
      smoothSlideTo(mAnchorPoint,0);
    break;
case COLLAPSED:
  smoothSlideTo(0,0);
break;
case EXPANDED:
smoothSlideTo(1.0f,0);
break;
case HIDDEN:
int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
smoothSlideTo(computeSlideOffset(newTop),0);
break;
}
}
}
Program: 25486
Project: 25486
Buggy source:
@Override public boolean tryCaptureView(View child,int pointerId){
  if (mIsUnableToDrag) {
    return false;
  }
  return child == mSlideableView;
}

Fixed version (ground truth):
@Override public boolean tryCaptureView(View child,int pointerId){
  return !mIsUnableToDrag && child == mSlideableView;
}
Program: 25487
Project: 25487
Buggy source:
@Override public void onViewDragStateChanged(int state){
  if (mDragHelper.getViewDragState() == ViewDragHelper.STATE_IDLE) {
    mSlideOffset=computeSlideOffset(mSlideableView.getTop());
    applyParallaxForCurrentSlideOffset();
    if (mSlideOffset == 1) {
      updateObscuredViewVisibility();
      setPanelStateInternal(PanelState.EXPANDED);
    }
 else     if (mSlideOffset == 0) {
      setPanelStateInternal(PanelState.COLLAPSED);
    }
 else     if (mSlideOffset < 0) {
      setPanelStateInternal(PanelState.HIDDEN);
      mSlideableView.setVisibility(View.INVISIBLE);
    }
 else {
      updateObscuredViewVisibility();
      setPanelStateInternal(PanelState.ANCHORED);
    }
  }
}

Fixed version (ground truth):
@Override public void onViewDragStateChanged(int state){
  if (mDragHelper != null && mDragHelper.getViewDragState() == ViewDragHelper.STATE_IDLE) {
    mSlideOffset=computeSlideOffset(mSlideableView.getTop());
    applyParallaxForCurrentSlideOffset();
    if (mSlideOffset == 1) {
      updateObscuredViewVisibility();
      setPanelStateInternal(PanelState.EXPANDED);
    }
 else     if (mSlideOffset == 0) {
      setPanelStateInternal(PanelState.COLLAPSED);
    }
 else     if (mSlideOffset < 0) {
      setPanelStateInternal(PanelState.HIDDEN);
      mSlideableView.setVisibility(View.INVISIBLE);
    }
 else {
      updateObscuredViewVisibility();
      setPanelStateInternal(PanelState.ANCHORED);
    }
  }
}
Program: 25488
Project: 25488
Buggy source:
@Override public void onViewReleased(View releasedChild,float xvel,float yvel){
  int target=0;
  float direction=mIsSlidingUp ? -yvel : yvel;
  if (direction > 0 && mSlideOffset <= mAnchorPoint) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else   if (direction > 0 && mSlideOffset > mAnchorPoint) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (direction < 0 && mSlideOffset >= mAnchorPoint) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else   if (direction < 0 && mSlideOffset < mAnchorPoint) {
    target=computePanelTopPosition(0.0f);
  }
 else   if (mSlideOffset >= (1.f + mAnchorPoint) / 2) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (mSlideOffset >= mAnchorPoint / 2) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else {
    target=computePanelTopPosition(0.0f);
  }
  mDragHelper.settleCapturedViewAt(releasedChild.getLeft(),target);
  invalidate();
}

Fixed version (ground truth):
@Override public void onViewReleased(View releasedChild,float xvel,float yvel){
  int target=0;
  float direction=mIsSlidingUp ? -yvel : yvel;
  if (direction > 0 && mSlideOffset <= mAnchorPoint) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else   if (direction > 0 && mSlideOffset > mAnchorPoint) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (direction < 0 && mSlideOffset >= mAnchorPoint) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else   if (direction < 0 && mSlideOffset < mAnchorPoint) {
    target=computePanelTopPosition(0.0f);
  }
 else   if (mSlideOffset >= (1.f + mAnchorPoint) / 2) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (mSlideOffset >= mAnchorPoint / 2) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else {
    target=computePanelTopPosition(0.0f);
  }
  if (mDragHelper != null) {
    mDragHelper.settleCapturedViewAt(releasedChild.getLeft(),target);
  }
  invalidate();
}
Program: 25490
Project: 25490
Buggy source:
public LayoutParams(Context c,AttributeSet attrs){
  super(c,attrs);
  final TypedArray ta=c.obtainStyledAttributes(attrs,ATTRS);
  if (ta != null) {
    this.weight=ta.getFloat(0,0);
  }
  ta.recycle();
}

Fixed version (ground truth):
public LayoutParams(Context c,AttributeSet attrs){
  super(c,attrs);
  final TypedArray ta=c.obtainStyledAttributes(attrs,ATTRS);
  if (ta != null) {
    this.weight=ta.getFloat(0,0);
    ta.recycle();
  }
}
Program: 25491
Project: 25491
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mIsScrollableViewHandlingTouch || !isTouchEnabled()) {
    mDragHelper.abort();
    return false;
  }
  final int action=MotionEventCompat.getActionMasked(ev);
  final float x=ev.getX();
  final float y=ev.getY();
  final float adx=Math.abs(x - mInitialMotionX);
  final float ady=Math.abs(y - mInitialMotionY);
  final int dragSlop=mDragHelper.getTouchSlop();
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    if ((ady > dragSlop && adx > ady) || !isViewUnder(mDragView,(int)mInitialMotionX,(int)mInitialMotionY)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mDragHelper.isDragging()) {
  mDragHelper.processTouchEvent(ev);
  return true;
}
if (ady <= dragSlop && adx <= dragSlop && mSlideOffset >= 0 && !isViewUnder(mSlideableView,(int)mInitialMotionX,(int)mInitialMotionY) && mFadeOnClickListener != null) {
playSoundEffect(android.view.SoundEffectConstants.CLICK);
mFadeOnClickListener.onClick(this);
return true;
}
break;
}
return mDragHelper.shouldInterceptTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mIsScrollableViewHandlingTouch || !isTouchEnabled()) {
    mDragHelper.abort();
    return false;
  }
  final int action=MotionEventCompat.getActionMasked(ev);
  final float x=ev.getX();
  final float y=ev.getY();
  final float adx=Math.abs(x - mInitialMotionX);
  final float ady=Math.abs(y - mInitialMotionY);
  final int dragSlop=mDragHelper.getTouchSlop();
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    if ((ady > dragSlop && adx > ady) || !isViewUnder(mDragView,(int)mInitialMotionX,(int)mInitialMotionY)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mDragHelper.isDragging()) {
  mDragHelper.processTouchEvent(ev);
  return true;
}
if (ady <= dragSlop && adx <= dragSlop && mSlideOffset > 0 && !isViewUnder(mSlideableView,(int)mInitialMotionX,(int)mInitialMotionY) && mFadeOnClickListener != null) {
playSoundEffect(android.view.SoundEffectConstants.CLICK);
mFadeOnClickListener.onClick(this);
return true;
}
break;
}
return mDragHelper.shouldInterceptTouchEvent(ev);
}
Program: 25492
Project: 25492
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mIsScrollableViewHandlingTouch || !isTouchEnabled()) {
    mDragHelper.abort();
    return false;
  }
  final int action=MotionEventCompat.getActionMasked(ev);
  final float x=ev.getX();
  final float y=ev.getY();
  final float adx=Math.abs(x - mInitialMotionX);
  final float ady=Math.abs(y - mInitialMotionY);
  final int dragSlop=mDragHelper.getTouchSlop();
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    if ((ady > dragSlop && adx > ady) || !isViewUnder(mDragView,(int)mInitialMotionX,(int)mInitialMotionY)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mDragHelper.isDragging()) {
  mDragHelper.processTouchEvent(ev);
  return true;
}
if (ady <= dragSlop && adx <= dragSlop && mSlideOffset > 0 && !isViewUnder(mSlideableView,(int)mInitialMotionX,(int)mInitialMotionY) && mFadeOnClickListener != null) {
playSoundEffect(android.view.SoundEffectConstants.CLICK);
mFadeOnClickListener.onClick(this);
return true;
}
break;
}
return mDragHelper.shouldInterceptTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mIsScrollableViewHandlingTouch || !isTouchEnabled()) {
    mDragHelper.abort();
    return false;
  }
  final int action=MotionEventCompat.getActionMasked(ev);
  final float x=ev.getX();
  final float y=ev.getY();
  final float adx=Math.abs(x - mInitialMotionX);
  final float ady=Math.abs(y - mInitialMotionY);
  final int dragSlop=mDragHelper.getTouchSlop();
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (!isViewUnder(mDragView,(int)x,(int)y)) {
        mDragHelper.cancel();
        mIsUnableToDrag=true;
        return false;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    if (ady > dragSlop && adx > ady) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mDragHelper.isDragging()) {
  mDragHelper.processTouchEvent(ev);
  return true;
}
if (ady <= dragSlop && adx <= dragSlop && mSlideOffset > 0 && !isViewUnder(mSlideableView,(int)mInitialMotionX,(int)mInitialMotionY) && mFadeOnClickListener != null) {
playSoundEffect(android.view.SoundEffectConstants.CLICK);
mFadeOnClickListener.onClick(this);
return true;
}
break;
}
return mDragHelper.shouldInterceptTouchEvent(ev);
}
Program: 25493
Project: 25493
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mIsScrollableViewHandlingTouch) {
    mDragHelper.cancel();
    return false;
  }
  final int action=MotionEventCompat.getActionMasked(ev);
  final float x=ev.getX();
  final float y=ev.getY();
  final float adx=Math.abs(x - mInitialMotionX);
  final float ady=Math.abs(y - mInitialMotionY);
  final int dragSlop=mDragHelper.getTouchSlop();
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    if ((ady > dragSlop && adx > ady) || !isViewUnder(mDragView,(int)mInitialMotionX,(int)mInitialMotionY)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mDragHelper.isDragging()) {
  mDragHelper.processTouchEvent(ev);
  return true;
}
if (ady <= dragSlop && adx <= dragSlop && mSlideOffset >= 0 && !isViewUnder(mSlideableView,(int)mInitialMotionX,(int)mInitialMotionY) && mFadeOnClickListener != null) {
playSoundEffect(android.view.SoundEffectConstants.CLICK);
mFadeOnClickListener.onClick(this);
return true;
}
break;
}
return mDragHelper.shouldInterceptTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mIsScrollableViewHandlingTouch || !isTouchEnabled()) {
    mDragHelper.cancel();
    return false;
  }
  final int action=MotionEventCompat.getActionMasked(ev);
  final float x=ev.getX();
  final float y=ev.getY();
  final float adx=Math.abs(x - mInitialMotionX);
  final float ady=Math.abs(y - mInitialMotionY);
  final int dragSlop=mDragHelper.getTouchSlop();
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    if ((ady > dragSlop && adx > ady) || !isViewUnder(mDragView,(int)mInitialMotionX,(int)mInitialMotionY)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mDragHelper.isDragging()) {
  mDragHelper.processTouchEvent(ev);
  return true;
}
if (ady <= dragSlop && adx <= dragSlop && mSlideOffset >= 0 && !isViewUnder(mSlideableView,(int)mInitialMotionX,(int)mInitialMotionY) && mFadeOnClickListener != null) {
playSoundEffect(android.view.SoundEffectConstants.CLICK);
mFadeOnClickListener.onClick(this);
return true;
}
break;
}
return mDragHelper.shouldInterceptTouchEvent(ev);
}
Program: 25494
Project: 25494
Buggy source:
@Override public boolean onTouchEvent(@NonNull MotionEvent ev){
  if (!isEnabled() || !isTouchEnabled()) {
    return super.onTouchEvent(ev);
  }
  try {
    mDragHelper.processTouchEvent(ev);
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isEnabled() || !isTouchEnabled()) {
    return super.onTouchEvent(ev);
  }
  try {
    mDragHelper.processTouchEvent(ev);
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}
Program: 25496
Project: 25496
Buggy source:
/** 
 * Adds a panel slide listener
 * @param listener
 */
public void addPanelSlideListener(PanelSlideListener listener){
  mPanelSlideListeners.add(listener);
}

Fixed version (ground truth):
/** 
 * Adds a panel slide listener
 * @param listener
 */
public void addPanelSlideListener(PanelSlideListener listener){
synchronized (mPanelSlideListeners) {
    mPanelSlideListeners.add(listener);
  }
}
Program: 25497
Project: 25497
Buggy source:
/** 
 * Removes a panel slide listener
 * @param listener
 */
public void removePanelSlideListener(PanelSlideListener listener){
  mPanelSlideListeners.remove(listener);
}

Fixed version (ground truth):
/** 
 * Removes a panel slide listener
 * @param listener
 */
public void removePanelSlideListener(PanelSlideListener listener){
synchronized (mPanelSlideListeners) {
    mPanelSlideListeners.remove(listener);
  }
}
Program: 25498
Project: 25498
Buggy source:
void dispatchOnPanelSlide(View panel){
  for (  PanelSlideListener l : mPanelSlideListeners) {
    l.onPanelSlide(panel,mSlideOffset);
  }
}

Fixed version (ground truth):
void dispatchOnPanelSlide(View panel){
synchronized (mPanelSlideListeners) {
    for (    PanelSlideListener l : mPanelSlideListeners) {
      l.onPanelSlide(panel,mSlideOffset);
    }
  }
}
Program: 25499
Project: 25499
Buggy source:
void dispatchOnPanelStateChanged(View panel,PanelState previousState,PanelState newState){
  for (  PanelSlideListener l : mPanelSlideListeners) {
    l.onPanelStateChanged(panel,previousState,newState);
  }
  sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}

Fixed version (ground truth):
void dispatchOnPanelStateChanged(View panel,PanelState previousState,PanelState newState){
synchronized (mPanelSlideListeners) {
    for (    PanelSlideListener l : mPanelSlideListeners) {
      l.onPanelStateChanged(panel,previousState,newState);
    }
  }
  sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
Program: 25501
Project: 25501
Buggy source:
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    setAllChildrenVisible();
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity    initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    setAllChildrenVisible();
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}
Program: 25502
Project: 25502
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isEnabled() || !isTouchEnabled()) {
    return super.onTouchEvent(ev);
  }
  final int action=MotionEventCompat.getActionMasked(ev);
  try {
    mDragHelper.processTouchEvent(ev);
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(@NonNull MotionEvent ev){
  if (!isEnabled() || !isTouchEnabled()) {
    return super.onTouchEvent(ev);
  }
  try {
    mDragHelper.processTouchEvent(ev);
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}
Program: 25503
Project: 25503
Buggy source:
/** 
 * Tests scrollability within child views of v given a delta of dx.
 * @param v View to test for horizontal scrollability
 * @param checkV Whether the view v passed should itself be checked for scrollability (true),or just its children (false).
 * @param dx Delta scrolled in pixels
 * @param x X coordinate of the active touch point
 * @param y Y coordinate of the active touch point
 * @return true if child views of v can be scrolled by delta of dx.
 */
protected boolean canScroll(View v,boolean checkV,int dx,int x,int y){
  if (v instanceof ViewGroup) {
    final ViewGroup group=(ViewGroup)v;
    final int scrollX=v.getScrollX();
    final int scrollY=v.getScrollY();
    final int count=group.getChildCount();
    for (int i=count - 1; i >= 0; i--) {
      final View child=group.getChildAt(i);
      if (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() && y + scrollY >= child.getTop() && y + scrollY < child.getBottom() && canScroll(child,true,dx,x + scrollX - child.getLeft(),y + scrollY - child.getTop())) {
        return true;
      }
    }
  }
  return checkV && ViewCompat.canScrollHorizontally(v,-dx);
}

Fixed version (ground truth):
/** 
 * Tests scrollability within child views of v given a delta of dx.
 * @param v      View to test for horizontal scrollability
 * @param checkV Whether the view v passed should itself be checked for scrollability (true),or just its children (false).
 * @param dx     Delta scrolled in pixels
 * @param x      X coordinate of the active touch point
 * @param y      Y coordinate of the active touch point
 * @return true if child views of v can be scrolled by delta of dx.
 */
protected boolean canScroll(View v,boolean checkV,int dx,int x,int y){
  if (v instanceof ViewGroup) {
    final ViewGroup group=(ViewGroup)v;
    final int scrollX=v.getScrollX();
    final int scrollY=v.getScrollY();
    final int count=group.getChildCount();
    for (int i=count - 1; i >= 0; i--) {
      final View child=group.getChildAt(i);
      if (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() && y + scrollY >= child.getTop() && y + scrollY < child.getBottom() && canScroll(child,true,dx,x + scrollX - child.getLeft(),y + scrollY - child.getTop())) {
        return true;
      }
    }
  }
  return checkV && ViewCompat.canScrollHorizontally(v,-dx);
}
Program: 25506
Project: 25506
Buggy source:
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity    initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    setAllChildrenVisible();
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity    initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isEnabled() || mSlideableView == null) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    setAllChildrenVisible();
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}
Program: 25507
Project: 25507
Buggy source:
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    setAllChildrenVisible();
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity    initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    setAllChildrenVisible();
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}
Program: 25508
Project: 25508
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isEnabled() || !isTouchEnabled()) {
    return super.onTouchEvent(ev);
  }
  final int action=MotionEventCompat.getActionMasked(ev);
  try {
    mDragHelper.processTouchEvent(ev);
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(@NonNull MotionEvent ev){
  if (!isEnabled() || !isTouchEnabled()) {
    return super.onTouchEvent(ev);
  }
  try {
    mDragHelper.processTouchEvent(ev);
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}
Program: 25509
Project: 25509
Buggy source:
/** 
 * Tests scrollability within child views of v given a delta of dx.
 * @param v View to test for horizontal scrollability
 * @param checkV Whether the view v passed should itself be checked for scrollability (true),or just its children (false).
 * @param dx Delta scrolled in pixels
 * @param x X coordinate of the active touch point
 * @param y Y coordinate of the active touch point
 * @return true if child views of v can be scrolled by delta of dx.
 */
protected boolean canScroll(View v,boolean checkV,int dx,int x,int y){
  if (v instanceof ViewGroup) {
    final ViewGroup group=(ViewGroup)v;
    final int scrollX=v.getScrollX();
    final int scrollY=v.getScrollY();
    final int count=group.getChildCount();
    for (int i=count - 1; i >= 0; i--) {
      final View child=group.getChildAt(i);
      if (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() && y + scrollY >= child.getTop() && y + scrollY < child.getBottom() && canScroll(child,true,dx,x + scrollX - child.getLeft(),y + scrollY - child.getTop())) {
        return true;
      }
    }
  }
  return checkV && ViewCompat.canScrollHorizontally(v,-dx);
}

Fixed version (ground truth):
/** 
 * Tests scrollability within child views of v given a delta of dx.
 * @param v      View to test for horizontal scrollability
 * @param checkV Whether the view v passed should itself be checked for scrollability (true),or just its children (false).
 * @param dx     Delta scrolled in pixels
 * @param x      X coordinate of the active touch point
 * @param y      Y coordinate of the active touch point
 * @return true if child views of v can be scrolled by delta of dx.
 */
protected boolean canScroll(View v,boolean checkV,int dx,int x,int y){
  if (v instanceof ViewGroup) {
    final ViewGroup group=(ViewGroup)v;
    final int scrollX=v.getScrollX();
    final int scrollY=v.getScrollY();
    final int count=group.getChildCount();
    for (int i=count - 1; i >= 0; i--) {
      final View child=group.getChildAt(i);
      if (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() && y + scrollY >= child.getTop() && y + scrollY < child.getBottom() && canScroll(child,true,dx,x + scrollX - child.getLeft(),y + scrollY - child.getTop())) {
        return true;
      }
    }
  }
  return checkV && ViewCompat.canScrollHorizontally(v,-dx);
}
Program: 25511
Project: 25511
Buggy source:
@Override public void onViewReleased(View releasedChild,float xvel,float yvel){
  int target=0;
  float direction=mIsSlidingUp ? -yvel : yvel;
  if (direction > 0) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (direction < 0) {
    target=computePanelTopPosition(0.0f);
  }
 else   if (mAnchorPoint != 1 && mSlideOffset >= (1.f + mAnchorPoint) / 2) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (mAnchorPoint == 1 && mSlideOffset >= 0.5f) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (mAnchorPoint != 1 && mSlideOffset >= mAnchorPoint) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else   if (mAnchorPoint != 1 && mSlideOffset >= mAnchorPoint / 2) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else {
    target=computePanelTopPosition(0.0f);
  }
  mDragHelper.settleCapturedViewAt(releasedChild.getLeft(),target);
  invalidate();
}

Fixed version (ground truth):
@Override public void onViewReleased(View releasedChild,float xvel,float yvel){
  int target=0;
  float direction=mIsSlidingUp ? -yvel : yvel;
  if (direction > 0 && mSlideOffset <= mAnchorPoint) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else   if (direction > 0 && mSlideOffset > mAnchorPoint) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (direction < 0 && mSlideOffset >= mAnchorPoint) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else   if (direction < 0 && mSlideOffset < mAnchorPoint) {
    target=computePanelTopPosition(0.0f);
  }
 else   if (mSlideOffset >= (1.f + mAnchorPoint) / 2) {
    target=computePanelTopPosition(1.0f);
  }
 else   if (mSlideOffset >= mAnchorPoint / 2) {
    target=computePanelTopPosition(mAnchorPoint);
  }
 else {
    target=computePanelTopPosition(0.0f);
  }
  mDragHelper.settleCapturedViewAt(releasedChild.getLeft(),target);
  invalidate();
}
Program: 25512
Project: 25512
Buggy source:
/** 
 * Partially expand the sliding panel up to a specific offset
 * @param mSlideOffset Value between 0 and 1, where 0 is completely expanded.
 * @return true if the pane was slideable and is now expanded/in the process of expanding
 */
public boolean expandPanel(float mSlideOffset){
  if (mSlideableView == null || mSlideState == PanelState.EXPANDED)   return false;
  mSlideableView.setVisibility(View.VISIBLE);
  return expandPanel(mSlideableView,0,mSlideOffset);
}

Fixed version (ground truth):
/** 
 * Partially expand the sliding panel up to a specific offset
 * @param slideOffset Value between 0 and 1, where 0 is completely expanded.
 * @return true if the pane was slideable and is now expanded/in the process of expanding
 */
public boolean expandPanel(float slideOffset){
  if (mSlideableView == null || (mSlideState == PanelState.EXPANDED && slideOffset == 1.0f))   return false;
  mSlideableView.setVisibility(View.VISIBLE);
  return expandPanel(mSlideableView,0,slideOffset);
}
Program: 25513
Project: 25513
Buggy source:
@SuppressLint("String_Node_Str") private void onPanelDragged(int newTop){
  mSlideState=PanelState.DRAGGING;
  mSlideOffset=computeSlideOffset(newTop);
  if (mParallaxOffset > 0 && mSlideOffset >= 0) {
    int mainViewOffset=getCurrentParalaxOffset();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mMainView.setTranslationY(mainViewOffset);
    }
 else {
      AnimatorProxy.wrap(mMainView).setTranslationY(mainViewOffset);
    }
  }
  dispatchOnPanelSlide(mSlideableView);
  LayoutParams lp=(LayoutParams)mMainView.getLayoutParams();
  int defaultHeight=getHeight() - getPaddingBottom() - getPaddingTop()- mPanelHeight;
  if (mSlideOffset <= 0 && !mOverlayContent) {
    lp.height=mIsSlidingUp ? (newTop - getPaddingBottom()) : (getHeight() - getPaddingBottom() - mSlideableView.getMeasuredHeight()- newTop);
    mMainView.requestLayout();
  }
 else   if (lp.height != defaultHeight) {
    lp.height=defaultHeight;
    mMainView.requestLayout();
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void onPanelDragged(int newTop){
  mSlideState=PanelState.DRAGGING;
  mSlideOffset=computeSlideOffset(newTop);
  if (mParallaxOffset > 0 && mSlideOffset >= 0) {
    int mainViewOffset=getCurrentParalaxOffset();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mMainView.setTranslationY(mainViewOffset);
    }
 else {
      AnimatorProxy.wrap(mMainView).setTranslationY(mainViewOffset);
    }
  }
  dispatchOnPanelSlide(mSlideableView);
  LayoutParams lp=(LayoutParams)mMainView.getLayoutParams();
  int defaultHeight=getHeight() - getPaddingBottom() - getPaddingTop()- mPanelHeight;
  if (mSlideOffset <= 0 && !mOverlayContent) {
    lp.height=mIsSlidingUp ? (newTop - getPaddingBottom()) : (getHeight() - getPaddingBottom() - mSlideableView.getMeasuredHeight()- newTop);
    mMainView.requestLayout();
  }
 else   if (lp.height != defaultHeight && !mOverlayContent) {
    lp.height=defaultHeight;
    mMainView.requestLayout();
  }
}
Program: 25514
Project: 25514
Buggy source:
private void saveLastMotion(MotionEvent ev){
  final int pointerCount=MotionEventCompat.getPointerCount(ev);
  for (int i=0; i < pointerCount; i++) {
    final int pointerId=MotionEventCompat.getPointerId(ev,i);
    final float x=MotionEventCompat.getX(ev,i);
    final float y=MotionEventCompat.getY(ev,i);
    mLastMotionX[pointerId]=x;
    mLastMotionY[pointerId]=y;
  }
}

Fixed version (ground truth):
private void saveLastMotion(MotionEvent ev){
  final int pointerCount=MotionEventCompat.getPointerCount(ev);
  for (int i=0; i < pointerCount; i++) {
    final int pointerId=MotionEventCompat.getPointerId(ev,i);
    final float x=MotionEventCompat.getX(ev,i);
    final float y=MotionEventCompat.getY(ev,i);
    if (mLastMotionX != null && mLastMotionY != null) {
      mLastMotionX[pointerId]=x;
      mLastMotionY[pointerId]=y;
    }
  }
}
Program: 25515
Project: 25515
Buggy source:
@Override protected boolean drawChild(Canvas canvas,View child,long drawingTime){
  boolean result;
  final int save=canvas.save(Canvas.CLIP_SAVE_FLAG);
  if (isSlidingEnabled() && mSlideableView != child) {
    if (!mOverlayContent) {
      canvas.getClipBounds(mTmpRect);
      if (mIsSlidingUp) {
        mTmpRect.bottom=Math.min(mTmpRect.bottom,mSlideableView.getTop());
      }
 else {
        mTmpRect.top=Math.max(mTmpRect.top,mSlideableView.getBottom());
      }
      canvas.clipRect(mTmpRect);
    }
  }
  result=super.drawChild(canvas,child,drawingTime);
  canvas.restoreToCount(save);
  if (mCoveredFadeColor != 0 && mSlideOffset > 0) {
    final int baseAlpha=(mCoveredFadeColor & 0xff000000) >>> 24;
    final int imag=(int)(baseAlpha * mSlideOffset);
    final int color=imag << 24 | (mCoveredFadeColor & 0xffffff);
    mCoveredFadePaint.setColor(color);
    canvas.drawRect(mTmpRect,mCoveredFadePaint);
  }
  return result;
}

Fixed version (ground truth):
@Override protected boolean drawChild(Canvas canvas,View child,long drawingTime){
  boolean result;
  final int save=canvas.save(Canvas.CLIP_SAVE_FLAG);
  if (isSlidingEnabled() && mSlideableView != child) {
    if (!mOverlayContent) {
      canvas.getClipBounds(mTmpRect);
      if (mIsSlidingUp) {
        mTmpRect.bottom=Math.min(mTmpRect.bottom,mSlideableView.getTop());
      }
 else {
        mTmpRect.top=Math.max(mTmpRect.top,mSlideableView.getBottom());
      }
      canvas.clipRect(mTmpRect);
    }
    if (mCoveredFadeColor != 0 && mSlideOffset > 0) {
      final int baseAlpha=(mCoveredFadeColor & 0xff000000) >>> 24;
      final int imag=(int)(baseAlpha * mSlideOffset);
      final int color=imag << 24 | (mCoveredFadeColor & 0xffffff);
      mCoveredFadePaint.setColor(color);
      canvas.drawRect(mTmpRect,mCoveredFadePaint);
    }
  }
  result=super.drawChild(canvas,child,drawingTime);
  canvas.restoreToCount(save);
  return result;
}
Program: 25517
Project: 25517
Buggy source:
@SuppressLint("String_Node_Str") private void onPanelDragged(int newTop){
  mSlideOffset=computeSlideOffset(newTop);
  if (mParallaxOffset > 0 && mSlideOffset >= 0) {
    int mainViewOffset=getCurrentParalaxOffset();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mMainView.setTranslationY(mainViewOffset);
    }
 else {
      AnimatorProxy.wrap(mMainView).setTranslationY(mainViewOffset);
    }
  }
  dispatchOnPanelSlide(mSlideableView);
  if (mSlideOffset <= 0 && !mOverlayContent) {
    LayoutParams lp=(LayoutParams)mMainView.getLayoutParams();
    lp.height=mIsSlidingUp ? (newTop - getPaddingBottom()) : (getHeight() - getPaddingBottom() - mSlideableView.getMeasuredHeight()- newTop);
    mMainView.requestLayout();
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void onPanelDragged(int newTop){
  mSlideState=SlideState.DRAGGING;
  mSlideOffset=computeSlideOffset(newTop);
  if (mParallaxOffset > 0 && mSlideOffset >= 0) {
    int mainViewOffset=getCurrentParalaxOffset();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mMainView.setTranslationY(mainViewOffset);
    }
 else {
      AnimatorProxy.wrap(mMainView).setTranslationY(mainViewOffset);
    }
  }
  dispatchOnPanelSlide(mSlideableView);
  if (mSlideOffset <= 0 && !mOverlayContent) {
    LayoutParams lp=(LayoutParams)mMainView.getLayoutParams();
    lp.height=mIsSlidingUp ? (newTop - getPaddingBottom()) : (getHeight() - getPaddingBottom() - mSlideableView.getMeasuredHeight()- newTop);
    mMainView.requestLayout();
  }
}
Program: 25518
Project: 25518
Buggy source:
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isSlidingEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    setAllChildrenVisible();
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isSlidingEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}
Program: 25519
Project: 25519
Buggy source:
/** 
 * Collapse the sliding pane if it is currently slideable. If first layout has already completed this will animate.
 * @return true if the pane was slideable and is now collapsed/in the process of collapsing
 */
public boolean collapsePanel(){
  if (isPanelHidden())   return false;
  return collapsePanel(mSlideableView,0);
}

Fixed version (ground truth):
/** 
 * Collapse the sliding pane if it is currently slideable. If first layout has already completed this will animate.
 * @return true if the pane was slideable and is now collapsed/in the process of collapsing
 */
public boolean collapsePanel(){
  if (mSlideState == SlideState.HIDDEN || mSlideState == SlideState.COLLAPSED)   return false;
  return collapsePanel(mSlideableView,0);
}
Program: 25520
Project: 25520
Buggy source:
@Override public void onViewDragStateChanged(int state){
  if (mDragHelper.getViewDragState() == ViewDragHelper.STATE_IDLE) {
    mSlideOffset=computeSlideOffset(mSlideableView.getTop());
    if (mSlideOffset == 1) {
      if (mSlideState != SlideState.EXPANDED) {
        updateObscuredViewVisibility();
        mSlideState=SlideState.EXPANDED;
        dispatchOnPanelExpanded(mSlideableView);
      }
    }
 else     if (mSlideOffset == 0) {
      if (mSlideState != SlideState.COLLAPSED) {
        mSlideState=SlideState.COLLAPSED;
        dispatchOnPanelCollapsed(mSlideableView);
      }
    }
 else     if (mSlideOffset < 0) {
      mSlideState=SlideState.HIDDEN;
      mIsPanelBeingHidden=false;
    }
 else     if (mSlideState != SlideState.ANCHORED) {
      updateObscuredViewVisibility();
      mSlideState=SlideState.ANCHORED;
      dispatchOnPanelAnchored(mSlideableView);
    }
  }
}

Fixed version (ground truth):
@Override public void onViewDragStateChanged(int state){
  if (mDragHelper.getViewDragState() == ViewDragHelper.STATE_IDLE) {
    mSlideOffset=computeSlideOffset(mSlideableView.getTop());
    if (mSlideOffset == 1) {
      if (mSlideState != SlideState.EXPANDED) {
        updateObscuredViewVisibility();
        mSlideState=SlideState.EXPANDED;
        dispatchOnPanelExpanded(mSlideableView);
      }
    }
 else     if (mSlideOffset == 0) {
      if (mSlideState != SlideState.COLLAPSED) {
        mSlideState=SlideState.COLLAPSED;
        dispatchOnPanelCollapsed(mSlideableView);
      }
    }
 else     if (mSlideOffset < 0) {
      mSlideState=SlideState.HIDDEN;
      mSlideableView.setVisibility(View.GONE);
      dispatchOnPanelHidden(mSlideableView);
    }
 else     if (mSlideState != SlideState.ANCHORED) {
      updateObscuredViewVisibility();
      mSlideState=SlideState.ANCHORED;
      dispatchOnPanelAnchored(mSlideableView);
    }
  }
}