nus-yam/ex-repair huggingface dataset:
Program: 42167
Project: 42167
Buggy source:
/** 
 * Helper function: Remove focus listeners from the focus stack for a particular client.
 */
private void removeFocusStackEntryForClient(IBinder cb){
  Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
  while (stackIterator.hasNext()) {
    FocusStackEntry fse=(FocusStackEntry)stackIterator.next();
    if (fse.mSourceRef.equals(cb)) {
      Log.i(TAG,"String_Node_Str" + fse.mClientId);
      mFocusStack.remove(fse);
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Remove focus listeners from the focus stack for a particular client.
 */
private void removeFocusStackEntryForClient(IBinder cb){
  boolean isTopOfStackForClientToRemove=!mFocusStack.isEmpty() && mFocusStack.peek().mSourceRef.equals(cb);
  Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
  while (stackIterator.hasNext()) {
    FocusStackEntry fse=(FocusStackEntry)stackIterator.next();
    if (fse.mSourceRef.equals(cb)) {
      Log.i(TAG,"String_Node_Str" + fse.mClientId);
      mFocusStack.remove(fse);
    }
  }
  if (isTopOfStackForClientToRemove) {
    notifyTopOfAudioFocusStack();
  }
}
Program: 42168
Project: 42168
Buggy source:
/** 
 * Helper function: Remove a focus listener from the focus stack.
 * @param focusListenerToRemove the focus listener
 * @param signal if true and the listener was at the top of the focus stack, i.e. it was holdingfocus, notify the next item in the stack it gained focus.
 */
private void removeFocusStackEntry(String clientToRemove,boolean signal){
  if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientToRemove)) {
    mFocusStack.pop();
    if (signal) {
      if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null) && canReassignAudioFocus()) {
        try {
          mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(AudioManager.AUDIOFOCUS_GAIN,mFocusStack.peek().mClientId);
        }
 catch (        RemoteException e) {
          Log.e(TAG,"String_Node_Str" + e);
          e.printStackTrace();
        }
      }
    }
  }
 else {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=(FocusStackEntry)stackIterator.next();
      if (fse.mClientId.equals(clientToRemove)) {
        Log.i(TAG,"String_Node_Str" + fse.mClientId);
        mFocusStack.remove(fse);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Remove a focus listener from the focus stack.
 * @param focusListenerToRemove the focus listener
 * @param signal if true and the listener was at the top of the focus stack, i.e. it was holdingfocus, notify the next item in the stack it gained focus.
 */
private void removeFocusStackEntry(String clientToRemove,boolean signal){
  if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientToRemove)) {
    mFocusStack.pop();
    if (signal) {
      notifyTopOfAudioFocusStack();
    }
  }
 else {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=(FocusStackEntry)stackIterator.next();
      if (fse.mClientId.equals(clientToRemove)) {
        Log.i(TAG,"String_Node_Str" + fse.mClientId);
        mFocusStack.remove(fse);
      }
    }
  }
}
Program: 42169
Project: 42169
Buggy source:
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      mFocusStack.peek().mFocusChangeType=focusChangeHint;
      return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 42170
Project: 42170
Buggy source:
public PointerLocationView(Context c){
  super(c);
  mVC=ViewConfiguration.get(c);
  mTextPaint=new Paint();
  mTextPaint.setAntiAlias(true);
  mTextPaint.setTextSize(10 * getResources().getDisplayMetrics().density);
  mTextPaint.setARGB(255,0,0,0);
  mTextBackgroundPaint=new Paint();
  mTextBackgroundPaint.setAntiAlias(false);
  mTextBackgroundPaint.setARGB(128,255,255,255);
  mTextLevelPaint=new Paint();
  mTextLevelPaint.setAntiAlias(false);
  mTextLevelPaint.setARGB(192,255,0,0);
  mPaint=new Paint();
  mPaint.setAntiAlias(true);
  mPaint.setARGB(255,255,255,255);
  mPaint.setStyle(Paint.Style.STROKE);
  mPaint.setStrokeWidth(2);
  mTargetPaint=new Paint();
  mTargetPaint.setAntiAlias(false);
  mTargetPaint.setARGB(255,0,0,192);
  mPathPaint=new Paint();
  mPathPaint.setAntiAlias(false);
  mPathPaint.setARGB(255,0,96,255);
  mPaint.setStyle(Paint.Style.STROKE);
  mPaint.setStrokeWidth(1);
  PointerState ps=new PointerState();
  ps.mVelocity=VelocityTracker.obtain();
  mPointers.add(ps);
}

Fixed version (ground truth):
public PointerLocationView(Context c){
  super(c);
  setFocusable(true);
  mVC=ViewConfiguration.get(c);
  mTextPaint=new Paint();
  mTextPaint.setAntiAlias(true);
  mTextPaint.setTextSize(10 * getResources().getDisplayMetrics().density);
  mTextPaint.setARGB(255,0,0,0);
  mTextBackgroundPaint=new Paint();
  mTextBackgroundPaint.setAntiAlias(false);
  mTextBackgroundPaint.setARGB(128,255,255,255);
  mTextLevelPaint=new Paint();
  mTextLevelPaint.setAntiAlias(false);
  mTextLevelPaint.setARGB(192,255,0,0);
  mPaint=new Paint();
  mPaint.setAntiAlias(true);
  mPaint.setARGB(255,255,255,255);
  mPaint.setStyle(Paint.Style.STROKE);
  mPaint.setStrokeWidth(2);
  mTargetPaint=new Paint();
  mTargetPaint.setAntiAlias(false);
  mTargetPaint.setARGB(255,0,0,192);
  mPathPaint=new Paint();
  mPathPaint.setAntiAlias(false);
  mPathPaint.setARGB(255,0,96,255);
  mPaint.setStyle(Paint.Style.STROKE);
  mPaint.setStrokeWidth(1);
  PointerState ps=new PointerState();
  ps.mVelocity=VelocityTracker.obtain();
  mPointers.add(ps);
}
Program: 42173
Project: 42173
Buggy source:
/** 
 * Helper function: Remove focus listeners from the focus stack for a particular client.
 */
private void removeFocusStackEntryForClient(IBinder cb){
  Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
  while (stackIterator.hasNext()) {
    FocusStackEntry fse=(FocusStackEntry)stackIterator.next();
    if (fse.mSourceRef.equals(cb)) {
      Log.i(TAG,"String_Node_Str" + fse.mClientId);
      mFocusStack.remove(fse);
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Remove focus listeners from the focus stack for a particular client.
 */
private void removeFocusStackEntryForClient(IBinder cb){
  boolean isTopOfStackForClientToRemove=!mFocusStack.isEmpty() && mFocusStack.peek().mSourceRef.equals(cb);
  Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
  while (stackIterator.hasNext()) {
    FocusStackEntry fse=(FocusStackEntry)stackIterator.next();
    if (fse.mSourceRef.equals(cb)) {
      Log.i(TAG,"String_Node_Str" + fse.mClientId);
      mFocusStack.remove(fse);
    }
  }
  if (isTopOfStackForClientToRemove) {
    notifyTopOfAudioFocusStack();
  }
}
Program: 42174
Project: 42174
Buggy source:
/** 
 * Helper function: Remove a focus listener from the focus stack.
 * @param focusListenerToRemove the focus listener
 * @param signal if true and the listener was at the top of the focus stack, i.e. it was holdingfocus, notify the next item in the stack it gained focus.
 */
private void removeFocusStackEntry(String clientToRemove,boolean signal){
  if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientToRemove)) {
    mFocusStack.pop();
    if (signal) {
      if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null) && canReassignAudioFocus()) {
        try {
          mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(AudioManager.AUDIOFOCUS_GAIN,mFocusStack.peek().mClientId);
        }
 catch (        RemoteException e) {
          Log.e(TAG,"String_Node_Str" + e);
          e.printStackTrace();
        }
      }
    }
  }
 else {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=(FocusStackEntry)stackIterator.next();
      if (fse.mClientId.equals(clientToRemove)) {
        Log.i(TAG,"String_Node_Str" + fse.mClientId);
        mFocusStack.remove(fse);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Remove a focus listener from the focus stack.
 * @param focusListenerToRemove the focus listener
 * @param signal if true and the listener was at the top of the focus stack, i.e. it was holdingfocus, notify the next item in the stack it gained focus.
 */
private void removeFocusStackEntry(String clientToRemove,boolean signal){
  if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientToRemove)) {
    mFocusStack.pop();
    if (signal) {
      notifyTopOfAudioFocusStack();
    }
  }
 else {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=(FocusStackEntry)stackIterator.next();
      if (fse.mClientId.equals(clientToRemove)) {
        Log.i(TAG,"String_Node_Str" + fse.mClientId);
        mFocusStack.remove(fse);
      }
    }
  }
}
Program: 42175
Project: 42175
Buggy source:
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      mFocusStack.peek().mFocusChangeType=focusChangeHint;
      return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 42182
Project: 42182
Buggy source:
@Override protected void onRestoreInstanceState(Bundle state){
  super.onRestoreInstanceState(state);
  Bundle container=state.getBundle(PREFERENCES_TAG);
  if (container != null) {
    final PreferenceScreen preferenceScreen=getPreferenceScreen();
    if (preferenceScreen != null) {
      preferenceScreen.restoreHierarchyState(container);
    }
  }
}

Fixed version (ground truth):
@Override protected void onRestoreInstanceState(Bundle state){
  Bundle container=state.getBundle(PREFERENCES_TAG);
  if (container != null) {
    final PreferenceScreen preferenceScreen=getPreferenceScreen();
    if (preferenceScreen != null) {
      preferenceScreen.restoreHierarchyState(container);
      mSavedInstanceState=state;
      return;
    }
  }
  super.onRestoreInstanceState(state);
}
Program: 42183
Project: 42183
Buggy source:
private void bindPreferences(){
  final PreferenceScreen preferenceScreen=getPreferenceScreen();
  if (preferenceScreen != null) {
    preferenceScreen.bind(getListView());
  }
}

Fixed version (ground truth):
private void bindPreferences(){
  final PreferenceScreen preferenceScreen=getPreferenceScreen();
  if (preferenceScreen != null) {
    preferenceScreen.bind(getListView());
    if (mSavedInstanceState != null) {
      super.onRestoreInstanceState(mSavedInstanceState);
      mSavedInstanceState=null;
    }
  }
}
Program: 42184
Project: 42184
Buggy source:
/** 
 * Updates the engine configuration.
 */
public int setConfig(String engineConfig){
  return native_setConfig(engineConfig);
}

Fixed version (ground truth):
/** 
 * Updates the engine configuration.
 */
public int setConfig(String engineConfig){
  return native_setConfig(mJniData,engineConfig);
}
Program: 42185
Project: 42185
Buggy source:
private native final int native_setConfig(String engineConfig);

Fixed version (ground truth):
private native final int native_setConfig(int jniData,String engineConfig);
Program: 42186
Project: 42186
Buggy source:
@Override protected void onRestoreInstanceState(Bundle state){
  super.onRestoreInstanceState(state);
  Bundle container=state.getBundle(PREFERENCES_TAG);
  if (container != null) {
    final PreferenceScreen preferenceScreen=getPreferenceScreen();
    if (preferenceScreen != null) {
      preferenceScreen.restoreHierarchyState(container);
    }
  }
}

Fixed version (ground truth):
@Override protected void onRestoreInstanceState(Bundle state){
  Bundle container=state.getBundle(PREFERENCES_TAG);
  if (container != null) {
    final PreferenceScreen preferenceScreen=getPreferenceScreen();
    if (preferenceScreen != null) {
      preferenceScreen.restoreHierarchyState(container);
      mSavedInstanceState=state;
      return;
    }
  }
  super.onRestoreInstanceState(state);
}
Program: 42187
Project: 42187
Buggy source:
private void bindPreferences(){
  final PreferenceScreen preferenceScreen=getPreferenceScreen();
  if (preferenceScreen != null) {
    preferenceScreen.bind(getListView());
  }
}

Fixed version (ground truth):
private void bindPreferences(){
  final PreferenceScreen preferenceScreen=getPreferenceScreen();
  if (preferenceScreen != null) {
    preferenceScreen.bind(getListView());
    if (mSavedInstanceState != null) {
      super.onRestoreInstanceState(mSavedInstanceState);
      mSavedInstanceState=null;
    }
  }
}
Program: 42188
Project: 42188
Buggy source:
/** 
 * Updates the engine configuration.
 */
public int setConfig(String engineConfig){
  return native_setConfig(engineConfig);
}

Fixed version (ground truth):
/** 
 * Updates the engine configuration.
 */
public int setConfig(String engineConfig){
  return native_setConfig(mJniData,engineConfig);
}
Program: 42189
Project: 42189
Buggy source:
private native final int native_setConfig(String engineConfig);

Fixed version (ground truth):
private native final int native_setConfig(int jniData,String engineConfig);
Program: 42190
Project: 42190
Buggy source:
private final void attach(boolean system){
  sThreadLocal.set(this);
  mSystemThread=system;
  if (!system) {
    ViewRoot.addFirstDrawHandler(new Runnable(){
      public void run(){
        ensureJitEnabled();
      }
    }
);
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    RuntimeInit.setApplicationObject(mAppThread.asBinder());
    IActivityManager mgr=ActivityManagerNative.getDefault();
    try {
      mgr.attachApplication(mAppThread);
    }
 catch (    RemoteException ex) {
    }
  }
 else {
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    try {
      mInstrumentation=new Instrumentation();
      ContextImpl context=new ContextImpl();
      context.init(getSystemContext().mPackageInfo,null,this);
      Application app=Instrumentation.newApplication(Application.class,context);
      mAllApplications.add(app);
      mInitialApplication=app;
      app.onCreate();
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + e.toString(),e);
    }
  }
  ViewRoot.addConfigCallback(new ComponentCallbacks(){
    public void onConfigurationChanged(    Configuration newConfig){
synchronized (mPackages) {
        if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
          mPendingConfiguration=newConfig;
          applyConfigurationToResourcesLocked(newConfig);
        }
      }
      queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
    }
    public void onLowMemory(){
    }
  }
);
}

Fixed version (ground truth):
private final void attach(boolean system){
  sThreadLocal.set(this);
  mSystemThread=system;
  if (!system) {
    ViewRoot.addFirstDrawHandler(new Runnable(){
      public void run(){
        ensureJitEnabled();
      }
    }
);
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    RuntimeInit.setApplicationObject(mAppThread.asBinder());
    IActivityManager mgr=ActivityManagerNative.getDefault();
    try {
      mgr.attachApplication(mAppThread);
    }
 catch (    RemoteException ex) {
    }
  }
 else {
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    try {
      mInstrumentation=new Instrumentation();
      ContextImpl context=new ContextImpl();
      context.init(getSystemContext().mPackageInfo,null,this);
      Application app=Instrumentation.newApplication(Application.class,context);
      mAllApplications.add(app);
      mInitialApplication=app;
      app.onCreate();
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + e.toString(),e);
    }
  }
  ViewRoot.addConfigCallback(new ComponentCallbacks(){
    public void onConfigurationChanged(    Configuration newConfig){
synchronized (mPackages) {
        if (applyConfigurationToResourcesLocked(newConfig)) {
          if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
            mPendingConfiguration=newConfig;
            queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
          }
        }
      }
    }
    public void onLowMemory(){
    }
  }
);
}
Program: 42191
Project: 42191
Buggy source:
public void onConfigurationChanged(Configuration newConfig){
synchronized (mPackages) {
    if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
      mPendingConfiguration=newConfig;
      applyConfigurationToResourcesLocked(newConfig);
    }
  }
  queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
}

Fixed version (ground truth):
public void onConfigurationChanged(Configuration newConfig){
synchronized (mPackages) {
    if (applyConfigurationToResourcesLocked(newConfig)) {
      if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
        mPendingConfiguration=newConfig;
        queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
      }
    }
  }
}
Program: 42192
Project: 42192
Buggy source:
final void applyConfigurationToResourcesLocked(Configuration config){
  if (mResConfiguration == null) {
    mResConfiguration=new Configuration();
  }
  if (!mResConfiguration.isOtherSeqNewer(config)) {
    if (DEBUG_CONFIGURATION)     Log.v(TAG,"String_Node_Str" + mResConfiguration.seq + "String_Node_Str"+ config.seq);
    return;
  }
  mResConfiguration.updateFrom(config);
  DisplayMetrics dm=getDisplayMetricsLocked(true);
  if (config.locale != null) {
    Locale.setDefault(config.locale);
  }
  Resources.updateSystemConfiguration(config,dm);
  ContextImpl.ApplicationPackageManager.configurationChanged();
  Iterator<WeakReference<Resources>> it=mActiveResources.values().iterator();
  while (it.hasNext()) {
    WeakReference<Resources> v=it.next();
    Resources r=v.get();
    if (r != null) {
      if (DEBUG_CONFIGURATION)       Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ config);
      r.updateConfiguration(config,dm);
    }
 else {
      it.remove();
    }
  }
}

Fixed version (ground truth):
final boolean applyConfigurationToResourcesLocked(Configuration config){
  if (mResConfiguration == null) {
    mResConfiguration=new Configuration();
  }
  if (!mResConfiguration.isOtherSeqNewer(config)) {
    if (DEBUG_CONFIGURATION)     Log.v(TAG,"String_Node_Str" + mResConfiguration.seq + "String_Node_Str"+ config.seq);
    return false;
  }
  int changes=mResConfiguration.updateFrom(config);
  DisplayMetrics dm=getDisplayMetricsLocked(true);
  if (config.locale != null) {
    Locale.setDefault(config.locale);
  }
  Resources.updateSystemConfiguration(config,dm);
  ContextImpl.ApplicationPackageManager.configurationChanged();
  Iterator<WeakReference<Resources>> it=mActiveResources.values().iterator();
  while (it.hasNext()) {
    WeakReference<Resources> v=it.next();
    Resources r=v.get();
    if (r != null) {
      if (DEBUG_CONFIGURATION)       Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ config);
      r.updateConfiguration(config,dm);
    }
 else {
      it.remove();
    }
  }
  return changes != 0;
}
Program: 42193
Project: 42193
Buggy source:
private final void attach(boolean system){
  sThreadLocal.set(this);
  mSystemThread=system;
  if (!system) {
    ViewRoot.addFirstDrawHandler(new Runnable(){
      public void run(){
        ensureJitEnabled();
      }
    }
);
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    RuntimeInit.setApplicationObject(mAppThread.asBinder());
    IActivityManager mgr=ActivityManagerNative.getDefault();
    try {
      mgr.attachApplication(mAppThread);
    }
 catch (    RemoteException ex) {
    }
  }
 else {
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    try {
      mInstrumentation=new Instrumentation();
      ContextImpl context=new ContextImpl();
      context.init(getSystemContext().mPackageInfo,null,this);
      Application app=Instrumentation.newApplication(Application.class,context);
      mAllApplications.add(app);
      mInitialApplication=app;
      app.onCreate();
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + e.toString(),e);
    }
  }
  ViewRoot.addConfigCallback(new ComponentCallbacks(){
    public void onConfigurationChanged(    Configuration newConfig){
synchronized (mPackages) {
        if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
          mPendingConfiguration=newConfig;
          applyConfigurationToResourcesLocked(newConfig);
        }
      }
      queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
    }
    public void onLowMemory(){
    }
  }
);
}

Fixed version (ground truth):
private final void attach(boolean system){
  sThreadLocal.set(this);
  mSystemThread=system;
  if (!system) {
    ViewRoot.addFirstDrawHandler(new Runnable(){
      public void run(){
        ensureJitEnabled();
      }
    }
);
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    RuntimeInit.setApplicationObject(mAppThread.asBinder());
    IActivityManager mgr=ActivityManagerNative.getDefault();
    try {
      mgr.attachApplication(mAppThread);
    }
 catch (    RemoteException ex) {
    }
  }
 else {
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    try {
      mInstrumentation=new Instrumentation();
      ContextImpl context=new ContextImpl();
      context.init(getSystemContext().mPackageInfo,null,this);
      Application app=Instrumentation.newApplication(Application.class,context);
      mAllApplications.add(app);
      mInitialApplication=app;
      app.onCreate();
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + e.toString(),e);
    }
  }
  ViewRoot.addConfigCallback(new ComponentCallbacks(){
    public void onConfigurationChanged(    Configuration newConfig){
synchronized (mPackages) {
        if (applyConfigurationToResourcesLocked(newConfig)) {
          if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
            mPendingConfiguration=newConfig;
            queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
          }
        }
      }
    }
    public void onLowMemory(){
    }
  }
);
}
Program: 42194
Project: 42194
Buggy source:
public void onConfigurationChanged(Configuration newConfig){
synchronized (mPackages) {
    if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
      mPendingConfiguration=newConfig;
      applyConfigurationToResourcesLocked(newConfig);
    }
  }
  queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
}

Fixed version (ground truth):
public void onConfigurationChanged(Configuration newConfig){
synchronized (mPackages) {
    if (applyConfigurationToResourcesLocked(newConfig)) {
      if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
        mPendingConfiguration=newConfig;
        queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
      }
    }
  }
}
Program: 42195
Project: 42195
Buggy source:
final void applyConfigurationToResourcesLocked(Configuration config){
  if (mResConfiguration == null) {
    mResConfiguration=new Configuration();
  }
  if (!mResConfiguration.isOtherSeqNewer(config)) {
    if (DEBUG_CONFIGURATION)     Log.v(TAG,"String_Node_Str" + mResConfiguration.seq + "String_Node_Str"+ config.seq);
    return;
  }
  mResConfiguration.updateFrom(config);
  DisplayMetrics dm=getDisplayMetricsLocked(true);
  if (config.locale != null) {
    Locale.setDefault(config.locale);
  }
  Resources.updateSystemConfiguration(config,dm);
  ContextImpl.ApplicationPackageManager.configurationChanged();
  Iterator<WeakReference<Resources>> it=mActiveResources.values().iterator();
  while (it.hasNext()) {
    WeakReference<Resources> v=it.next();
    Resources r=v.get();
    if (r != null) {
      if (DEBUG_CONFIGURATION)       Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ config);
      r.updateConfiguration(config,dm);
    }
 else {
      it.remove();
    }
  }
}

Fixed version (ground truth):
final boolean applyConfigurationToResourcesLocked(Configuration config){
  if (mResConfiguration == null) {
    mResConfiguration=new Configuration();
  }
  if (!mResConfiguration.isOtherSeqNewer(config)) {
    if (DEBUG_CONFIGURATION)     Log.v(TAG,"String_Node_Str" + mResConfiguration.seq + "String_Node_Str"+ config.seq);
    return false;
  }
  int changes=mResConfiguration.updateFrom(config);
  DisplayMetrics dm=getDisplayMetricsLocked(true);
  if (config.locale != null) {
    Locale.setDefault(config.locale);
  }
  Resources.updateSystemConfiguration(config,dm);
  ContextImpl.ApplicationPackageManager.configurationChanged();
  Iterator<WeakReference<Resources>> it=mActiveResources.values().iterator();
  while (it.hasNext()) {
    WeakReference<Resources> v=it.next();
    Resources r=v.get();
    if (r != null) {
      if (DEBUG_CONFIGURATION)       Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ config);
      r.updateConfiguration(config,dm);
    }
 else {
      it.remove();
    }
  }
  return changes != 0;
}
Program: 42196
Project: 42196
Buggy source:
/** 
 * Re-enable mobile data connectivity after a   {@link #teardown()}.
 */
public boolean reconnect(){
  setTeardownRequested(false);
switch (setEnableApn(mApnType,true)) {
case Phone.APN_ALREADY_ACTIVE:
    mEnabled=true;
  mMobileDataState=Phone.DataState.CONNECTING;
setDetailedState(DetailedState.CONNECTING,Phone.REASON_APN_CHANGED,null);
Intent intent=new Intent(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
intent.putExtra(Phone.STATE_KEY,Phone.DataState.CONNECTED.toString());
intent.putExtra(Phone.STATE_CHANGE_REASON_KEY,Phone.REASON_APN_CHANGED);
intent.putExtra(Phone.DATA_APN_TYPES_KEY,mApnTypeToWatchFor);
intent.putExtra(Phone.DATA_APN_KEY,mApnName);
intent.putExtra(Phone.DATA_IFACE_NAME_KEY,mInterfaceName);
intent.putExtra(Phone.NETWORK_UNAVAILABLE_KEY,false);
if (mStateReceiver != null) mStateReceiver.onReceive(mContext,intent);
break;
case Phone.APN_REQUEST_STARTED:
mEnabled=true;
break;
case Phone.APN_REQUEST_FAILED:
if (mPhoneService == null && mApnType == Phone.APN_TYPE_DEFAULT) {
mEnabled=true;
return false;
}
case Phone.APN_TYPE_NOT_AVAILABLE:
mEnabled=false;
break;
default :
Log.e(TAG,"String_Node_Str");
mEnabled=false;
break;
}
return mEnabled;
}

Fixed version (ground truth):
/** 
 * Re-enable mobile data connectivity after a   {@link #teardown()}.
 */
public boolean reconnect(){
  setTeardownRequested(false);
switch (setEnableApn(mApnType,true)) {
case Phone.APN_ALREADY_ACTIVE:
    mEnabled=true;
  mMobileDataState=Phone.DataState.CONNECTING;
setDetailedState(DetailedState.CONNECTING,Phone.REASON_APN_CHANGED,null);
Intent intent=new Intent(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
intent.putExtra(Phone.STATE_KEY,Phone.DataState.CONNECTED.toString());
intent.putExtra(Phone.STATE_CHANGE_REASON_KEY,Phone.REASON_APN_CHANGED);
intent.putExtra(Phone.DATA_APN_TYPES_KEY,mApnTypeToWatchFor);
intent.putExtra(Phone.DATA_APN_KEY,mApnName);
intent.putExtra(Phone.DATA_IFACE_NAME_KEY,mInterfaceName);
intent.putExtra(Phone.NETWORK_UNAVAILABLE_KEY,false);
if (mStateReceiver != null) mStateReceiver.onReceive(mContext,intent);
break;
case Phone.APN_REQUEST_STARTED:
mEnabled=true;
break;
case Phone.APN_REQUEST_FAILED:
if (mPhoneService == null && mApnType == Phone.APN_TYPE_DEFAULT) {
mEnabled=true;
return false;
}
case Phone.APN_TYPE_NOT_AVAILABLE:
if (mApnType != Phone.APN_TYPE_DEFAULT) {
mEnabled=false;
}
break;
default :
Log.e(TAG,"String_Node_Str");
mEnabled=false;
break;
}
return mEnabled;
}
Program: 42197
Project: 42197
Buggy source:
private final void attach(boolean system){
  sThreadLocal.set(this);
  mSystemThread=system;
  if (!system) {
    ViewRoot.addFirstDrawHandler(new Runnable(){
      public void run(){
        ensureJitEnabled();
      }
    }
);
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    RuntimeInit.setApplicationObject(mAppThread.asBinder());
    IActivityManager mgr=ActivityManagerNative.getDefault();
    try {
      mgr.attachApplication(mAppThread);
    }
 catch (    RemoteException ex) {
    }
  }
 else {
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    try {
      mInstrumentation=new Instrumentation();
      ContextImpl context=new ContextImpl();
      context.init(getSystemContext().mPackageInfo,null,this);
      Application app=Instrumentation.newApplication(Application.class,context);
      mAllApplications.add(app);
      mInitialApplication=app;
      app.onCreate();
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + e.toString(),e);
    }
  }
  ViewRoot.addConfigCallback(new ComponentCallbacks(){
    public void onConfigurationChanged(    Configuration newConfig){
synchronized (mPackages) {
        if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
          mPendingConfiguration=newConfig;
          applyConfigurationToResourcesLocked(newConfig);
        }
      }
      queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
    }
    public void onLowMemory(){
    }
  }
);
}

Fixed version (ground truth):
private final void attach(boolean system){
  sThreadLocal.set(this);
  mSystemThread=system;
  if (!system) {
    ViewRoot.addFirstDrawHandler(new Runnable(){
      public void run(){
        ensureJitEnabled();
      }
    }
);
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    RuntimeInit.setApplicationObject(mAppThread.asBinder());
    IActivityManager mgr=ActivityManagerNative.getDefault();
    try {
      mgr.attachApplication(mAppThread);
    }
 catch (    RemoteException ex) {
    }
  }
 else {
    android.ddm.DdmHandleAppName.setAppName("String_Node_Str");
    try {
      mInstrumentation=new Instrumentation();
      ContextImpl context=new ContextImpl();
      context.init(getSystemContext().mPackageInfo,null,this);
      Application app=Instrumentation.newApplication(Application.class,context);
      mAllApplications.add(app);
      mInitialApplication=app;
      app.onCreate();
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + e.toString(),e);
    }
  }
  ViewRoot.addConfigCallback(new ComponentCallbacks(){
    public void onConfigurationChanged(    Configuration newConfig){
synchronized (mPackages) {
        if (applyConfigurationToResourcesLocked(newConfig)) {
          if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
            mPendingConfiguration=newConfig;
            queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
          }
        }
      }
    }
    public void onLowMemory(){
    }
  }
);
}
Program: 42198
Project: 42198
Buggy source:
public void onConfigurationChanged(Configuration newConfig){
synchronized (mPackages) {
    if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
      mPendingConfiguration=newConfig;
      applyConfigurationToResourcesLocked(newConfig);
    }
  }
  queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
}

Fixed version (ground truth):
public void onConfigurationChanged(Configuration newConfig){
synchronized (mPackages) {
    if (applyConfigurationToResourcesLocked(newConfig)) {
      if (mPendingConfiguration == null || mPendingConfiguration.isOtherSeqNewer(newConfig)) {
        mPendingConfiguration=newConfig;
        queueOrSendMessage(H.CONFIGURATION_CHANGED,newConfig);
      }
    }
  }
}
Program: 42199
Project: 42199
Buggy source:
final void applyConfigurationToResourcesLocked(Configuration config){
  if (mResConfiguration == null) {
    mResConfiguration=new Configuration();
  }
  if (!mResConfiguration.isOtherSeqNewer(config)) {
    if (DEBUG_CONFIGURATION)     Log.v(TAG,"String_Node_Str" + mResConfiguration.seq + "String_Node_Str"+ config.seq);
    return;
  }
  mResConfiguration.updateFrom(config);
  DisplayMetrics dm=getDisplayMetricsLocked(true);
  if (config.locale != null) {
    Locale.setDefault(config.locale);
  }
  Resources.updateSystemConfiguration(config,dm);
  ContextImpl.ApplicationPackageManager.configurationChanged();
  Iterator<WeakReference<Resources>> it=mActiveResources.values().iterator();
  while (it.hasNext()) {
    WeakReference<Resources> v=it.next();
    Resources r=v.get();
    if (r != null) {
      if (DEBUG_CONFIGURATION)       Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ config);
      r.updateConfiguration(config,dm);
    }
 else {
      it.remove();
    }
  }
}

Fixed version (ground truth):
final boolean applyConfigurationToResourcesLocked(Configuration config){
  if (mResConfiguration == null) {
    mResConfiguration=new Configuration();
  }
  if (!mResConfiguration.isOtherSeqNewer(config)) {
    if (DEBUG_CONFIGURATION)     Log.v(TAG,"String_Node_Str" + mResConfiguration.seq + "String_Node_Str"+ config.seq);
    return false;
  }
  int changes=mResConfiguration.updateFrom(config);
  DisplayMetrics dm=getDisplayMetricsLocked(true);
  if (config.locale != null) {
    Locale.setDefault(config.locale);
  }
  Resources.updateSystemConfiguration(config,dm);
  ContextImpl.ApplicationPackageManager.configurationChanged();
  Iterator<WeakReference<Resources>> it=mActiveResources.values().iterator();
  while (it.hasNext()) {
    WeakReference<Resources> v=it.next();
    Resources r=v.get();
    if (r != null) {
      if (DEBUG_CONFIGURATION)       Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ config);
      r.updateConfiguration(config,dm);
    }
 else {
      it.remove();
    }
  }
  return changes != 0;
}
Program: 42200
Project: 42200
Buggy source:
/** 
 * Re-enable mobile data connectivity after a   {@link #teardown()}.
 */
public boolean reconnect(){
  setTeardownRequested(false);
switch (setEnableApn(mApnType,true)) {
case Phone.APN_ALREADY_ACTIVE:
    mEnabled=true;
  mMobileDataState=Phone.DataState.CONNECTING;
setDetailedState(DetailedState.CONNECTING,Phone.REASON_APN_CHANGED,null);
Intent intent=new Intent(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
intent.putExtra(Phone.STATE_KEY,Phone.DataState.CONNECTED.toString());
intent.putExtra(Phone.STATE_CHANGE_REASON_KEY,Phone.REASON_APN_CHANGED);
intent.putExtra(Phone.DATA_APN_TYPES_KEY,mApnTypeToWatchFor);
intent.putExtra(Phone.DATA_APN_KEY,mApnName);
intent.putExtra(Phone.DATA_IFACE_NAME_KEY,mInterfaceName);
intent.putExtra(Phone.NETWORK_UNAVAILABLE_KEY,false);
if (mStateReceiver != null) mStateReceiver.onReceive(mContext,intent);
break;
case Phone.APN_REQUEST_STARTED:
mEnabled=true;
break;
case Phone.APN_REQUEST_FAILED:
if (mPhoneService == null && mApnType == Phone.APN_TYPE_DEFAULT) {
mEnabled=true;
return false;
}
case Phone.APN_TYPE_NOT_AVAILABLE:
mEnabled=false;
break;
default :
Log.e(TAG,"String_Node_Str");
mEnabled=false;
break;
}
return mEnabled;
}

Fixed version (ground truth):
/** 
 * Re-enable mobile data connectivity after a   {@link #teardown()}.
 */
public boolean reconnect(){
  setTeardownRequested(false);
switch (setEnableApn(mApnType,true)) {
case Phone.APN_ALREADY_ACTIVE:
    mEnabled=true;
  mMobileDataState=Phone.DataState.CONNECTING;
setDetailedState(DetailedState.CONNECTING,Phone.REASON_APN_CHANGED,null);
Intent intent=new Intent(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
intent.putExtra(Phone.STATE_KEY,Phone.DataState.CONNECTED.toString());
intent.putExtra(Phone.STATE_CHANGE_REASON_KEY,Phone.REASON_APN_CHANGED);
intent.putExtra(Phone.DATA_APN_TYPES_KEY,mApnTypeToWatchFor);
intent.putExtra(Phone.DATA_APN_KEY,mApnName);
intent.putExtra(Phone.DATA_IFACE_NAME_KEY,mInterfaceName);
intent.putExtra(Phone.NETWORK_UNAVAILABLE_KEY,false);
if (mStateReceiver != null) mStateReceiver.onReceive(mContext,intent);
break;
case Phone.APN_REQUEST_STARTED:
mEnabled=true;
break;
case Phone.APN_REQUEST_FAILED:
if (mPhoneService == null && mApnType == Phone.APN_TYPE_DEFAULT) {
mEnabled=true;
return false;
}
case Phone.APN_TYPE_NOT_AVAILABLE:
if (mApnType != Phone.APN_TYPE_DEFAULT) {
mEnabled=false;
}
break;
default :
Log.e(TAG,"String_Node_Str");
mEnabled=false;
break;
}
return mEnabled;
}
Program: 42201
Project: 42201
Buggy source:
private void recreateLockScreen(){
  if (mLockScreen.getVisibility() == View.VISIBLE) {
    ((KeyguardScreen)mLockScreen).onPause();
  }
  ((KeyguardScreen)mLockScreen).cleanUp();
  removeViewInLayout(mLockScreen);
  mLockScreen=createLockScreen();
  mLockScreen.setVisibility(View.INVISIBLE);
  addView(mLockScreen);
}

Fixed version (ground truth):
private void recreateLockScreen(){
  if (mLockScreen.getVisibility() == View.VISIBLE) {
    ((KeyguardScreen)mLockScreen).onPause();
  }
  ((KeyguardScreen)mLockScreen).cleanUp();
  removeView(mLockScreen);
  mLockScreen=createLockScreen();
  mLockScreen.setVisibility(View.INVISIBLE);
  addView(mLockScreen);
}
Program: 42202
Project: 42202
Buggy source:
private void updateScreen(final Mode mode){
  mMode=mode;
  if (mode == Mode.UnlockScreen && mCurrentUnlockMode != getUnlockMode()) {
    recreateUnlockScreen();
  }
  final View goneScreen=(mode == Mode.LockScreen) ? mUnlockScreen : mLockScreen;
  final View visibleScreen=(mode == Mode.LockScreen) ? mLockScreen : mUnlockScreen;
  mWindowController.setNeedsInput(((KeyguardScreen)visibleScreen).needsInput());
  if (mScreenOn) {
    if (goneScreen.getVisibility() == View.VISIBLE) {
      ((KeyguardScreen)goneScreen).onPause();
    }
    if (visibleScreen.getVisibility() != View.VISIBLE) {
      ((KeyguardScreen)visibleScreen).onResume();
    }
  }
  goneScreen.setVisibility(View.GONE);
  visibleScreen.setVisibility(View.VISIBLE);
  if (!visibleScreen.requestFocus()) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + visibleScreen.getClass().getCanonicalName());
  }
}

Fixed version (ground truth):
private void updateScreen(final Mode mode){
  if (DEBUG_CONFIGURATION)   Log.v(TAG,"String_Node_Str" + mode + "String_Node_Str"+ mMode,new RuntimeException());
  mMode=mode;
  if (mode == Mode.UnlockScreen && mCurrentUnlockMode != getUnlockMode()) {
    recreateUnlockScreen();
  }
  final View goneScreen=(mode == Mode.LockScreen) ? mUnlockScreen : mLockScreen;
  final View visibleScreen=(mode == Mode.LockScreen) ? mLockScreen : mUnlockScreen;
  mWindowController.setNeedsInput(((KeyguardScreen)visibleScreen).needsInput());
  if (DEBUG_CONFIGURATION) {
    Log.v(TAG,"String_Node_Str" + goneScreen);
    Log.v(TAG,"String_Node_Str" + visibleScreen);
  }
  if (mScreenOn) {
    if (goneScreen.getVisibility() == View.VISIBLE) {
      ((KeyguardScreen)goneScreen).onPause();
    }
    if (visibleScreen.getVisibility() != View.VISIBLE) {
      ((KeyguardScreen)visibleScreen).onResume();
    }
  }
  goneScreen.setVisibility(View.GONE);
  visibleScreen.setVisibility(View.VISIBLE);
  requestLayout();
  if (!visibleScreen.requestFocus()) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + visibleScreen.getClass().getCanonicalName());
  }
}
Program: 42203
Project: 42203
Buggy source:
private void recreateUnlockScreen(){
  if (mUnlockScreen.getVisibility() == View.VISIBLE) {
    ((KeyguardScreen)mUnlockScreen).onPause();
  }
  ((KeyguardScreen)mUnlockScreen).cleanUp();
  removeViewInLayout(mUnlockScreen);
  final UnlockMode unlockMode=getUnlockMode();
  mUnlockScreen=createUnlockScreenFor(unlockMode);
  mUnlockScreen.setVisibility(View.INVISIBLE);
  mUnlockScreenMode=unlockMode;
  addView(mUnlockScreen);
}

Fixed version (ground truth):
private void recreateUnlockScreen(){
  if (mUnlockScreen.getVisibility() == View.VISIBLE) {
    ((KeyguardScreen)mUnlockScreen).onPause();
  }
  ((KeyguardScreen)mUnlockScreen).cleanUp();
  removeView(mUnlockScreen);
  final UnlockMode unlockMode=getUnlockMode();
  mUnlockScreen=createUnlockScreenFor(unlockMode);
  mUnlockScreen.setVisibility(View.INVISIBLE);
  mUnlockScreenMode=unlockMode;
  addView(mUnlockScreen);
}
Program: 42205
Project: 42205
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  if (DBG) {
    Log.v(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    if (getResources().getConfiguration().orientation != newConfig.orientation) {
      Log.e(TAG,"String_Node_Str",new Exception("String_Node_Str"));
    }
  }
  if (newConfig.orientation != mCreationOrientation) {
    mCallback.recreateMe(newConfig);
  }
 else   if (newConfig.hardKeyboardHidden != mKeyboardHidden) {
    mKeyboardHidden=newConfig.hardKeyboardHidden;
    final boolean isKeyboardOpen=mKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO;
    if (mUpdateMonitor.isKeyguardBypassEnabled() && isKeyboardOpen) {
      mCallback.goToUnlockScreen();
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  if (LockPatternKeyguardView.DEBUG_CONFIGURATION) {
    Log.w(TAG,"String_Node_Str",new RuntimeException());
    Log.v(TAG,"String_Node_Str" + mCreationOrientation + "String_Node_Str"+ newConfig);
  }
  updateConfiguration();
}
Program: 42206
Project: 42206
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  if (newConfig.orientation != mCreationOrientation) {
    mCallback.recreateMe(newConfig);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  if (LockPatternKeyguardView.DEBUG_CONFIGURATION) {
    Log.v(TAG,"String_Node_Str");
    Log.v(TAG,"String_Node_Str" + mCreationOrientation + "String_Node_Str"+ getResources().getConfiguration());
  }
  if (newConfig.orientation != mCreationOrientation) {
    mCallback.recreateMe(newConfig);
  }
}
Program: 42207
Project: 42207
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  if (newConfig.orientation != mCreationOrientation) {
    mCallback.recreateMe(newConfig);
  }
 else   if (newConfig.hardKeyboardHidden != mKeyboardHidden) {
    mKeyboardHidden=newConfig.hardKeyboardHidden;
    final boolean isKeyboardOpen=mKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO;
    if (mUpdateMonitor.isKeyguardBypassEnabled() && isKeyboardOpen) {
      mCallback.goToUnlockScreen();
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  updateConfiguration();
}