nus-yam/ex-repair huggingface dataset:
Program: 194765
Project: 194765
Buggy source:
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link Build.VERSION.SDK_INT} is greater than {@link VERSION_CODES.LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}

Fixed version (ground truth):
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link android.os.Build.VERSION#SDK_INT} is greater than{@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}
Program: 194766
Project: 194766
Buggy source:
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link Build.VERSION.SDK_INT} is greater than {@link VERSION_CODES.LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}

Fixed version (ground truth):
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link android.os.Build.VERSION#SDK_INT} is greater than{@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}
Program: 194767
Project: 194767
Buggy source:
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link Build.VERSION.SDK_INT} is greater than {@link VERSION_CODES.LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}

Fixed version (ground truth):
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link android.os.Build.VERSION#SDK_INT} is greater than{@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}
Program: 194768
Project: 194768
Buggy source:
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link Build.VERSION.SDK_INT} is greater than {@link VERSION_CODES.LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}

Fixed version (ground truth):
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link android.os.Build.VERSION#SDK_INT} is greater than{@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}
Program: 194769
Project: 194769
Buggy source:
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link Build.VERSION.SDK_INT} is greater than {@link VERSION_CODES.LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}

Fixed version (ground truth):
/** 
 * Changes the pressed state of the key. <p>Toggled state of the key will be flipped when all the following conditions are fulfilled:</p> <ul> <li>This is a sticky key, that is,   {@link #sticky} is {@code true}. <li>The parameter   {@code inside} is {@code true}. <li>  {@link android.os.Build.VERSION#SDK_INT} is greater than{@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}. </ul>
 * @param inside whether the finger was released inside the key. Works only on Android M andlater. See the method document for details.
 * @see #onPressed()
 */
public void onReleased(boolean inside){
  pressed=!pressed;
  if (sticky && inside) {
    on=!on;
  }
}
Program: 194770
Project: 194770
Buggy source:
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    return fd;
  }
}

Fixed version (ground truth):
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    mClosed=true;
    mGuard.close();
    releaseResources();
    return fd;
  }
}
Program: 194771
Project: 194771
Buggy source:
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    return fd;
  }
}

Fixed version (ground truth):
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    mClosed=true;
    mGuard.close();
    releaseResources();
    return fd;
  }
}
Program: 194772
Project: 194772
Buggy source:
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    return fd;
  }
}

Fixed version (ground truth):
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    mClosed=true;
    mGuard.close();
    releaseResources();
    return fd;
  }
}
Program: 194773
Project: 194773
Buggy source:
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    return fd;
  }
}

Fixed version (ground truth):
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    mClosed=true;
    mGuard.close();
    releaseResources();
    return fd;
  }
}
Program: 194774
Project: 194774
Buggy source:
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    return fd;
  }
}

Fixed version (ground truth):
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    mClosed=true;
    mGuard.close();
    releaseResources();
    return fd;
  }
}
Program: 194775
Project: 194775
Buggy source:
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    return fd;
  }
}

Fixed version (ground truth):
/** 
 * Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code. <p> You should not detach when the original creator of the descriptor is expecting a reliable signal through   {@link #close()} or{@link #closeWithError(String)}.
 * @see #canDetectErrors()
 */
public int detachFd(){
  if (mWrapped != null) {
    return mWrapped.detachFd();
  }
 else {
    if (mClosed) {
      throw new IllegalStateException("String_Node_Str");
    }
    final int fd=getFd();
    Parcel.clearFileDescriptor(mFd);
    writeCommStatusAndClose(Status.DETACHED,null);
    mClosed=true;
    mGuard.close();
    releaseResources();
    return fd;
  }
}
Program: 194776
Project: 194776
Buggy source:
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  for (  Runnable runnable : mAnimationFinishedRunnables) {
    runnable.run();
  }
  mAnimationFinishedRunnables.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
}
Program: 194777
Project: 194777
Buggy source:
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
}

Fixed version (ground truth):
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
  runAnimationFinishedRunnables();
}
Program: 194778
Project: 194778
Buggy source:
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  for (  Runnable runnable : mAnimationFinishedRunnables) {
    runnable.run();
  }
  mAnimationFinishedRunnables.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
}
Program: 194779
Project: 194779
Buggy source:
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
}

Fixed version (ground truth):
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
  runAnimationFinishedRunnables();
}
Program: 194780
Project: 194780
Buggy source:
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  for (  Runnable runnable : mAnimationFinishedRunnables) {
    runnable.run();
  }
  mAnimationFinishedRunnables.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
}
Program: 194781
Project: 194781
Buggy source:
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
}

Fixed version (ground truth):
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
  runAnimationFinishedRunnables();
}
Program: 194782
Project: 194782
Buggy source:
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  for (  Runnable runnable : mAnimationFinishedRunnables) {
    runnable.run();
  }
  mAnimationFinishedRunnables.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
}
Program: 194783
Project: 194783
Buggy source:
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
}

Fixed version (ground truth):
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
  runAnimationFinishedRunnables();
}
Program: 194784
Project: 194784
Buggy source:
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  for (  Runnable runnable : mAnimationFinishedRunnables) {
    runnable.run();
  }
  mAnimationFinishedRunnables.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
}
Program: 194785
Project: 194785
Buggy source:
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
}

Fixed version (ground truth):
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
  runAnimationFinishedRunnables();
}
Program: 194786
Project: 194786
Buggy source:
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  for (  Runnable runnable : mAnimationFinishedRunnables) {
    runnable.run();
  }
  mAnimationFinishedRunnables.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
}
Program: 194787
Project: 194787
Buggy source:
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
}

Fixed version (ground truth):
private void applyCurrentState(){
  mCurrentStackScrollState.apply();
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
  runAnimationFinishedRunnables();
}
Program: 194827
Project: 194827
Buggy source:
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  if (row != null) {
    row.reset();
  }
}

Fixed version (ground truth):
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  lastFullScreenIntentLaunchTime=NOT_LAUNCHED_YET;
  if (row != null) {
    row.reset();
  }
}
Program: 194828
Project: 194828
Buggy source:
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(notification);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}

Fixed version (ground truth):
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(shadeEntry);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
      shadeEntry.notifyFullScreenIntentLaunched();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}
Program: 194829
Project: 194829
Buggy source:
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}

Fixed version (ground truth):
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
        entry.entry.notifyFullScreenIntentLaunched();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}
Program: 194832
Project: 194832
Buggy source:
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  if (row != null) {
    row.reset();
  }
}

Fixed version (ground truth):
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  lastFullScreenIntentLaunchTime=NOT_LAUNCHED_YET;
  if (row != null) {
    row.reset();
  }
}
Program: 194833
Project: 194833
Buggy source:
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(notification);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}

Fixed version (ground truth):
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(shadeEntry);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
      shadeEntry.notifyFullScreenIntentLaunched();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}
Program: 194834
Project: 194834
Buggy source:
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}

Fixed version (ground truth):
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
        entry.entry.notifyFullScreenIntentLaunched();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}
Program: 194837
Project: 194837
Buggy source:
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  if (row != null) {
    row.reset();
  }
}

Fixed version (ground truth):
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  lastFullScreenIntentLaunchTime=NOT_LAUNCHED_YET;
  if (row != null) {
    row.reset();
  }
}
Program: 194838
Project: 194838
Buggy source:
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(notification);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}

Fixed version (ground truth):
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(shadeEntry);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
      shadeEntry.notifyFullScreenIntentLaunched();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}
Program: 194839
Project: 194839
Buggy source:
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}

Fixed version (ground truth):
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
        entry.entry.notifyFullScreenIntentLaunched();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}
Program: 194842
Project: 194842
Buggy source:
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  if (row != null) {
    row.reset();
  }
}

Fixed version (ground truth):
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  lastFullScreenIntentLaunchTime=NOT_LAUNCHED_YET;
  if (row != null) {
    row.reset();
  }
}
Program: 194843
Project: 194843
Buggy source:
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(notification);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}

Fixed version (ground truth):
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(shadeEntry);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
      shadeEntry.notifyFullScreenIntentLaunched();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}
Program: 194844
Project: 194844
Buggy source:
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}

Fixed version (ground truth):
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
        entry.entry.notifyFullScreenIntentLaunched();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}
Program: 194847
Project: 194847
Buggy source:
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  if (row != null) {
    row.reset();
  }
}

Fixed version (ground truth):
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  lastFullScreenIntentLaunchTime=NOT_LAUNCHED_YET;
  if (row != null) {
    row.reset();
  }
}
Program: 194848
Project: 194848
Buggy source:
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(notification);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}

Fixed version (ground truth):
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(shadeEntry);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
      shadeEntry.notifyFullScreenIntentLaunched();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}
Program: 194849
Project: 194849
Buggy source:
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}

Fixed version (ground truth):
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
        entry.entry.notifyFullScreenIntentLaunched();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}
Program: 194852
Project: 194852
Buggy source:
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  if (row != null) {
    row.reset();
  }
}

Fixed version (ground truth):
/** 
 * Resets the notification entry to be re-used.
 */
public void reset(){
  autoRedacted=false;
  legacy=false;
  lastFullScreenIntentLaunchTime=NOT_LAUNCHED_YET;
  if (row != null) {
    row.reset();
  }
}
Program: 194853
Project: 194853
Buggy source:
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(notification);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}

Fixed version (ground truth):
@Override public void addNotification(StatusBarNotification notification,RankingMap ranking,Entry oldEntry){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + notification.getKey());
  Entry shadeEntry=createNotificationViews(notification);
  if (shadeEntry == null) {
    return;
  }
  boolean isHeadsUped=mUseHeadsUp && shouldInterrupt(shadeEntry);
  if (isHeadsUped) {
    mHeadsUpManager.showNotification(shadeEntry);
    setNotificationShown(notification);
  }
  if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
    awakenDreams();
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,notification.getKey());
      notification.getNotification().fullScreenIntent.send();
      shadeEntry.notifyFullScreenIntentLaunched();
    }
 catch (    PendingIntent.CanceledException e) {
    }
  }
  addNotificationViews(shadeEntry,ranking);
  setAreThereNotifications();
}
Program: 194854
Project: 194854
Buggy source:
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}

Fixed version (ground truth):
@Override public void maybeEscalateHeadsUp(){
  TreeSet<HeadsUpManager.HeadsUpEntry> entries=mHeadsUpManager.getSortedEntries();
  for (  HeadsUpManager.HeadsUpEntry entry : entries) {
    final StatusBarNotification sbn=entry.entry.notification;
    final Notification notification=sbn.getNotification();
    if (notification.fullScreenIntent != null) {
      if (DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      try {
        EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,sbn.getKey());
        notification.fullScreenIntent.send();
        entry.entry.notifyFullScreenIntentLaunched();
      }
 catch (      PendingIntent.CanceledException e) {
      }
    }
  }
  mHeadsUpManager.releaseAllImmediately();
}
Program: 194855
Project: 194855
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 - when2 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Alarm a1,Alarm a2){
  long when1=a1.whenElapsed;
  long when2=a2.whenElapsed;
  if (when1 > when2) {
    return 1;
  }
  if (when1 < when2) {
    return -1;
  }
  return 0;
}
Program: 194857
Project: 194857
Buggy source:
/** 
 * Shows this popup at the specified coordinates. The specified coordinates may be adjusted to make sure the popup is entirely on-screen.
 */
public void show(Rect contentRect){
  Preconditions.checkNotNull(contentRect);
  if (isShowing()) {
    return;
  }
  mHidden=false;
  mDismissed=false;
  cancelDismissAndHideAnimations();
  cancelOverflowAnimations();
  if (mContentContainer.getChildCount() == 0) {
    setMainPanelAsContent();
    mContentContainer.setAlpha(0);
  }
  updateOverflowHeight(contentRect.top - (mMarginVertical * 2));
  refreshCoordinatesAndOverflowDirection(contentRect);
  preparePopupContent();
  mPopupWindow.showAtLocation(mParent,Gravity.NO_GRAVITY,mCoords.x,mCoords.y);
  setTouchableSurfaceInsetsComputer();
  runShowAnimation();
}

Fixed version (ground truth):
/** 
 * Shows this popup at the specified coordinates. The specified coordinates may be adjusted to make sure the popup is entirely on-screen.
 */
public void show(Rect contentRect){
  Preconditions.checkNotNull(contentRect);
  if (isShowing()) {
    return;
  }
  mHidden=false;
  mDismissed=false;
  cancelDismissAndHideAnimations();
  cancelOverflowAnimations();
  if (mContentContainer.getChildCount() == 0) {
    setMainPanelAsContent();
    mContentContainer.setAlpha(0);
  }
  refreshViewPort();
  updateOverflowHeight(contentRect.top - (mMarginVertical * 2) - mViewPort.top);
  refreshCoordinatesAndOverflowDirection(contentRect);
  preparePopupContent();
  mPopupWindow.showAtLocation(mParent,Gravity.NO_GRAVITY,mCoords.x,mCoords.y);
  setTouchableSurfaceInsetsComputer();
  runShowAnimation();
}
Program: 194858
Project: 194858
Buggy source:
/** 
 * Updates the coordinates of this popup. The specified coordinates may be adjusted to make sure the popup is entirely on-screen. This is a no-op if this popup is not showing.
 */
public void updateCoordinates(Rect contentRect){
  Preconditions.checkNotNull(contentRect);
  if (!isShowing() || !mPopupWindow.isShowing()) {
    return;
  }
  cancelOverflowAnimations();
  refreshCoordinatesAndOverflowDirection(contentRect);
  preparePopupContent();
  mPopupWindow.update(mCoords.x,mCoords.y,getWidth(),getHeight());
}

Fixed version (ground truth):
/** 
 * Updates the coordinates of this popup. The specified coordinates may be adjusted to make sure the popup is entirely on-screen. This is a no-op if this popup is not showing.
 */
public void updateCoordinates(Rect contentRect){
  Preconditions.checkNotNull(contentRect);
  if (!isShowing() || !mPopupWindow.isShowing()) {
    return;
  }
  cancelOverflowAnimations();
  refreshViewPort();
  refreshCoordinatesAndOverflowDirection(contentRect);
  preparePopupContent();
  mPopupWindow.update(mCoords.x,mCoords.y,getWidth(),getHeight());
}
Program: 194859
Project: 194859
Buggy source:
private void refreshCoordinatesAndOverflowDirection(Rect contentRect){
  int x=contentRect.centerX() - getWidth() / 2;
  int y;
  if (contentRect.top > getHeight()) {
    y=contentRect.top - getHeight();
    mOverflowDirection=FloatingToolbarPopup.OVERFLOW_DIRECTION_UP;
  }
 else   if (contentRect.top > getToolbarHeightWithVerticalMargin()) {
    y=contentRect.top - getToolbarHeightWithVerticalMargin();
    mOverflowDirection=FloatingToolbarPopup.OVERFLOW_DIRECTION_DOWN;
  }
 else {
    y=contentRect.bottom;
    mOverflowDirection=FloatingToolbarPopup.OVERFLOW_DIRECTION_DOWN;
  }
  mCoords.set(x,y);
  if (mOverflowPanel != null) {
    mOverflowPanel.setOverflowDirection(mOverflowDirection);
  }
}

Fixed version (ground truth):
private void refreshCoordinatesAndOverflowDirection(Rect contentRect){
  int x=contentRect.centerX() - getWidth() / 2;
  int y;
  if (contentRect.top - getHeight() > mViewPort.top) {
    y=contentRect.top - getHeight();
    mOverflowDirection=FloatingToolbarPopup.OVERFLOW_DIRECTION_UP;
  }
 else   if (contentRect.top - getToolbarHeightWithVerticalMargin() > mViewPort.top) {
    y=contentRect.top - getToolbarHeightWithVerticalMargin();
    mOverflowDirection=FloatingToolbarPopup.OVERFLOW_DIRECTION_DOWN;
  }
 else {
    y=contentRect.bottom;
    mOverflowDirection=FloatingToolbarPopup.OVERFLOW_DIRECTION_DOWN;
  }
  x=Math.max(0,Math.min(x,mViewPort.right - getWidth()));
  mCoords.set(x,y);
  if (mOverflowPanel != null) {
    mOverflowPanel.setOverflowDirection(mOverflowDirection);
  }
}