nus-yam/ex-repair huggingface dataset:
Program: 183857
Project: 183857
Buggy source:
void updateOrientationListenerLp(){
  if (!mOrientationListener.canDetectOrientation()) {
    return;
  }
  if (localLOGV)   Log.i(TAG,"String_Node_Str" + mScreenOn + "String_Node_Str"+ mCurrentAppOrientation+ "String_Node_Str"+ mOrientationSensorEnabled);
  boolean disable=true;
  if (mScreenOn) {
    if (needSensorRunningLp()) {
      disable=false;
      if (!mOrientationSensorEnabled) {
        mOrientationListener.enable();
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        mSensorRotation=-1;
        mOrientationSensorEnabled=true;
      }
    }
  }
  if (disable && mOrientationSensorEnabled) {
    mOrientationListener.disable();
    if (localLOGV)     Log.i(TAG,"String_Node_Str");
    mSensorRotation=-1;
    mOrientationSensorEnabled=false;
  }
}

Fixed version (ground truth):
void updateOrientationListenerLp(){
  if (!mOrientationListener.canDetectOrientation()) {
    return;
  }
  if (localLOGV)   Log.i(TAG,"String_Node_Str" + mScreenOn + "String_Node_Str"+ mCurrentAppOrientation+ "String_Node_Str"+ mOrientationSensorEnabled);
  boolean disable=true;
  if (mScreenOn) {
    if (needSensorRunningLp()) {
      disable=false;
      if (!mOrientationSensorEnabled) {
        mOrientationListener.enable();
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        mOrientationSensorEnabled=true;
      }
    }
  }
  if (disable && mOrientationSensorEnabled) {
    mOrientationListener.disable();
    if (localLOGV)     Log.i(TAG,"String_Node_Str");
    mOrientationSensorEnabled=false;
  }
}
Program: 183858
Project: 183858
Buggy source:
public void update(){
  ContentResolver resolver=mContext.getContentResolver();
synchronized (mLock) {
    mEndcallBehavior=Settings.System.getInt(resolver,Settings.System.END_BUTTON_BEHAVIOR,DEFAULT_ENDCALL_BEHAVIOR);
    int accelerometerDefault=Settings.System.getInt(resolver,Settings.System.ACCELEROMETER_ROTATION,DEFAULT_ACCELEROMETER_ROTATION);
    if (mAccelerometerDefault != accelerometerDefault) {
      mAccelerometerDefault=accelerometerDefault;
      updateOrientationListenerLp();
    }
    String imId=Settings.Secure.getString(resolver,Settings.Secure.DEFAULT_INPUT_METHOD);
    boolean hasSoftInput=imId != null && imId.length() > 0;
    if (mHasSoftInput != hasSoftInput) {
      mHasSoftInput=hasSoftInput;
      updateRotation();
    }
  }
}

Fixed version (ground truth):
public void update(){
  ContentResolver resolver=mContext.getContentResolver();
synchronized (mLock) {
    mEndcallBehavior=Settings.System.getInt(resolver,Settings.System.END_BUTTON_BEHAVIOR,DEFAULT_ENDCALL_BEHAVIOR);
    mFancyRotationAnimation=Settings.System.getInt(resolver,"String_Node_Str",0);
    int accelerometerDefault=Settings.System.getInt(resolver,Settings.System.ACCELEROMETER_ROTATION,DEFAULT_ACCELEROMETER_ROTATION);
    if (mAccelerometerDefault != accelerometerDefault) {
      mAccelerometerDefault=accelerometerDefault;
      updateOrientationListenerLp();
    }
    String imId=Settings.Secure.getString(resolver,Settings.Secure.DEFAULT_INPUT_METHOD);
    boolean hasSoftInput=imId != null && imId.length() > 0;
    if (mHasSoftInput != hasSoftInput) {
      mHasSoftInput=hasSoftInput;
      updateRotation(1);
    }
  }
}
Program: 183859
Project: 183859
Buggy source:
boolean useSensorForOrientationLp(){
  if (mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR) {
    return true;
  }
  if (mAccelerometerDefault != 0 && (mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_USER || mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
boolean useSensorForOrientationLp(int appOrientation){
  if (appOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR) {
    return true;
  }
  if (mAccelerometerDefault != 0 && (appOrientation == ActivityInfo.SCREEN_ORIENTATION_USER || appOrientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)) {
    return true;
  }
  return false;
}
Program: 183860
Project: 183860
Buggy source:
@Override public void onOrientationChanged(int rotation){
  if (rotation != mSensorRotation) {
    if (localLOGV)     Log.i(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ mSensorRotation);
    mSensorRotation=rotation;
    try {
      mWindowManager.setRotation(rotation,false);
    }
 catch (    RemoteException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void onOrientationChanged(int rotation){
  if (true)   Log.i(TAG,"String_Node_Str" + rotation);
  try {
    mWindowManager.setRotation(rotation,false,1);
  }
 catch (  RemoteException e) {
  }
}
Program: 183861
Project: 183861
Buggy source:
public void performEnableScreen(){
synchronized (mWindowMap) {
    if (mDisplayEnabled) {
      return;
    }
    if (!mSystemBooted) {
      return;
    }
    final int N=mWindows.size();
    for (int i=0; i < N; i++) {
      WindowState w=(WindowState)mWindows.get(i);
      if (w.isVisibleLw() && !w.isDisplayedLw()) {
        return;
      }
    }
    mDisplayEnabled=true;
    if (false) {
      Log.i(TAG,"String_Node_Str");
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      this.dump(null,pw,null);
      Log.i(TAG,sw.toString());
    }
    try {
      IBinder surfaceFlinger=ServiceManager.getService("String_Node_Str");
      if (surfaceFlinger != null) {
        Parcel data=Parcel.obtain();
        data.writeInterfaceToken("String_Node_Str");
        surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION,data,null,0);
        data.recycle();
      }
    }
 catch (    RemoteException ex) {
      Log.e(TAG,"String_Node_Str");
    }
  }
  mPolicy.enableScreenAfterBoot();
  setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION,false,0);
}

Fixed version (ground truth):
public void performEnableScreen(){
synchronized (mWindowMap) {
    if (mDisplayEnabled) {
      return;
    }
    if (!mSystemBooted) {
      return;
    }
    final int N=mWindows.size();
    for (int i=0; i < N; i++) {
      WindowState w=(WindowState)mWindows.get(i);
      if (w.isVisibleLw() && !w.isDisplayedLw()) {
        return;
      }
    }
    mDisplayEnabled=true;
    if (false) {
      Log.i(TAG,"String_Node_Str");
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      this.dump(null,pw,null);
      Log.i(TAG,sw.toString());
    }
    try {
      IBinder surfaceFlinger=ServiceManager.getService("String_Node_Str");
      if (surfaceFlinger != null) {
        Parcel data=Parcel.obtain();
        data.writeInterfaceToken("String_Node_Str");
        surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION,data,null,0);
        data.recycle();
      }
    }
 catch (    RemoteException ex) {
      Log.e(TAG,"String_Node_Str");
    }
  }
  mPolicy.enableScreenAfterBoot();
  setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION,false,mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
}
Program: 183862
Project: 183862
Buggy source:
public boolean setRotationUncheckedLocked(int rotation,int animFlags){
  boolean changed;
  if (rotation == WindowManagerPolicy.USE_LAST_ROTATION) {
    rotation=mRequestedRotation;
  }
 else {
    mRequestedRotation=rotation;
  }
  if (DEBUG_ORIENTATION)   Log.v(TAG,"String_Node_Str" + rotation);
  rotation=mPolicy.rotationForOrientationLw(mForcedAppOrientation,mRotation,mDisplayEnabled);
  if (DEBUG_ORIENTATION)   Log.v(TAG,"String_Node_Str" + rotation);
  changed=mDisplayEnabled && mRotation != rotation;
  if (changed) {
    if (DEBUG_ORIENTATION)     Log.v(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ mRotation+ "String_Node_Str"+ mForcedAppOrientation+ "String_Node_Str"+ mRequestedRotation+ "String_Node_Str");
    mRotation=rotation;
    mWindowsFreezingScreen=true;
    mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
    mH.sendMessageDelayed(mH.obtainMessage(H.WINDOW_FREEZE_TIMEOUT),2000);
    startFreezingDisplayLocked();
    Log.i(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ animFlags);
    mQueue.setOrientation(rotation);
    if (mDisplayEnabled) {
      Surface.setOrientation(0,rotation);
    }
    for (int i=mWindows.size() - 1; i >= 0; i--) {
      WindowState w=(WindowState)mWindows.get(i);
      if (w.mSurface != null) {
        w.mOrientationChanging=true;
      }
    }
    for (int i=mRotationWatchers.size() - 1; i >= 0; i--) {
      try {
        mRotationWatchers.get(i).onRotationChanged(rotation);
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}

Fixed version (ground truth):
public boolean setRotationUncheckedLocked(int rotation,int animFlags){
  boolean changed;
  if (rotation == WindowManagerPolicy.USE_LAST_ROTATION) {
    rotation=mRequestedRotation;
  }
 else {
    mRequestedRotation=rotation;
    mLastRotationFlags=animFlags;
  }
  if (DEBUG_ORIENTATION)   Log.v(TAG,"String_Node_Str" + rotation);
  rotation=mPolicy.rotationForOrientationLw(mForcedAppOrientation,mRotation,mDisplayEnabled);
  if (DEBUG_ORIENTATION)   Log.v(TAG,"String_Node_Str" + rotation);
  changed=mDisplayEnabled && mRotation != rotation;
  if (changed) {
    if (DEBUG_ORIENTATION)     Log.v(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ mRotation+ "String_Node_Str"+ mForcedAppOrientation+ "String_Node_Str"+ mRequestedRotation+ "String_Node_Str");
    mRotation=rotation;
    mWindowsFreezingScreen=true;
    mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
    mH.sendMessageDelayed(mH.obtainMessage(H.WINDOW_FREEZE_TIMEOUT),2000);
    startFreezingDisplayLocked();
    Log.i(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ animFlags);
    mQueue.setOrientation(rotation);
    if (mDisplayEnabled) {
      Surface.setOrientation(0,rotation,animFlags);
    }
    for (int i=mWindows.size() - 1; i >= 0; i--) {
      WindowState w=(WindowState)mWindows.get(i);
      if (w.mSurface != null) {
        w.mOrientationChanging=true;
      }
    }
    for (int i=mRotationWatchers.size() - 1; i >= 0; i--) {
      try {
        mRotationWatchers.get(i).onRotationChanged(rotation);
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}
Program: 183863
Project: 183863
Buggy source:
Configuration updateOrientationFromAppTokensLocked(Configuration appConfig,IBinder freezeThisOneIfNeeded){
  boolean changed=false;
  long ident=Binder.clearCallingIdentity();
  try {
    int req=computeForcedAppOrientationLocked();
    if (req != mForcedAppOrientation) {
      changed=true;
      mForcedAppOrientation=req;
      mPolicy.setCurrentOrientationLw(req);
    }
    if (changed) {
      changed=setRotationUncheckedLocked(WindowManagerPolicy.USE_LAST_ROTATION,1);
      if (changed) {
        if (freezeThisOneIfNeeded != null) {
          AppWindowToken wtoken=findAppWindowToken(freezeThisOneIfNeeded);
          if (wtoken != null) {
            startAppFreezingScreenLocked(wtoken,ActivityInfo.CONFIG_ORIENTATION);
          }
        }
        return computeNewConfigurationLocked();
      }
    }
    if (appConfig != null) {
      mTempConfiguration.setToDefaults();
      if (computeNewConfigurationLocked(mTempConfiguration)) {
        if (appConfig.diff(mTempConfiguration) != 0) {
          Log.i(TAG,"String_Node_Str" + mTempConfiguration);
          return new Configuration(mTempConfiguration);
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  return null;
}

Fixed version (ground truth):
Configuration updateOrientationFromAppTokensLocked(Configuration appConfig,IBinder freezeThisOneIfNeeded){
  boolean changed=false;
  long ident=Binder.clearCallingIdentity();
  try {
    int req=computeForcedAppOrientationLocked();
    if (req != mForcedAppOrientation) {
      changed=true;
      mForcedAppOrientation=req;
      mPolicy.setCurrentOrientationLw(req);
    }
    if (changed) {
      changed=setRotationUncheckedLocked(WindowManagerPolicy.USE_LAST_ROTATION,mLastRotationFlags & (~Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE));
      if (changed) {
        if (freezeThisOneIfNeeded != null) {
          AppWindowToken wtoken=findAppWindowToken(freezeThisOneIfNeeded);
          if (wtoken != null) {
            startAppFreezingScreenLocked(wtoken,ActivityInfo.CONFIG_ORIENTATION);
          }
        }
        return computeNewConfigurationLocked();
      }
    }
    if (appConfig != null) {
      mTempConfiguration.setToDefaults();
      if (computeNewConfigurationLocked(mTempConfiguration)) {
        if (appConfig.diff(mTempConfiguration) != 0) {
          Log.i(TAG,"String_Node_Str" + mTempConfiguration);
          return new Configuration(mTempConfiguration);
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  return null;
}
Program: 183865
Project: 183865
Buggy source:
void updateRotation(int animFlags){
  mPowerManager.setKeyboardVisibility(mLidOpen);
  int rotation=Surface.ROTATION_0;
  if (mLidOpen) {
    rotation=Surface.ROTATION_90;
  }
  try {
    mWindowManager.setRotation(rotation,true,animFlags);
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
void updateRotation(int animFlags){
  mPowerManager.setKeyboardVisibility(mLidOpen);
  int rotation=Surface.ROTATION_0;
  if (mLidOpen) {
    rotation=Surface.ROTATION_90;
  }
  try {
    mWindowManager.setRotation(rotation,true,mFancyRotationAnimation | animFlags);
  }
 catch (  RemoteException e) {
  }
}
Program: 183866
Project: 183866
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void enableScreenAfterBoot(){
  readLidState();
  updateRotation(0);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void enableScreenAfterBoot(){
  readLidState();
  updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
}
Program: 183867
Project: 183867
Buggy source:
@Override public void onChange(boolean selfChange){
  update();
  try {
    mWindowManager.setRotation(USE_LAST_ROTATION,false,1);
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange){
  update();
  try {
    mWindowManager.setRotation(USE_LAST_ROTATION,false,mFancyRotationAnimation);
  }
 catch (  RemoteException e) {
  }
}
Program: 183868
Project: 183868
Buggy source:
/** 
 * {@inheritDoc} 
 */
public boolean preprocessInputEventTq(RawInputEvent event){
switch (event.type) {
case RawInputEvent.EV_SW:
    if (event.keycode == 0) {
      mLidOpen=event.value == 0;
      updateRotation(0);
      if (keyguardIsShowingTq()) {
        if (mLidOpen) {
          mKeyguardMediator.pokeWakelock();
        }
      }
 else {
        if (mLidOpen) {
          mPowerManager.userActivity(SystemClock.uptimeMillis(),false,LocalPowerManager.BUTTON_EVENT);
        }
 else {
          mPowerManager.userActivity(SystemClock.uptimeMillis(),false,LocalPowerManager.OTHER_EVENT);
        }
      }
    }
}
return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean preprocessInputEventTq(RawInputEvent event){
switch (event.type) {
case RawInputEvent.EV_SW:
    if (event.keycode == 0) {
      mLidOpen=event.value == 0;
      updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
      if (keyguardIsShowingTq()) {
        if (mLidOpen) {
          mKeyguardMediator.pokeWakelock();
        }
      }
 else {
        if (mLidOpen) {
          mPowerManager.userActivity(SystemClock.uptimeMillis(),false,LocalPowerManager.BUTTON_EVENT);
        }
 else {
          mPowerManager.userActivity(SystemClock.uptimeMillis(),false,LocalPowerManager.OTHER_EVENT);
        }
      }
    }
}
return false;
}
Program: 183869
Project: 183869
Buggy source:
public void update(){
  ContentResolver resolver=mContext.getContentResolver();
synchronized (mLock) {
    mEndcallBehavior=Settings.System.getInt(resolver,Settings.System.END_BUTTON_BEHAVIOR,DEFAULT_ENDCALL_BEHAVIOR);
    mFancyRotationAnimation=Settings.System.getInt(resolver,"String_Node_Str",0);
    int accelerometerDefault=Settings.System.getInt(resolver,Settings.System.ACCELEROMETER_ROTATION,DEFAULT_ACCELEROMETER_ROTATION);
    if (mAccelerometerDefault != accelerometerDefault) {
      mAccelerometerDefault=accelerometerDefault;
      updateOrientationListenerLp();
    }
    String imId=Settings.Secure.getString(resolver,Settings.Secure.DEFAULT_INPUT_METHOD);
    boolean hasSoftInput=imId != null && imId.length() > 0;
    if (mHasSoftInput != hasSoftInput) {
      mHasSoftInput=hasSoftInput;
      updateRotation(1);
    }
  }
}

Fixed version (ground truth):
public void update(){
  ContentResolver resolver=mContext.getContentResolver();
synchronized (mLock) {
    mEndcallBehavior=Settings.System.getInt(resolver,Settings.System.END_BUTTON_BEHAVIOR,DEFAULT_ENDCALL_BEHAVIOR);
    mFancyRotationAnimation=Settings.System.getInt(resolver,"String_Node_Str",0) != 0 ? 0x80 : 0;
    int accelerometerDefault=Settings.System.getInt(resolver,Settings.System.ACCELEROMETER_ROTATION,DEFAULT_ACCELEROMETER_ROTATION);
    if (mAccelerometerDefault != accelerometerDefault) {
      mAccelerometerDefault=accelerometerDefault;
      updateOrientationListenerLp();
    }
    String imId=Settings.Secure.getString(resolver,Settings.Secure.DEFAULT_INPUT_METHOD);
    boolean hasSoftInput=imId != null && imId.length() > 0;
    if (mHasSoftInput != hasSoftInput) {
      mHasSoftInput=hasSoftInput;
      updateRotation(0);
    }
  }
}
Program: 183870
Project: 183870
Buggy source:
@Override public void onOrientationChanged(int rotation){
  if (true)   Log.i(TAG,"String_Node_Str" + rotation);
  try {
    mWindowManager.setRotation(rotation,false,1);
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
@Override public void onOrientationChanged(int rotation){
  if (true)   Log.i(TAG,"String_Node_Str" + rotation);
  try {
    mWindowManager.setRotation(rotation,false,mFancyRotationAnimation);
  }
 catch (  RemoteException e) {
  }
}
Program: 183871
Project: 183871
Buggy source:
public void performEnableScreen(){
synchronized (mWindowMap) {
    if (mDisplayEnabled) {
      return;
    }
    if (!mSystemBooted) {
      return;
    }
    final int N=mWindows.size();
    for (int i=0; i < N; i++) {
      WindowState w=(WindowState)mWindows.get(i);
      if (w.isVisibleLw() && !w.isDisplayedLw()) {
        return;
      }
    }
    mDisplayEnabled=true;
    if (false) {
      Log.i(TAG,"String_Node_Str");
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      this.dump(null,pw,null);
      Log.i(TAG,sw.toString());
    }
    try {
      IBinder surfaceFlinger=ServiceManager.getService("String_Node_Str");
      if (surfaceFlinger != null) {
        Parcel data=Parcel.obtain();
        data.writeInterfaceToken("String_Node_Str");
        surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION,data,null,0);
        data.recycle();
      }
    }
 catch (    RemoteException ex) {
      Log.e(TAG,"String_Node_Str");
    }
  }
  mPolicy.enableScreenAfterBoot();
  setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION,false,0);
}

Fixed version (ground truth):
public void performEnableScreen(){
synchronized (mWindowMap) {
    if (mDisplayEnabled) {
      return;
    }
    if (!mSystemBooted) {
      return;
    }
    final int N=mWindows.size();
    for (int i=0; i < N; i++) {
      WindowState w=(WindowState)mWindows.get(i);
      if (w.isVisibleLw() && !w.isDisplayedLw()) {
        return;
      }
    }
    mDisplayEnabled=true;
    if (false) {
      Log.i(TAG,"String_Node_Str");
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      this.dump(null,pw,null);
      Log.i(TAG,sw.toString());
    }
    try {
      IBinder surfaceFlinger=ServiceManager.getService("String_Node_Str");
      if (surfaceFlinger != null) {
        Parcel data=Parcel.obtain();
        data.writeInterfaceToken("String_Node_Str");
        surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION,data,null,0);
        data.recycle();
      }
    }
 catch (    RemoteException ex) {
      Log.e(TAG,"String_Node_Str");
    }
  }
  mPolicy.enableScreenAfterBoot();
  setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION,false,mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
}
Program: 183872
Project: 183872
Buggy source:
public boolean setRotationUncheckedLocked(int rotation,int animFlags){
  boolean changed;
  if (rotation == WindowManagerPolicy.USE_LAST_ROTATION) {
    rotation=mRequestedRotation;
  }
 else {
    mRequestedRotation=rotation;
  }
  if (DEBUG_ORIENTATION)   Log.v(TAG,"String_Node_Str" + rotation);
  rotation=mPolicy.rotationForOrientationLw(mForcedAppOrientation,mRotation,mDisplayEnabled);
  if (DEBUG_ORIENTATION)   Log.v(TAG,"String_Node_Str" + rotation);
  changed=mDisplayEnabled && mRotation != rotation;
  if (changed) {
    if (DEBUG_ORIENTATION)     Log.v(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ mRotation+ "String_Node_Str"+ mForcedAppOrientation+ "String_Node_Str"+ mRequestedRotation+ "String_Node_Str");
    mRotation=rotation;
    mWindowsFreezingScreen=true;
    mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
    mH.sendMessageDelayed(mH.obtainMessage(H.WINDOW_FREEZE_TIMEOUT),2000);
    startFreezingDisplayLocked();
    Log.i(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ animFlags);
    mQueue.setOrientation(rotation);
    if (mDisplayEnabled) {
      Surface.setOrientation(0,rotation);
    }
    for (int i=mWindows.size() - 1; i >= 0; i--) {
      WindowState w=(WindowState)mWindows.get(i);
      if (w.mSurface != null) {
        w.mOrientationChanging=true;
      }
    }
    for (int i=mRotationWatchers.size() - 1; i >= 0; i--) {
      try {
        mRotationWatchers.get(i).onRotationChanged(rotation);
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}

Fixed version (ground truth):
public boolean setRotationUncheckedLocked(int rotation,int animFlags){
  boolean changed;
  if (rotation == WindowManagerPolicy.USE_LAST_ROTATION) {
    rotation=mRequestedRotation;
  }
 else {
    mRequestedRotation=rotation;
    mLastRotationFlags=animFlags;
  }
  if (DEBUG_ORIENTATION)   Log.v(TAG,"String_Node_Str" + rotation);
  rotation=mPolicy.rotationForOrientationLw(mForcedAppOrientation,mRotation,mDisplayEnabled);
  if (DEBUG_ORIENTATION)   Log.v(TAG,"String_Node_Str" + rotation);
  changed=mDisplayEnabled && mRotation != rotation;
  if (changed) {
    if (DEBUG_ORIENTATION)     Log.v(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ mRotation+ "String_Node_Str"+ mForcedAppOrientation+ "String_Node_Str"+ mRequestedRotation+ "String_Node_Str");
    mRotation=rotation;
    mWindowsFreezingScreen=true;
    mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
    mH.sendMessageDelayed(mH.obtainMessage(H.WINDOW_FREEZE_TIMEOUT),2000);
    startFreezingDisplayLocked();
    Log.i(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ animFlags);
    mQueue.setOrientation(rotation);
    if (mDisplayEnabled) {
      Surface.setOrientation(0,rotation,animFlags);
    }
    for (int i=mWindows.size() - 1; i >= 0; i--) {
      WindowState w=(WindowState)mWindows.get(i);
      if (w.mSurface != null) {
        w.mOrientationChanging=true;
      }
    }
    for (int i=mRotationWatchers.size() - 1; i >= 0; i--) {
      try {
        mRotationWatchers.get(i).onRotationChanged(rotation);
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}
Program: 183873
Project: 183873
Buggy source:
Configuration updateOrientationFromAppTokensLocked(Configuration appConfig,IBinder freezeThisOneIfNeeded){
  boolean changed=false;
  long ident=Binder.clearCallingIdentity();
  try {
    int req=computeForcedAppOrientationLocked();
    if (req != mForcedAppOrientation) {
      changed=true;
      mForcedAppOrientation=req;
      mPolicy.setCurrentOrientationLw(req);
    }
    if (changed) {
      changed=setRotationUncheckedLocked(WindowManagerPolicy.USE_LAST_ROTATION,1);
      if (changed) {
        if (freezeThisOneIfNeeded != null) {
          AppWindowToken wtoken=findAppWindowToken(freezeThisOneIfNeeded);
          if (wtoken != null) {
            startAppFreezingScreenLocked(wtoken,ActivityInfo.CONFIG_ORIENTATION);
          }
        }
        return computeNewConfigurationLocked();
      }
    }
    if (appConfig != null) {
      mTempConfiguration.setToDefaults();
      if (computeNewConfigurationLocked(mTempConfiguration)) {
        if (appConfig.diff(mTempConfiguration) != 0) {
          Log.i(TAG,"String_Node_Str" + mTempConfiguration);
          return new Configuration(mTempConfiguration);
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  return null;
}

Fixed version (ground truth):
Configuration updateOrientationFromAppTokensLocked(Configuration appConfig,IBinder freezeThisOneIfNeeded){
  boolean changed=false;
  long ident=Binder.clearCallingIdentity();
  try {
    int req=computeForcedAppOrientationLocked();
    if (req != mForcedAppOrientation) {
      changed=true;
      mForcedAppOrientation=req;
      mPolicy.setCurrentOrientationLw(req);
    }
    if (changed) {
      changed=setRotationUncheckedLocked(WindowManagerPolicy.USE_LAST_ROTATION,mLastRotationFlags & (~Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE));
      if (changed) {
        if (freezeThisOneIfNeeded != null) {
          AppWindowToken wtoken=findAppWindowToken(freezeThisOneIfNeeded);
          if (wtoken != null) {
            startAppFreezingScreenLocked(wtoken,ActivityInfo.CONFIG_ORIENTATION);
          }
        }
        return computeNewConfigurationLocked();
      }
    }
    if (appConfig != null) {
      mTempConfiguration.setToDefaults();
      if (computeNewConfigurationLocked(mTempConfiguration)) {
        if (appConfig.diff(mTempConfiguration) != 0) {
          Log.i(TAG,"String_Node_Str" + mTempConfiguration);
          return new Configuration(mTempConfiguration);
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  return null;
}
Program: 183875
Project: 183875
Buggy source:
void observe(){
  ContentResolver resolver=mContext.getContentResolver();
  resolver.registerContentObserver(Settings.System.getUriFor(Settings.System.END_BUTTON_BEHAVIOR),false,this);
  resolver.registerContentObserver(Settings.System.getUriFor(Settings.System.ACCELEROMETER_ROTATION),false,this);
  resolver.registerContentObserver(Settings.Secure.getUriFor(Settings.Secure.DEFAULT_INPUT_METHOD),false,this);
  update();
}

Fixed version (ground truth):
void observe(){
  ContentResolver resolver=mContext.getContentResolver();
  resolver.registerContentObserver(Settings.System.getUriFor(Settings.System.END_BUTTON_BEHAVIOR),false,this);
  resolver.registerContentObserver(Settings.System.getUriFor(Settings.System.ACCELEROMETER_ROTATION),false,this);
  resolver.registerContentObserver(Settings.Secure.getUriFor(Settings.Secure.DEFAULT_INPUT_METHOD),false,this);
  resolver.registerContentObserver(Settings.System.getUriFor("String_Node_Str"),false,this);
  update();
}
Program: 183876
Project: 183876
Buggy source:
void updateRotation(){
  mPowerManager.setKeyboardVisibility(mLidOpen);
  int rotation=Surface.ROTATION_0;
  if (mLidOpen) {
    rotation=Surface.ROTATION_90;
  }
  try {
    mWindowManager.setRotation(rotation,true);
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
void updateRotation(int animFlags){
  mPowerManager.setKeyboardVisibility(mLidOpen);
  int rotation=Surface.ROTATION_0;
  if (mLidOpen) {
    rotation=Surface.ROTATION_90;
  }
  try {
    mWindowManager.setRotation(rotation,true,animFlags);
  }
 catch (  RemoteException e) {
  }
}
Program: 183877
Project: 183877
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void enableScreenAfterBoot(){
  readLidState();
  updateRotation();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void enableScreenAfterBoot(){
  readLidState();
  updateRotation(0);
}
Program: 183878
Project: 183878
Buggy source:
@Override public void onChange(boolean selfChange){
  update();
  try {
    mWindowManager.setRotation(USE_LAST_ROTATION,false);
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange){
  update();
  try {
    mWindowManager.setRotation(USE_LAST_ROTATION,false,1);
  }
 catch (  RemoteException e) {
  }
}
Program: 183879
Project: 183879
Buggy source:
/** 
 * {@inheritDoc} 
 */
public boolean preprocessInputEventTq(RawInputEvent event){
switch (event.type) {
case RawInputEvent.EV_SW:
    if (event.keycode == 0) {
      mLidOpen=event.value == 0;
      updateRotation();
      if (keyguardIsShowingTq()) {
        if (mLidOpen) {
          mKeyguardMediator.pokeWakelock();
        }
      }
 else {
        if (mLidOpen) {
          mPowerManager.userActivity(SystemClock.uptimeMillis(),false,LocalPowerManager.BUTTON_EVENT);
        }
 else {
          mPowerManager.userActivity(SystemClock.uptimeMillis(),false,LocalPowerManager.OTHER_EVENT);
        }
      }
    }
}
return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean preprocessInputEventTq(RawInputEvent event){
switch (event.type) {
case RawInputEvent.EV_SW:
    if (event.keycode == 0) {
      mLidOpen=event.value == 0;
      updateRotation(0);
      if (keyguardIsShowingTq()) {
        if (mLidOpen) {
          mKeyguardMediator.pokeWakelock();
        }
      }
 else {
        if (mLidOpen) {
          mPowerManager.userActivity(SystemClock.uptimeMillis(),false,LocalPowerManager.BUTTON_EVENT);
        }
 else {
          mPowerManager.userActivity(SystemClock.uptimeMillis(),false,LocalPowerManager.OTHER_EVENT);
        }
      }
    }
}
return false;
}
Program: 183880
Project: 183880
Buggy source:
public int rotationForOrientationLw(int orientation,int lastRotation,boolean displayEnabled){
synchronized (mLock) {
switch (orientation) {
case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
      return Surface.ROTATION_90;
case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
    return Surface.ROTATION_0;
}
if (mLidOpen) {
  return Surface.ROTATION_90;
}
 else {
  if (useSensorForOrientationLp()) {
    return mSensorRotation >= 0 ? mSensorRotation : lastRotation;
  }
  return Surface.ROTATION_0;
}
}
}

Fixed version (ground truth):
public int rotationForOrientationLw(int orientation,int lastRotation,boolean displayEnabled){
synchronized (mLock) {
switch (orientation) {
case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
      return Surface.ROTATION_90;
case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
    return Surface.ROTATION_0;
}
if (mLidOpen) {
  return Surface.ROTATION_90;
}
 else {
  if (useSensorForOrientationLp(orientation)) {
    int curRotation=mOrientationListener.getCurrentRotation();
    return curRotation >= 0 ? curRotation : lastRotation;
  }
  return Surface.ROTATION_0;
}
}
}
Program: 183881
Project: 183881
Buggy source:
void updateOrientationListenerLp(){
  if (!mOrientationListener.canDetectOrientation()) {
    return;
  }
  if (localLOGV)   Log.i(TAG,"String_Node_Str" + mScreenOn + "String_Node_Str"+ mCurrentAppOrientation+ "String_Node_Str"+ mOrientationSensorEnabled);
  boolean disable=true;
  if (mScreenOn) {
    if (needSensorRunningLp()) {
      disable=false;
      if (!mOrientationSensorEnabled) {
        mOrientationListener.enable();
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        mSensorRotation=-1;
        mOrientationSensorEnabled=true;
      }
    }
  }
  if (disable && mOrientationSensorEnabled) {
    mOrientationListener.disable();
    if (localLOGV)     Log.i(TAG,"String_Node_Str");
    mSensorRotation=-1;
    mOrientationSensorEnabled=false;
  }
}

Fixed version (ground truth):
void updateOrientationListenerLp(){
  if (!mOrientationListener.canDetectOrientation()) {
    return;
  }
  if (localLOGV)   Log.i(TAG,"String_Node_Str" + mScreenOn + "String_Node_Str"+ mCurrentAppOrientation+ "String_Node_Str"+ mOrientationSensorEnabled);
  boolean disable=true;
  if (mScreenOn) {
    if (needSensorRunningLp()) {
      disable=false;
      if (!mOrientationSensorEnabled) {
        mOrientationListener.enable();
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        mOrientationSensorEnabled=true;
      }
    }
  }
  if (disable && mOrientationSensorEnabled) {
    mOrientationListener.disable();
    if (localLOGV)     Log.i(TAG,"String_Node_Str");
    mOrientationSensorEnabled=false;
  }
}
Program: 183882
Project: 183882
Buggy source:
public void update(){
  ContentResolver resolver=mContext.getContentResolver();
synchronized (mLock) {
    mEndcallBehavior=Settings.System.getInt(resolver,Settings.System.END_BUTTON_BEHAVIOR,DEFAULT_ENDCALL_BEHAVIOR);
    int accelerometerDefault=Settings.System.getInt(resolver,Settings.System.ACCELEROMETER_ROTATION,DEFAULT_ACCELEROMETER_ROTATION);
    if (mAccelerometerDefault != accelerometerDefault) {
      mAccelerometerDefault=accelerometerDefault;
      updateOrientationListenerLp();
    }
    String imId=Settings.Secure.getString(resolver,Settings.Secure.DEFAULT_INPUT_METHOD);
    boolean hasSoftInput=imId != null && imId.length() > 0;
    if (mHasSoftInput != hasSoftInput) {
      mHasSoftInput=hasSoftInput;
      updateRotation();
    }
  }
}

Fixed version (ground truth):
public void update(){
  ContentResolver resolver=mContext.getContentResolver();
synchronized (mLock) {
    mEndcallBehavior=Settings.System.getInt(resolver,Settings.System.END_BUTTON_BEHAVIOR,DEFAULT_ENDCALL_BEHAVIOR);
    mFancyRotationAnimation=Settings.System.getInt(resolver,"String_Node_Str",0);
    int accelerometerDefault=Settings.System.getInt(resolver,Settings.System.ACCELEROMETER_ROTATION,DEFAULT_ACCELEROMETER_ROTATION);
    if (mAccelerometerDefault != accelerometerDefault) {
      mAccelerometerDefault=accelerometerDefault;
      updateOrientationListenerLp();
    }
    String imId=Settings.Secure.getString(resolver,Settings.Secure.DEFAULT_INPUT_METHOD);
    boolean hasSoftInput=imId != null && imId.length() > 0;
    if (mHasSoftInput != hasSoftInput) {
      mHasSoftInput=hasSoftInput;
      updateRotation(1);
    }
  }
}
Program: 183883
Project: 183883
Buggy source:
boolean useSensorForOrientationLp(){
  if (mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR) {
    return true;
  }
  if (mAccelerometerDefault != 0 && (mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_USER || mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
boolean useSensorForOrientationLp(int appOrientation){
  if (appOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR) {
    return true;
  }
  if (mAccelerometerDefault != 0 && (appOrientation == ActivityInfo.SCREEN_ORIENTATION_USER || appOrientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)) {
    return true;
  }
  return false;
}
Program: 183884
Project: 183884
Buggy source:
@Override public void onOrientationChanged(int rotation){
  if (rotation != mSensorRotation) {
    if (localLOGV)     Log.i(TAG,"String_Node_Str" + rotation + "String_Node_Str"+ mSensorRotation);
    mSensorRotation=rotation;
    try {
      mWindowManager.setRotation(rotation,false);
    }
 catch (    RemoteException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void onOrientationChanged(int rotation){
  if (true)   Log.i(TAG,"String_Node_Str" + rotation);
  try {
    mWindowManager.setRotation(rotation,false,1);
  }
 catch (  RemoteException e) {
  }
}
Program: 183885
Project: 183885
Buggy source:
/** 
 * Called when the dependency changes.
 * @param dependency The Preference that this Preference depends on.
 * @param disableDependent Set true to disable this Preference.
 */
public void onDependencyChanged(Preference dependency,boolean disableDependent){
  setEnabled(!disableDependent);
}

Fixed version (ground truth):
/** 
 * Called when the dependency changes.
 * @param dependency The Preference that this Preference depends on.
 * @param disableDependent Set true to disable this Preference.
 */
public void onDependencyChanged(Preference dependency,boolean disableDependent){
  if (mDependencyMet == disableDependent) {
    mDependencyMet=!disableDependent;
    notifyDependencyChange(shouldDisableDependents());
    notifyChanged();
  }
}
Program: 183886
Project: 183886
Buggy source:
/** 
 * Checks whether this Preference should be enabled in the list.
 * @return True if this Preference is enabled, false otherwise.
 */
public boolean isEnabled(){
  return mEnabled;
}

Fixed version (ground truth):
/** 
 * Checks whether this Preference should be enabled in the list.
 * @return True if this Preference is enabled, false otherwise.
 */
public boolean isEnabled(){
  return mEnabled && mDependencyMet;
}
Program: 183887
Project: 183887
Buggy source:
private boolean acquireWifiLockLocked(WifiLock wifiLock){
  mLocks.addLock(wifiLock);
  int uid=Binder.getCallingUid();
  long ident=Binder.clearCallingIdentity();
  try {
switch (wifiLock.mLockMode) {
case (WifiManager.WIFI_MODE_FULL):
      mBatteryStats.noteFullWifiLockAcquired(uid);
case (WifiManager.WIFI_MODE_SCAN_ONLY):
    mBatteryStats.noteScanWifiLockAcquired(uid);
}
}
 catch (RemoteException e) {
}
 finally {
Binder.restoreCallingIdentity(ident);
}
updateWifiState();
return true;
}

Fixed version (ground truth):
private boolean acquireWifiLockLocked(WifiLock wifiLock){
  mLocks.addLock(wifiLock);
  int uid=Binder.getCallingUid();
  long ident=Binder.clearCallingIdentity();
  try {
switch (wifiLock.mLockMode) {
case WifiManager.WIFI_MODE_FULL:
      ++mFullLocksAcquired;
    mBatteryStats.noteFullWifiLockAcquired(uid);
  break;
case WifiManager.WIFI_MODE_SCAN_ONLY:
++mScanLocksAcquired;
mBatteryStats.noteScanWifiLockAcquired(uid);
break;
}
}
 catch (RemoteException e) {
}
 finally {
Binder.restoreCallingIdentity(ident);
}
updateWifiState();
return true;
}
Program: 183888
Project: 183888
Buggy source:
private boolean releaseWifiLockLocked(IBinder lock){
  boolean hadLock;
  WifiLock wifiLock=mLocks.removeLock(lock);
  hadLock=(wifiLock != null);
  if (hadLock) {
    int uid=Binder.getCallingUid();
    long ident=Binder.clearCallingIdentity();
    try {
switch (wifiLock.mLockMode) {
case (WifiManager.WIFI_MODE_FULL):
        mBatteryStats.noteFullWifiLockReleased(uid);
case (WifiManager.WIFI_MODE_SCAN_ONLY):
      mBatteryStats.noteScanWifiLockReleased(uid);
  }
}
 catch (RemoteException e) {
}
 finally {
  Binder.restoreCallingIdentity(ident);
}
}
updateWifiState();
return hadLock;
}

Fixed version (ground truth):
private boolean releaseWifiLockLocked(IBinder lock){
  boolean hadLock;
  WifiLock wifiLock=mLocks.removeLock(lock);
  hadLock=(wifiLock != null);
  if (hadLock) {
    int uid=Binder.getCallingUid();
    long ident=Binder.clearCallingIdentity();
    try {
switch (wifiLock.mLockMode) {
case WifiManager.WIFI_MODE_FULL:
        ++mFullLocksReleased;
      mBatteryStats.noteFullWifiLockReleased(uid);
    break;
case WifiManager.WIFI_MODE_SCAN_ONLY:
  ++mScanLocksReleased;
mBatteryStats.noteScanWifiLockReleased(uid);
break;
}
}
 catch (RemoteException e) {
}
 finally {
Binder.restoreCallingIdentity(ident);
}
}
updateWifiState();
return hadLock;
}
Program: 183889
Project: 183889
Buggy source:
public synchronized boolean disconnectAndStop(){
  if (mRunState != RUN_STATE_STOPPING && mRunState != RUN_STATE_STOPPED) {
    setNotificationVisible(false,0,false,0);
    mRunState=RUN_STATE_STOPPING;
    return WifiNative.disconnectCommand();
  }
 else {
    releaseWakeLock();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * We want to stop the driver, but if we're connected to a network, we first want to disconnect, so that the supplicant is always in a known state (DISCONNECTED) when the driver is stopped.
 * @return {@code true} if the operation succeeds, which means that thedisconnect or stop command was initiated.
 */
public synchronized boolean disconnectAndStop(){
  if (mRunState != RUN_STATE_STOPPING && mRunState != RUN_STATE_STOPPED) {
    setNotificationVisible(false,0,false,0);
    mRunState=RUN_STATE_STOPPING;
    if (mWifiInfo.getSupplicantState() == SupplicantState.DORMANT) {
      return WifiNative.stopDriverCommand();
    }
 else {
      return WifiNative.disconnectCommand();
    }
  }
 else {
    releaseWakeLock();
  }
  return true;
}
Program: 183890
Project: 183890
Buggy source:
@Override public String toString(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str").append(mInterfaceName).append("String_Node_Str").append(mRunState).append(LS);
  sb.append(mWifiInfo).append(LS);
  sb.append(mDhcpInfo).append(LS);
  sb.append("String_Node_Str").append(mHaveIPAddress).append("String_Node_Str").append(mObtainingIPAddress).append("String_Node_Str").append(mIsScanModeActive).append(LS).append("String_Node_Str").append(mLastSignalLevel).append("String_Node_Str").append(mTornDownByConnMgr);
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str").append(mInterfaceName);
  sb.append("String_Node_Str");
  if (mRunState >= 1 && mRunState <= mRunStateNames.length) {
    sb.append(mRunStateNames[mRunState - 1]);
  }
 else {
    sb.append(mRunState);
  }
  sb.append(LS).append(mWifiInfo).append(LS);
  sb.append(mDhcpInfo).append(LS);
  sb.append("String_Node_Str").append(mHaveIPAddress).append("String_Node_Str").append(mObtainingIPAddress).append("String_Node_Str").append(mIsScanModeActive).append(LS).append("String_Node_Str").append(mLastSignalLevel).append("String_Node_Str").append(mTornDownByConnMgr);
  return sb.toString();
}
Program: 183892
Project: 183892
Buggy source:
public void dispatchKey(KeyEvent event){
  if (mSession != null && mSurface != null) {
    try {
      mSession.finishKey(mWindow);
    }
 catch (    RemoteException ex) {
    }
  }
}

Fixed version (ground truth):
public void dispatchKey(KeyEvent event){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (surfaceView.mSession != null && surfaceView.mSurface != null) {
      try {
        surfaceView.mSession.finishKey(surfaceView.mWindow);
      }
 catch (      RemoteException ex) {
      }
    }
  }
}
Program: 183893
Project: 183893
Buggy source:
public void dispatchGetNewSurface(){
  Message msg=mHandler.obtainMessage(GET_NEW_SURFACE_MSG);
  mHandler.sendMessage(msg);
}

Fixed version (ground truth):
public void dispatchGetNewSurface(){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    Message msg=surfaceView.mHandler.obtainMessage(GET_NEW_SURFACE_MSG);
    surfaceView.mHandler.sendMessage(msg);
  }
}
Program: 183894
Project: 183894
Buggy source:
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw){
  if (localLOGV)   Log.v("String_Node_Str",SurfaceView.this + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
synchronized (this) {
    if (mCurWidth != w || mCurHeight != h) {
      mCurWidth=w;
      mCurHeight=h;
    }
    if (reportDraw) {
      try {
        mSession.finishDrawing(mWindow);
      }
 catch (      RemoteException e) {
      }
    }
  }
}

Fixed version (ground truth):
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
synchronized (this) {
      if (mCurWidth != w || mCurHeight != h) {
        mCurWidth=w;
        mCurHeight=h;
      }
      if (reportDraw) {
        try {
          surfaceView.mSession.finishDrawing(surfaceView.mWindow);
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}
Program: 183896
Project: 183896
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void systemReady(){
  try {
    int menuState=mWindowManager.getKeycodeState(KeyEvent.KEYCODE_MENU);
    Log.i(TAG,"String_Node_Str" + menuState);
    if (menuState > 0) {
      ActivityManagerNative.getDefault().enterSafeMode();
    }
 else {
      mKeyguardMediator.onSystemReady();
      android.os.SystemProperties.set("String_Node_Str","String_Node_Str");
    }
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void systemReady(){
  try {
    int menuState=mWindowManager.getKeycodeState(KeyEvent.KEYCODE_MENU);
    Log.i(TAG,"String_Node_Str" + menuState);
    if (menuState > 0) {
      ActivityManagerNative.getDefault().enterSafeMode();
    }
    mKeyguardMediator.onSystemReady();
    android.os.SystemProperties.set("String_Node_Str","String_Node_Str");
  }
 catch (  RemoteException e) {
  }
}
Program: 183897
Project: 183897
Buggy source:
public static final CharSequence getDisplayLabel(Context context,int type,CharSequence label){
  CharSequence display="String_Node_Str";
  if (type != TYPE_CUSTOM) {
    CharSequence[] labels=context.getResources().getTextArray(com.android.internal.R.array.organizationTypes);
    try {
      display=labels[type - 1];
    }
 catch (    ArrayIndexOutOfBoundsException e) {
      display=labels[People.Phones.TYPE_HOME - 1];
    }
  }
 else {
    if (!TextUtils.isEmpty(label)) {
      display=label;
    }
  }
  return display;
}

Fixed version (ground truth):
public static final CharSequence getDisplayLabel(Context context,int type,CharSequence label){
  CharSequence display="String_Node_Str";
  if (type != TYPE_CUSTOM) {
    CharSequence[] labels=context.getResources().getTextArray(com.android.internal.R.array.organizationTypes);
    try {
      display=labels[type - 1];
    }
 catch (    ArrayIndexOutOfBoundsException e) {
      display=labels[Organizations.TYPE_WORK - 1];
    }
  }
 else {
    if (!TextUtils.isEmpty(label)) {
      display=label;
    }
  }
  return display;
}
Program: 183900
Project: 183900
Buggy source:
@Override public void onEntityDeath(EntityDeathEvent e){
  if (e.getEntity() instanceof HumanEntity)   return;
  if (e.getEntity() instanceof LivingEntity) {
    if (e.getDrops().size() > 0) {
      Location loc=e.getEntity().getLocation();
      EntityDeathPoint p=new EntityDeathPoint(loc.getX(),loc.getY(),loc.getZ());
      EntityDeathBox box=new EntityDeathBox(loc.getX(),loc.getY(),loc.getZ(),radius);
      int r=generator.nextInt(maxDeaths) + minDeaths;
      int deathCount=getNearbyDeathCount(p);
      if (deathCount > r) {
        if (this.debug) {
          System.out.println(String.format("String_Node_Str",p.x,p.y,p.z,deathCount,r,e.getEntity().toString(),nearbyDeaths.size()));
        }
        e.getDrops().clear();
        return;
      }
      this.nearbyDeaths.add(box);
    }
  }
}

Fixed version (ground truth):
@Override public void onEntityDeath(EntityDeathEvent e){
  if (e.getEntity() instanceof HumanEntity)   return;
  if (e.getEntity() instanceof LivingEntity) {
    if (e.getDrops().size() > 0) {
      Location loc=e.getEntity().getLocation();
      EntityDeathPoint p=new EntityDeathPoint(loc.getX(),loc.getY(),loc.getZ());
      EntityDeathBox box=new EntityDeathBox(loc.getX(),loc.getY(),loc.getZ(),radius);
      int r=generator.nextInt(maxDeaths) + minDeaths;
      int deathCount=getNearbyDeathCount(p);
      if (deathCount > r) {
        if (this.debug) {
          System.out.println(String.format("String_Node_Str",p.x,p.y,p.z,e.getEntity().toString(),deathCount,r,nearbyDeaths.size()));
        }
        e.getDrops().clear();
        return;
      }
      this.nearbyDeaths.add(box);
    }
  }
}