nus-yam/ex-repair huggingface dataset:
Program: 182210
Project: 182210
Buggy source:
private boolean writeFileLocked(){
  if (mFile.exists()) {
    if (!mFile.renameTo(mBackupFile)) {
      Log.e(TAG,"String_Node_Str" + mFile + "String_Node_Str"+ mBackupFile);
      return false;
    }
  }
  try {
    FileOutputStream str=createFileOutputStream(mFile);
    if (str == null) {
      return false;
    }
    XmlUtils.writeMapXml(mMap,str);
    str.close();
    setFilePermissionsFromMode(mFile.getPath(),mMode,0);
    if (FileUtils.getFileStatus(mFile.getPath(),mFileStatus)) {
      mTimestamp=mFileStatus.mtime;
    }
    mBackupFile.delete();
    return true;
  }
 catch (  XmlPullParserException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
catch (  IOException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  if (mFile.exists()) {
    if (!mFile.delete()) {
      Log.e(TAG,"String_Node_Str" + mFile);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean writeFileLocked(){
  if (mFile.exists()) {
    if (!mBackupFile.exists()) {
      if (!mFile.renameTo(mBackupFile)) {
        Log.e(TAG,"String_Node_Str" + mFile + "String_Node_Str"+ mBackupFile);
        return false;
      }
    }
 else {
      mFile.delete();
    }
  }
  try {
    FileOutputStream str=createFileOutputStream(mFile);
    if (str == null) {
      return false;
    }
    XmlUtils.writeMapXml(mMap,str);
    str.close();
    setFilePermissionsFromMode(mFile.getPath(),mMode,0);
    if (FileUtils.getFileStatus(mFile.getPath(),mFileStatus)) {
      mTimestamp=mFileStatus.mtime;
    }
    mBackupFile.delete();
    return true;
  }
 catch (  XmlPullParserException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
catch (  IOException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  if (mFile.exists()) {
    if (!mFile.delete()) {
      Log.e(TAG,"String_Node_Str" + mFile);
    }
  }
  return false;
}
Program: 182211
Project: 182211
Buggy source:
/** 
 * Copy data from a source stream to destFile. Return true if succeed, return false if failed.
 */
public static boolean copyToFile(InputStream inputStream,File destFile){
  try {
    OutputStream out=new FileOutputStream(destFile);
    try {
      byte[] buffer=new byte[4096];
      int bytesRead;
      while ((bytesRead=inputStream.read(buffer)) >= 0) {
        out.write(buffer,0,bytesRead);
      }
    }
  finally {
      out.close();
    }
    return true;
  }
 catch (  IOException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Copy data from a source stream to destFile. Return true if succeed, return false if failed.
 */
public static boolean copyToFile(InputStream inputStream,File destFile){
  try {
    if (destFile.exists()) {
      destFile.delete();
    }
    OutputStream out=new FileOutputStream(destFile);
    try {
      byte[] buffer=new byte[4096];
      int bytesRead;
      while ((bytesRead=inputStream.read(buffer)) >= 0) {
        out.write(buffer,0,bytesRead);
      }
    }
  finally {
      out.close();
    }
    return true;
  }
 catch (  IOException e) {
    return false;
  }
}
Program: 182214
Project: 182214
Buggy source:
public FileOutputStream startWrite() throws IOException {
  if (mBaseName.exists()) {
    if (!mBaseName.renameTo(mBackupName)) {
      mBackupName.delete();
      if (!mBaseName.renameTo(mBackupName)) {
        Log.w("String_Node_Str","String_Node_Str" + mBaseName + "String_Node_Str"+ mBackupName);
      }
    }
  }
  FileOutputStream str=null;
  try {
    str=new FileOutputStream(mBaseName);
  }
 catch (  FileNotFoundException e) {
    File parent=mBaseName.getParentFile();
    if (!parent.mkdir()) {
      throw new IOException("String_Node_Str" + mBaseName);
    }
    FileUtils.setPermissions(parent.getPath(),FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IXOTH,-1,-1);
    try {
      str=new FileOutputStream(mBaseName);
    }
 catch (    FileNotFoundException e2) {
      throw new IOException("String_Node_Str" + mBaseName);
    }
  }
  return str;
}

Fixed version (ground truth):
public FileOutputStream startWrite() throws IOException {
  if (mBaseName.exists()) {
    if (!mBackupName.exists()) {
      if (!mBaseName.renameTo(mBackupName)) {
        Log.w("String_Node_Str","String_Node_Str" + mBaseName + "String_Node_Str"+ mBackupName);
      }
    }
 else {
      mBaseName.delete();
    }
  }
  FileOutputStream str=null;
  try {
    str=new FileOutputStream(mBaseName);
  }
 catch (  FileNotFoundException e) {
    File parent=mBaseName.getParentFile();
    if (!parent.mkdir()) {
      throw new IOException("String_Node_Str" + mBaseName);
    }
    FileUtils.setPermissions(parent.getPath(),FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IXOTH,-1,-1);
    try {
      str=new FileOutputStream(mBaseName);
    }
 catch (    FileNotFoundException e2) {
      throw new IOException("String_Node_Str" + mBaseName);
    }
  }
  return str;
}
Program: 182215
Project: 182215
Buggy source:
public void writeLocked(){
  if ((mFile == null) || (mBackupFile == null)) {
    Log.w("String_Node_Str","String_Node_Str");
    return;
  }
  if (mFile.exists()) {
    if (mBackupFile.exists()) {
      mBackupFile.delete();
    }
    if (!mFile.renameTo(mBackupFile)) {
      Log.w("String_Node_Str","String_Node_Str");
      return;
    }
  }
  try {
    FileOutputStream stream=new FileOutputStream(mFile);
    Parcel out=Parcel.obtain();
    writeSummaryToParcel(out);
    stream.write(out.marshall());
    out.recycle();
    stream.flush();
    stream.close();
    mBackupFile.delete();
    mLastWriteTime=SystemClock.elapsedRealtime();
    return;
  }
 catch (  IOException e) {
    Log.w("String_Node_Str","String_Node_Str",e);
  }
  if (mFile.exists()) {
    if (!mFile.delete()) {
      Log.w(TAG,"String_Node_Str" + mFile);
    }
  }
}

Fixed version (ground truth):
public void writeLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  try {
    FileOutputStream stream=new FileOutputStream(mFile.chooseForWrite());
    Parcel out=Parcel.obtain();
    writeSummaryToParcel(out);
    stream.write(out.marshall());
    out.recycle();
    stream.flush();
    stream.close();
    mFile.commit();
    mLastWriteTime=SystemClock.elapsedRealtime();
    return;
  }
 catch (  IOException e) {
    Slog.w("String_Node_Str","String_Node_Str",e);
  }
  mFile.rollback();
}
Program: 182216
Project: 182216
Buggy source:
public void updateKernelWakelocksLocked(){
  Map<String,KernelWakelockStats> m=readKernelWakelockStats();
  if (m == null) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  for (  Map.Entry<String,KernelWakelockStats> ent : m.entrySet()) {
    String name=ent.getKey();
    KernelWakelockStats kws=ent.getValue();
    SamplingTimer kwlt=mKernelWakelockStats.get(name);
    if (kwlt == null) {
      kwlt=new SamplingTimer(mUnpluggables,mOnBatteryInternal,true);
      mKernelWakelockStats.put(name,kwlt);
    }
    kwlt.updateCurrentReportedCount(kws.mCount);
    kwlt.updateCurrentReportedTotalTime(kws.mTotalTime);
    kwlt.setUpdateVersion(sKernelWakelockUpdateVersion);
  }
  if (m.size() != mKernelWakelockStats.size()) {
    for (    Map.Entry<String,SamplingTimer> ent : mKernelWakelockStats.entrySet()) {
      SamplingTimer st=ent.getValue();
      if (st.getUpdateVersion() != sKernelWakelockUpdateVersion) {
        st.setStale();
      }
    }
  }
}

Fixed version (ground truth):
public void updateKernelWakelocksLocked(){
  Map<String,KernelWakelockStats> m=readKernelWakelockStats();
  if (m == null) {
    Slog.w(TAG,"String_Node_Str");
    return;
  }
  for (  Map.Entry<String,KernelWakelockStats> ent : m.entrySet()) {
    String name=ent.getKey();
    KernelWakelockStats kws=ent.getValue();
    SamplingTimer kwlt=mKernelWakelockStats.get(name);
    if (kwlt == null) {
      kwlt=new SamplingTimer(mUnpluggables,mOnBatteryInternal,true);
      mKernelWakelockStats.put(name,kwlt);
    }
    kwlt.updateCurrentReportedCount(kws.mCount);
    kwlt.updateCurrentReportedTotalTime(kws.mTotalTime);
    kwlt.setUpdateVersion(sKernelWakelockUpdateVersion);
  }
  if (m.size() != mKernelWakelockStats.size()) {
    for (    Map.Entry<String,SamplingTimer> ent : mKernelWakelockStats.entrySet()) {
      SamplingTimer st=ent.getValue();
      if (st.getUpdateVersion() != sKernelWakelockUpdateVersion) {
        st.setStale();
      }
    }
  }
}
Program: 182218
Project: 182218
Buggy source:
public void readLocked(){
  if ((mFile == null) || (mBackupFile == null)) {
    Log.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  FileInputStream stream=null;
  if (mBackupFile.exists()) {
    try {
      stream=new FileInputStream(mBackupFile);
    }
 catch (    java.io.IOException e) {
    }
  }
  try {
    if (stream == null) {
      if (!mFile.exists()) {
        return;
      }
      stream=new FileInputStream(mFile);
    }
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  java.io.IOException e) {
    Log.e("String_Node_Str","String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  java.io.IOException e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
}
Program: 182219
Project: 182219
Buggy source:
public BatteryStatsImpl(Parcel p){
  mFile=mBackupFile=null;
  readFromParcel(p);
}

Fixed version (ground truth):
public BatteryStatsImpl(Parcel p){
  mFile=null;
  readFromParcel(p);
}
Program: 182222
Project: 182222
Buggy source:
private void writeStatsToFile(boolean force){
synchronized (mFileLock) {
    mCal.setTimeInMillis(System.currentTimeMillis());
    final int curDay=mCal.get(Calendar.DAY_OF_YEAR);
    final boolean dayChanged=curDay != mLastWriteDay;
    long currElapsedTime=SystemClock.elapsedRealtime();
    if (!force) {
      if (((currElapsedTime - mLastWriteElapsedTime) < FILE_WRITE_INTERVAL) && (!dayChanged)) {
        return;
      }
    }
    mFileLeaf=getCurrentDateStr(FILE_PREFIX);
    File backupFile=null;
    if (mFile != null && mFile.exists()) {
      backupFile=new File(mFile.getPath() + "String_Node_Str");
      if (!mFile.renameTo(backupFile)) {
        Slog.w(TAG,"String_Node_Str");
        return;
      }
    }
    try {
      writeStatsFLOCK();
      mLastWriteElapsedTime=currElapsedTime;
      if (dayChanged) {
        mLastWriteDay=curDay;
synchronized (mStats) {
          mStats.clear();
        }
        mFile=new File(mDir,mFileLeaf);
        checkFileLimitFLOCK();
      }
      if (backupFile != null) {
        backupFile.delete();
      }
    }
 catch (    IOException e) {
      Slog.w(TAG,"String_Node_Str" + mFile);
      if (backupFile != null) {
        mFile.delete();
        backupFile.renameTo(mFile);
      }
    }
  }
}

Fixed version (ground truth):
private void writeStatsToFile(boolean force){
synchronized (mFileLock) {
    mCal.setTimeInMillis(System.currentTimeMillis());
    final int curDay=mCal.get(Calendar.DAY_OF_YEAR);
    final boolean dayChanged=curDay != mLastWriteDay;
    long currElapsedTime=SystemClock.elapsedRealtime();
    if (!force) {
      if (((currElapsedTime - mLastWriteElapsedTime) < FILE_WRITE_INTERVAL) && (!dayChanged)) {
        return;
      }
    }
    mFileLeaf=getCurrentDateStr(FILE_PREFIX);
    File backupFile=null;
    if (mFile != null && mFile.exists()) {
      backupFile=new File(mFile.getPath() + "String_Node_Str");
      if (!backupFile.exists()) {
        if (!mFile.renameTo(backupFile)) {
          Slog.w(TAG,"String_Node_Str");
          return;
        }
      }
 else {
        mFile.delete();
      }
    }
    try {
      writeStatsFLOCK();
      mLastWriteElapsedTime=currElapsedTime;
      if (dayChanged) {
        mLastWriteDay=curDay;
synchronized (mStats) {
          mStats.clear();
        }
        mFile=new File(mDir,mFileLeaf);
        checkFileLimitFLOCK();
      }
      if (backupFile != null) {
        backupFile.delete();
      }
    }
 catch (    IOException e) {
      Slog.w(TAG,"String_Node_Str" + mFile);
      if (backupFile != null) {
        mFile.delete();
        backupFile.renameTo(mFile);
      }
    }
  }
}
Program: 182223
Project: 182223
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: 182231
Project: 182231
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: 182232
Project: 182232
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: 182233
Project: 182233
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: 182234
Project: 182234
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: 182235
Project: 182235
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: 182236
Project: 182236
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: 182237
Project: 182237
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: 182238
Project: 182238
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: 182239
Project: 182239
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: 182240
Project: 182240
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: 182241
Project: 182241
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: 182242
Project: 182242
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: 182243
Project: 182243
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: 182244
Project: 182244
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: 182245
Project: 182245
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: 182246
Project: 182246
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: 182247
Project: 182247
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: 182248
Project: 182248
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: 182249
Project: 182249
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: 182250
Project: 182250
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: 182251
Project: 182251
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: 182253
Project: 182253
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: 182254
Project: 182254
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: 182255
Project: 182255
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();
}
Program: 182257
Project: 182257
Buggy source:
/** 
 * Constructor - fires it up and makes it look like the search UI.
 * @param context Application Context we can use for system acess
 */
public SearchDialog(Context context,SearchManager searchManager){
  super(context,com.android.internal.R.style.Theme_SearchBar);
  mVoiceWebSearchIntent=new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
  mVoiceWebSearchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  mVoiceWebSearchIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
  mVoiceAppSearchIntent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  mVoiceAppSearchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  mSearchManager=searchManager;
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
  context.registerReceiver(new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      if (intent.getAction().equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
        onConfigurationChanged();
      }
    }
  }
,filter);
}

Fixed version (ground truth):
/** 
 * Constructor - fires it up and makes it look like the search UI.
 * @param context Application Context we can use for system acess
 */
public SearchDialog(Context context,SearchManager searchManager){
  super(context,com.android.internal.R.style.Theme_SearchBar);
  mVoiceWebSearchIntent=new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
  mVoiceWebSearchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  mVoiceWebSearchIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
  mVoiceAppSearchIntent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  mVoiceAppSearchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  mSearchManager=searchManager;
}
Program: 182258
Project: 182258
Buggy source:
/** 
 * The search dialog is being dismissed, so handle all of the local shutdown operations. This function is designed to be idempotent so that dismiss() can be safely called at any time (even if already closed) and more likely to really dump any memory.  No leaks!
 */
@Override public void onStop(){
  super.onStop();
  closeSuggestionsAdapter();
  mLaunchComponent=null;
  mAppSearchData=null;
  mSearchable=null;
  mUserQuery=null;
}

Fixed version (ground truth):
/** 
 * The search dialog is being dismissed, so handle all of the local shutdown operations. This function is designed to be idempotent so that dismiss() can be safely called at any time (even if already closed) and more likely to really dump any memory.  No leaks!
 */
@Override public void onStop(){
  super.onStop();
  getContext().unregisterReceiver(mConfChangeListener);
  closeSuggestionsAdapter();
  mLaunchComponent=null;
  mAppSearchData=null;
  mSearchable=null;
  mUserQuery=null;
}