Program: 153171
Project: 153171
Buggy source:
private Map<String,String> shouldBeCheckedAppMap(){
  Map<String,String> codesVersionMap=new HashMap<String,String>();
  String[] columns={InstalledAppDb.COLUMN_CODE,InstalledAppDb.COLUMN_VERSION,InstalledAppDb.COLUMN_STATE,InstalledAppDb.COLUMN_PKG_NAME};
  try {
    ContentResolver cr=mContext.getContentResolver();
    Cursor c=cr.query(BehooProvider.INSTALLED_APP_CONTENT_URI,columns,null,null,null);
    if (null != c) {
      int codeId=c.getColumnIndexOrThrow(InstalledAppDb.COLUMN_CODE);
      int versionId=c.getColumnIndexOrThrow(InstalledAppDb.COLUMN_VERSION);
      int stateId=c.getColumnIndexOrThrow(InstalledAppDb.COLUMN_STATE);
      int pkgNameId=c.getColumnIndexOrThrow(InstalledAppDb.COLUMN_PKG_NAME);
      String code=null;
      String version=null;
      String state=null;
      String pkgName=null;
      PackageManager pm=mContext.getPackageManager();
      for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
        code=c.getString(codeId);
        version=c.getString(versionId);
        state=c.getString(stateId);
        pkgName=c.getString(pkgNameId);
        PackageState pkgstate=Constants.getStateByString(state);
        if (pkgUninstalled(pm,pkgName,pkgstate)) {
          String where=InstalledAppDb.COLUMN_CODE + "String_Node_Str";
          String[] selectionArgs={code};
          cr.delete(BehooProvider.INSTALLED_APP_CONTENT_URI,where,selectionArgs);
        }
 else         if (PackageState.install_succeeded == pkgstate && -1 != getPkgVersionCode(pm,pkgName)) {
          codesVersionMap.put(code,version);
        }
      }
      c.close();
    }
  }
 catch (  Throwable tr) {
    tr.printStackTrace();
  }
  Log.i(TAG,"String_Node_Str" + Integer.toString(codesVersionMap.size()));
  return codesVersionMap;
}

Fixed version (ground truth):
private Map<String,String> shouldBeCheckedAppMap(){
  Map<String,String> codesVersionMap=new HashMap<String,String>();
  String[] columns={InstalledAppDb.COLUMN_CODE,InstalledAppDb.COLUMN_VERSION,InstalledAppDb.COLUMN_STATE,InstalledAppDb.COLUMN_PKG_NAME};
  try {
    ContentResolver cr=mContext.getContentResolver();
    Cursor c=cr.query(BehooProvider.INSTALLED_APP_CONTENT_URI,columns,null,null,null);
    if (null != c) {
      int codeId=c.getColumnIndexOrThrow(InstalledAppDb.COLUMN_CODE);
      int stateId=c.getColumnIndexOrThrow(InstalledAppDb.COLUMN_STATE);
      int pkgNameId=c.getColumnIndexOrThrow(InstalledAppDb.COLUMN_PKG_NAME);
      String code=null;
      String state=null;
      String pkgName=null;
      PackageManager pm=mContext.getPackageManager();
      for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
        code=c.getString(codeId);
        state=c.getString(stateId);
        pkgName=c.getString(pkgNameId);
        PackageState pkgstate=Constants.getStateByString(state);
        if (pkgUninstalled(pm,pkgName,pkgstate)) {
          String where=InstalledAppDb.COLUMN_CODE + "String_Node_Str";
          String[] selectionArgs={code};
          cr.delete(BehooProvider.INSTALLED_APP_CONTENT_URI,where,selectionArgs);
        }
 else         if (PackageState.install_succeeded == pkgstate) {
          int versionCode=getPkgVersionCode(pm,pkgName);
          if (-1 != versionCode) {
            codesVersionMap.put(code,Integer.toString(versionCode));
          }
        }
      }
      c.close();
    }
  }
 catch (  Throwable tr) {
    tr.printStackTrace();
  }
  Log.i(TAG,"String_Node_Str" + Integer.toString(codesVersionMap.size()));
  return codesVersionMap;
}