nus-yam/ex-repair huggingface dataset:
Program: 194861
Project: 194861
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: 194862
Project: 194862
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: 194863
Project: 194863
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);
  }
}
Program: 194865
Project: 194865
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: 194866
Project: 194866
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: 194867
Project: 194867
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);
  }
}
Program: 194869
Project: 194869
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: 194870
Project: 194870
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: 194871
Project: 194871
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);
  }
}
Program: 194872
Project: 194872
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
switch (intent.getAction()) {
case CONFIG_SERVICE_INTERFACE:
case BIND_SERVICE_INTERFACE:
    return mStubWrapper;
default :
  return null;
}
}
Program: 194873
Project: 194873
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
  if (!CONFIG_SERVICE_INTERFACE.equals(intent.getAction()) || !BIND_SERVICE_INTERFACE.equals(intent.getAction())) {
    return null;
  }
  return mStubWrapper;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}
Program: 194875
Project: 194875
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: 194876
Project: 194876
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: 194877
Project: 194877
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);
  }
}
Program: 194878
Project: 194878
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
  if (!CONFIG_SERVICE_INTERFACE.equals(intent.getAction()) || !BIND_SERVICE_INTERFACE.equals(intent.getAction())) {
    return null;
  }
  return mStubWrapper;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}
Program: 194879
Project: 194879
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
switch (intent.getAction()) {
case CONFIG_SERVICE_INTERFACE:
case BIND_SERVICE_INTERFACE:
    return mStubWrapper;
default :
  return null;
}
}
Program: 194880
Project: 194880
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
switch (intent.getAction()) {
case CONFIG_SERVICE_INTERFACE:
case BIND_SERVICE_INTERFACE:
    return mStubWrapper;
default :
  return null;
}
}
Program: 194881
Project: 194881
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
switch (intent.getAction()) {
case CONFIG_SERVICE_INTERFACE:
case BIND_SERVICE_INTERFACE:
    return mStubWrapper;
default :
  return null;
}
}
Program: 194882
Project: 194882
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
  if (!CONFIG_SERVICE_INTERFACE.equals(intent.getAction()) || !BIND_SERVICE_INTERFACE.equals(intent.getAction())) {
    return null;
  }
  return mStubWrapper;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}
Program: 194883
Project: 194883
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
  if (!CONFIG_SERVICE_INTERFACE.equals(intent.getAction()) || !BIND_SERVICE_INTERFACE.equals(intent.getAction())) {
    return null;
  }
  return mStubWrapper;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}
Program: 194884
Project: 194884
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
switch (intent.getAction()) {
case CONFIG_SERVICE_INTERFACE:
case BIND_SERVICE_INTERFACE:
    return mStubWrapper;
default :
  return null;
}
}
Program: 194885
Project: 194885
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
  if (!CONFIG_SERVICE_INTERFACE.equals(intent.getAction()) || !BIND_SERVICE_INTERFACE.equals(intent.getAction())) {
    return null;
  }
  return mStubWrapper;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}
Program: 194886
Project: 194886
Buggy source:
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
  if (!CONFIG_SERVICE_INTERFACE.equals(intent.getAction()) || !BIND_SERVICE_INTERFACE.equals(intent.getAction())) {
    return null;
  }
  return mStubWrapper;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public final IBinder onBind(Intent intent){
}
Program: 194887
Project: 194887
Buggy source:
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
  }
}

Fixed version (ground truth):
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    if (getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_UNKNOWN) {
      setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
    }
  }
}
Program: 194888
Project: 194888
Buggy source:
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
  }
}

Fixed version (ground truth):
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    if (getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_UNKNOWN) {
      setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
    }
  }
}
Program: 194889
Project: 194889
Buggy source:
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
  }
}

Fixed version (ground truth):
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    if (getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_UNKNOWN) {
      setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
    }
  }
}
Program: 194890
Project: 194890
Buggy source:
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
  }
}

Fixed version (ground truth):
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    if (getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_UNKNOWN) {
      setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
    }
  }
}
Program: 194891
Project: 194891
Buggy source:
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
  }
}

Fixed version (ground truth):
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    if (getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_UNKNOWN) {
      setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
    }
  }
}
Program: 194892
Project: 194892
Buggy source:
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
  }
}

Fixed version (ground truth):
private void processPhonebookAccess(){
  if (mDevice.getBondState() != BluetoothDevice.BOND_BONDED)   return;
  ParcelUuid[] uuids=mDevice.getUuids();
  if (BluetoothUuid.containsAnyUuid(uuids,PbapServerProfile.PBAB_CLIENT_UUIDS)) {
    if (getPhonebookPermissionChoice() == CachedBluetoothDevice.ACCESS_UNKNOWN) {
      setPhonebookPermissionChoice(CachedBluetoothDevice.ACCESS_ALLOWED);
    }
  }
}
Program: 194893
Project: 194893
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  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 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194894
Project: 194894
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  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 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194895
Project: 194895
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  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 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194896
Project: 194896
Buggy source:
/** 
 * Initializes and acquires the scene, creating various Android objects such as context, inflater, and parser.
 * @param timeout the time to wait if another rendering is happening.
 * @return whether the scene was prepared
 * @see #acquire(long)
 * @see #release()
 */
public Result init(long timeout){
  Result result=acquireLock(timeout);
  if (result != null) {
    return result;
  }
  ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
  HardwareConfig hardwareConfig=mParams.getHardwareConfig();
  DisplayMetrics metrics=new DisplayMetrics();
  metrics.densityDpi=metrics.noncompatDensityDpi=hardwareConfig.getDensity().getDpiValue();
  metrics.density=metrics.noncompatDensity=metrics.densityDpi / (float)DisplayMetrics.DENSITY_DEFAULT;
  metrics.scaledDensity=metrics.noncompatScaledDensity=metrics.density;
  metrics.widthPixels=metrics.noncompatWidthPixels=hardwareConfig.getScreenWidth();
  metrics.heightPixels=metrics.noncompatHeightPixels=hardwareConfig.getScreenHeight();
  metrics.xdpi=metrics.noncompatXdpi=hardwareConfig.getXdpi();
  metrics.ydpi=metrics.noncompatYdpi=hardwareConfig.getYdpi();
  RenderResources resources=mParams.getResources();
  mContext=new BridgeContext(mParams.getProjectKey(),metrics,resources,mParams.getAssets(),mParams.getLayoutlibCallback(),getConfiguration(),mParams.getTargetSdkVersion(),mParams.isRtlSupported());
  setUp();
  return SUCCESS.createResult();
}

Fixed version (ground truth):
/** 
 * Initializes and acquires the scene, creating various Android objects such as context, inflater, and parser.
 * @param timeout the time to wait if another rendering is happening.
 * @return whether the scene was prepared
 * @see #acquire(long)
 * @see #release()
 */
public Result init(long timeout){
  Result result=acquireLock(timeout);
  if (result != null) {
    return result;
  }
  HardwareConfig hardwareConfig=mParams.getHardwareConfig();
  DisplayMetrics metrics=new DisplayMetrics();
  metrics.densityDpi=metrics.noncompatDensityDpi=hardwareConfig.getDensity().getDpiValue();
  metrics.density=metrics.noncompatDensity=metrics.densityDpi / (float)DisplayMetrics.DENSITY_DEFAULT;
  metrics.scaledDensity=metrics.noncompatScaledDensity=metrics.density;
  metrics.widthPixels=metrics.noncompatWidthPixels=hardwareConfig.getScreenWidth();
  metrics.heightPixels=metrics.noncompatHeightPixels=hardwareConfig.getScreenHeight();
  metrics.xdpi=metrics.noncompatXdpi=hardwareConfig.getXdpi();
  metrics.ydpi=metrics.noncompatYdpi=hardwareConfig.getYdpi();
  RenderResources resources=mParams.getResources();
  mContext=new BridgeContext(mParams.getProjectKey(),metrics,resources,mParams.getAssets(),mParams.getLayoutlibCallback(),getConfiguration(),mParams.getTargetSdkVersion(),mParams.isRtlSupported());
  setUp();
  return SUCCESS.createResult();
}
Program: 194897
Project: 194897
Buggy source:
/** 
 * Sets up the session for rendering. <p/> The counterpart is   {@link #tearDown()}.
 */
private void setUp(){
  mContext.initResources();
  sCurrentContext=mContext;
  InputMethodManager.getInstance();
  LayoutLog currentLog=mParams.getLog();
  Bridge.setLog(currentLog);
  mContext.getRenderResources().setFrameworkResourceIdProvider(this);
  mContext.getRenderResources().setLogger(currentLog);
}

Fixed version (ground truth):
/** 
 * Sets up the session for rendering. <p/> The counterpart is   {@link #tearDown()}.
 */
private void setUp(){
  ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
  mContext.initResources();
  sCurrentContext=mContext;
  InputMethodManager.getInstance();
  LayoutLog currentLog=mParams.getLog();
  Bridge.setLog(currentLog);
  mContext.getRenderResources().setFrameworkResourceIdProvider(this);
  mContext.getRenderResources().setLogger(currentLog);
}
Program: 194898
Project: 194898
Buggy source:
/** 
 * Initializes and acquires the scene, creating various Android objects such as context, inflater, and parser.
 * @param timeout the time to wait if another rendering is happening.
 * @return whether the scene was prepared
 * @see #acquire(long)
 * @see #release()
 */
public Result init(long timeout){
  Result result=acquireLock(timeout);
  if (result != null) {
    return result;
  }
  ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
  HardwareConfig hardwareConfig=mParams.getHardwareConfig();
  DisplayMetrics metrics=new DisplayMetrics();
  metrics.densityDpi=metrics.noncompatDensityDpi=hardwareConfig.getDensity().getDpiValue();
  metrics.density=metrics.noncompatDensity=metrics.densityDpi / (float)DisplayMetrics.DENSITY_DEFAULT;
  metrics.scaledDensity=metrics.noncompatScaledDensity=metrics.density;
  metrics.widthPixels=metrics.noncompatWidthPixels=hardwareConfig.getScreenWidth();
  metrics.heightPixels=metrics.noncompatHeightPixels=hardwareConfig.getScreenHeight();
  metrics.xdpi=metrics.noncompatXdpi=hardwareConfig.getXdpi();
  metrics.ydpi=metrics.noncompatYdpi=hardwareConfig.getYdpi();
  RenderResources resources=mParams.getResources();
  mContext=new BridgeContext(mParams.getProjectKey(),metrics,resources,mParams.getAssets(),mParams.getLayoutlibCallback(),getConfiguration(),mParams.getTargetSdkVersion(),mParams.isRtlSupported());
  setUp();
  return SUCCESS.createResult();
}

Fixed version (ground truth):
/** 
 * Initializes and acquires the scene, creating various Android objects such as context, inflater, and parser.
 * @param timeout the time to wait if another rendering is happening.
 * @return whether the scene was prepared
 * @see #acquire(long)
 * @see #release()
 */
public Result init(long timeout){
  Result result=acquireLock(timeout);
  if (result != null) {
    return result;
  }
  HardwareConfig hardwareConfig=mParams.getHardwareConfig();
  DisplayMetrics metrics=new DisplayMetrics();
  metrics.densityDpi=metrics.noncompatDensityDpi=hardwareConfig.getDensity().getDpiValue();
  metrics.density=metrics.noncompatDensity=metrics.densityDpi / (float)DisplayMetrics.DENSITY_DEFAULT;
  metrics.scaledDensity=metrics.noncompatScaledDensity=metrics.density;
  metrics.widthPixels=metrics.noncompatWidthPixels=hardwareConfig.getScreenWidth();
  metrics.heightPixels=metrics.noncompatHeightPixels=hardwareConfig.getScreenHeight();
  metrics.xdpi=metrics.noncompatXdpi=hardwareConfig.getXdpi();
  metrics.ydpi=metrics.noncompatYdpi=hardwareConfig.getYdpi();
  RenderResources resources=mParams.getResources();
  mContext=new BridgeContext(mParams.getProjectKey(),metrics,resources,mParams.getAssets(),mParams.getLayoutlibCallback(),getConfiguration(),mParams.getTargetSdkVersion(),mParams.isRtlSupported());
  setUp();
  return SUCCESS.createResult();
}
Program: 194899
Project: 194899
Buggy source:
/** 
 * Sets up the session for rendering. <p/> The counterpart is   {@link #tearDown()}.
 */
private void setUp(){
  mContext.initResources();
  sCurrentContext=mContext;
  InputMethodManager.getInstance();
  LayoutLog currentLog=mParams.getLog();
  Bridge.setLog(currentLog);
  mContext.getRenderResources().setFrameworkResourceIdProvider(this);
  mContext.getRenderResources().setLogger(currentLog);
}

Fixed version (ground truth):
/** 
 * Sets up the session for rendering. <p/> The counterpart is   {@link #tearDown()}.
 */
private void setUp(){
  ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
  mContext.initResources();
  sCurrentContext=mContext;
  InputMethodManager.getInstance();
  LayoutLog currentLog=mParams.getLog();
  Bridge.setLog(currentLog);
  mContext.getRenderResources().setFrameworkResourceIdProvider(this);
  mContext.getRenderResources().setLogger(currentLog);
}
Program: 194900
Project: 194900
Buggy source:
/** 
 * Initializes and acquires the scene, creating various Android objects such as context, inflater, and parser.
 * @param timeout the time to wait if another rendering is happening.
 * @return whether the scene was prepared
 * @see #acquire(long)
 * @see #release()
 */
public Result init(long timeout){
  Result result=acquireLock(timeout);
  if (result != null) {
    return result;
  }
  ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
  HardwareConfig hardwareConfig=mParams.getHardwareConfig();
  DisplayMetrics metrics=new DisplayMetrics();
  metrics.densityDpi=metrics.noncompatDensityDpi=hardwareConfig.getDensity().getDpiValue();
  metrics.density=metrics.noncompatDensity=metrics.densityDpi / (float)DisplayMetrics.DENSITY_DEFAULT;
  metrics.scaledDensity=metrics.noncompatScaledDensity=metrics.density;
  metrics.widthPixels=metrics.noncompatWidthPixels=hardwareConfig.getScreenWidth();
  metrics.heightPixels=metrics.noncompatHeightPixels=hardwareConfig.getScreenHeight();
  metrics.xdpi=metrics.noncompatXdpi=hardwareConfig.getXdpi();
  metrics.ydpi=metrics.noncompatYdpi=hardwareConfig.getYdpi();
  RenderResources resources=mParams.getResources();
  mContext=new BridgeContext(mParams.getProjectKey(),metrics,resources,mParams.getAssets(),mParams.getLayoutlibCallback(),getConfiguration(),mParams.getTargetSdkVersion(),mParams.isRtlSupported());
  setUp();
  return SUCCESS.createResult();
}

Fixed version (ground truth):
/** 
 * Initializes and acquires the scene, creating various Android objects such as context, inflater, and parser.
 * @param timeout the time to wait if another rendering is happening.
 * @return whether the scene was prepared
 * @see #acquire(long)
 * @see #release()
 */
public Result init(long timeout){
  Result result=acquireLock(timeout);
  if (result != null) {
    return result;
  }
  HardwareConfig hardwareConfig=mParams.getHardwareConfig();
  DisplayMetrics metrics=new DisplayMetrics();
  metrics.densityDpi=metrics.noncompatDensityDpi=hardwareConfig.getDensity().getDpiValue();
  metrics.density=metrics.noncompatDensity=metrics.densityDpi / (float)DisplayMetrics.DENSITY_DEFAULT;
  metrics.scaledDensity=metrics.noncompatScaledDensity=metrics.density;
  metrics.widthPixels=metrics.noncompatWidthPixels=hardwareConfig.getScreenWidth();
  metrics.heightPixels=metrics.noncompatHeightPixels=hardwareConfig.getScreenHeight();
  metrics.xdpi=metrics.noncompatXdpi=hardwareConfig.getXdpi();
  metrics.ydpi=metrics.noncompatYdpi=hardwareConfig.getYdpi();
  RenderResources resources=mParams.getResources();
  mContext=new BridgeContext(mParams.getProjectKey(),metrics,resources,mParams.getAssets(),mParams.getLayoutlibCallback(),getConfiguration(),mParams.getTargetSdkVersion(),mParams.isRtlSupported());
  setUp();
  return SUCCESS.createResult();
}
Program: 194901
Project: 194901
Buggy source:
/** 
 * Sets up the session for rendering. <p/> The counterpart is   {@link #tearDown()}.
 */
private void setUp(){
  mContext.initResources();
  sCurrentContext=mContext;
  InputMethodManager.getInstance();
  LayoutLog currentLog=mParams.getLog();
  Bridge.setLog(currentLog);
  mContext.getRenderResources().setFrameworkResourceIdProvider(this);
  mContext.getRenderResources().setLogger(currentLog);
}

Fixed version (ground truth):
/** 
 * Sets up the session for rendering. <p/> The counterpart is   {@link #tearDown()}.
 */
private void setUp(){
  ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
  mContext.initResources();
  sCurrentContext=mContext;
  InputMethodManager.getInstance();
  LayoutLog currentLog=mParams.getLog();
  Bridge.setLog(currentLog);
  mContext.getRenderResources().setFrameworkResourceIdProvider(this);
  mContext.getRenderResources().setLogger(currentLog);
}
Program: 194902
Project: 194902
Buggy source:
/** 
 * Initializes and acquires the scene, creating various Android objects such as context, inflater, and parser.
 * @param timeout the time to wait if another rendering is happening.
 * @return whether the scene was prepared
 * @see #acquire(long)
 * @see #release()
 */
public Result init(long timeout){
  Result result=acquireLock(timeout);
  if (result != null) {
    return result;
  }
  ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
  HardwareConfig hardwareConfig=mParams.getHardwareConfig();
  DisplayMetrics metrics=new DisplayMetrics();
  metrics.densityDpi=metrics.noncompatDensityDpi=hardwareConfig.getDensity().getDpiValue();
  metrics.density=metrics.noncompatDensity=metrics.densityDpi / (float)DisplayMetrics.DENSITY_DEFAULT;
  metrics.scaledDensity=metrics.noncompatScaledDensity=metrics.density;
  metrics.widthPixels=metrics.noncompatWidthPixels=hardwareConfig.getScreenWidth();
  metrics.heightPixels=metrics.noncompatHeightPixels=hardwareConfig.getScreenHeight();
  metrics.xdpi=metrics.noncompatXdpi=hardwareConfig.getXdpi();
  metrics.ydpi=metrics.noncompatYdpi=hardwareConfig.getYdpi();
  RenderResources resources=mParams.getResources();
  mContext=new BridgeContext(mParams.getProjectKey(),metrics,resources,mParams.getAssets(),mParams.getLayoutlibCallback(),getConfiguration(),mParams.getTargetSdkVersion(),mParams.isRtlSupported());
  setUp();
  return SUCCESS.createResult();
}

Fixed version (ground truth):
/** 
 * Initializes and acquires the scene, creating various Android objects such as context, inflater, and parser.
 * @param timeout the time to wait if another rendering is happening.
 * @return whether the scene was prepared
 * @see #acquire(long)
 * @see #release()
 */
public Result init(long timeout){
  Result result=acquireLock(timeout);
  if (result != null) {
    return result;
  }
  HardwareConfig hardwareConfig=mParams.getHardwareConfig();
  DisplayMetrics metrics=new DisplayMetrics();
  metrics.densityDpi=metrics.noncompatDensityDpi=hardwareConfig.getDensity().getDpiValue();
  metrics.density=metrics.noncompatDensity=metrics.densityDpi / (float)DisplayMetrics.DENSITY_DEFAULT;
  metrics.scaledDensity=metrics.noncompatScaledDensity=metrics.density;
  metrics.widthPixels=metrics.noncompatWidthPixels=hardwareConfig.getScreenWidth();
  metrics.heightPixels=metrics.noncompatHeightPixels=hardwareConfig.getScreenHeight();
  metrics.xdpi=metrics.noncompatXdpi=hardwareConfig.getXdpi();
  metrics.ydpi=metrics.noncompatYdpi=hardwareConfig.getYdpi();
  RenderResources resources=mParams.getResources();
  mContext=new BridgeContext(mParams.getProjectKey(),metrics,resources,mParams.getAssets(),mParams.getLayoutlibCallback(),getConfiguration(),mParams.getTargetSdkVersion(),mParams.isRtlSupported());
  setUp();
  return SUCCESS.createResult();
}
Program: 194903
Project: 194903
Buggy source:
/** 
 * Sets up the session for rendering. <p/> The counterpart is   {@link #tearDown()}.
 */
private void setUp(){
  mContext.initResources();
  sCurrentContext=mContext;
  InputMethodManager.getInstance();
  LayoutLog currentLog=mParams.getLog();
  Bridge.setLog(currentLog);
  mContext.getRenderResources().setFrameworkResourceIdProvider(this);
  mContext.getRenderResources().setLogger(currentLog);
}

Fixed version (ground truth):
/** 
 * Sets up the session for rendering. <p/> The counterpart is   {@link #tearDown()}.
 */
private void setUp(){
  ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
  mContext.initResources();
  sCurrentContext=mContext;
  InputMethodManager.getInstance();
  LayoutLog currentLog=mParams.getLog();
  Bridge.setLog(currentLog);
  mContext.getRenderResources().setFrameworkResourceIdProvider(this);
  mContext.getRenderResources().setLogger(currentLog);
}
Program: 194904
Project: 194904
Buggy source:
public int compare(Alarm a1,Alarm a2){
  long when1=a1.when;
  long when2=a2.when;
  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 > 0) {
    return 1;
  }
  if (when1 - when2 < 0) {
    return -1;
  }
  return 0;
}
Program: 194907
Project: 194907
Buggy source:
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p>The reference coordinate-system used is different from the world coordinate-system defined for the rotation matrix:</p> <ul> <li>X is defined as the vector product <b>Y.Z</b> (It is tangential to the ground at the device's current location and roughly points West).</li> <li>Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.</li> <li>Z points towards the center of the Earth and is perpendicular to the ground.</li> </ul> <p> <center><img src="../../../images/axis_globe_inverted.png" alt="Inverted world coordinate-system diagram." border="0" /></center> </p> <p> All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}

Fixed version (ground truth):
/** 
 * Computes the device's orientation based on the rotation matrix. <p> When it returns, the array values is filled with the result: <ul> <li>values[0]: <i>azimuth</i>, rotation around the -Z axis, i.e. the opposite direction of Z axis.</li> <li>values[1]: <i>pitch</i>, rotation around the -X axis, i.e the opposite direction of X axis.</li> <li>values[2]: <i>roll</i>, rotation around the Y axis.</li> </ul> <p> Applying these three intrinsic rotations in azimuth, pitch and roll order transforms identity matrix to the rotation matrix given in input R. All three angles above are in <b>radians</b> and <b>positive</b> in the <b>counter-clockwise</b> direction. Range of output is: azimuth from -&pi; to &pi;, pitch from -&pi;/2 to &pi;/2 and roll from -&pi; to &pi;.
 * @param R rotation matrix see  {@link #getRotationMatrix}.
 * @param values an array of 3 floats to hold the result.
 * @return The array values passed as argument.
 * @see #getRotationMatrix(float[],float[],float[],float[])
 * @see GeomagneticField
 */
public static float[] getOrientation(float[] R,float values[]){
  if (R.length == 9) {
    values[0]=(float)Math.atan2(R[1],R[4]);
    values[1]=(float)Math.asin(-R[7]);
    values[2]=(float)Math.atan2(-R[6],R[8]);
  }
 else {
    values[0]=(float)Math.atan2(R[1],R[5]);
    values[1]=(float)Math.asin(-R[9]);
    values[2]=(float)Math.atan2(-R[8],R[10]);
  }
  return values;
}