Program: 182973
Project: 182973
Buggy source:
private final void handleBindApplication(AppBindData data){
  mBoundApplication=data;
  mConfiguration=new Configuration(data.config);
  Process.setArgV0(data.processName);
  android.ddm.DdmHandleAppName.setAppName(data.processName);
  TimeZone.setDefault(null);
  Locale.setDefault(data.config.locale);
  Resources.getSystem().updateConfiguration(mConfiguration,null);
  data.info=getPackageInfoNoCheck(data.appInfo);
  if ((data.appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES) == 0) {
    Bitmap.setDefaultDensity(DisplayMetrics.DENSITY_DEFAULT);
  }
  if (data.debugMode != IApplicationThread.DEBUG_OFF) {
    Debug.changeDebugPort(8100);
    if (data.debugMode == IApplicationThread.DEBUG_WAIT) {
      Log.w(TAG,"String_Node_Str" + data.info.getPackageName() + "String_Node_Str");
      IActivityManager mgr=ActivityManagerNative.getDefault();
      try {
        mgr.showWaitingForDebugger(mAppThread,true);
      }
 catch (      RemoteException ex) {
      }
      Debug.waitForDebugger();
      try {
        mgr.showWaitingForDebugger(mAppThread,false);
      }
 catch (      RemoteException ex) {
      }
    }
 else {
      Log.w(TAG,"String_Node_Str" + data.info.getPackageName() + "String_Node_Str");
    }
  }
  if (data.instrumentationName != null) {
    ApplicationContext appContext=new ApplicationContext();
    appContext.init(data.info,null,this);
    InstrumentationInfo ii=null;
    try {
      ii=appContext.getPackageManager().getInstrumentationInfo(data.instrumentationName,0);
    }
 catch (    PackageManager.NameNotFoundException e) {
    }
    if (ii == null) {
      throw new RuntimeException("String_Node_Str" + data.instrumentationName);
    }
    mInstrumentationAppDir=ii.sourceDir;
    mInstrumentationAppPackage=ii.packageName;
    mInstrumentedAppDir=data.info.getAppDir();
    ApplicationInfo instrApp=new ApplicationInfo();
    instrApp.packageName=ii.packageName;
    instrApp.sourceDir=ii.sourceDir;
    instrApp.publicSourceDir=ii.publicSourceDir;
    instrApp.dataDir=ii.dataDir;
    PackageInfo pi=getPackageInfo(instrApp,appContext.getClassLoader(),false,true);
    ApplicationContext instrContext=new ApplicationContext();
    instrContext.init(pi,null,this);
    try {
      java.lang.ClassLoader cl=instrContext.getClassLoader();
      mInstrumentation=(Instrumentation)cl.loadClass(data.instrumentationName.getClassName()).newInstance();
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + data.instrumentationName + "String_Node_Str"+ e.toString(),e);
    }
    mInstrumentation.init(this,instrContext,appContext,new ComponentName(ii.packageName,ii.name),data.instrumentationWatcher);
    if (data.profileFile != null && !ii.handleProfiling) {
      data.handlingProfiling=true;
      File file=new File(data.profileFile);
      file.getParentFile().mkdirs();
      Debug.startMethodTracing(file.toString(),8 * 1024 * 1024);
    }
    try {
      mInstrumentation.onCreate(data.instrumentationArgs);
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + data.instrumentationName + "String_Node_Str"+ e.toString(),e);
    }
  }
 else {
    mInstrumentation=new Instrumentation();
  }
  Application app=data.info.makeApplication(data.restrictedBackupMode);
  mInitialApplication=app;
  List<ProviderInfo> providers=data.providers;
  if (providers != null) {
    installContentProviders(app,providers);
  }
  try {
    mInstrumentation.callApplicationOnCreate(app);
  }
 catch (  Exception e) {
    if (!mInstrumentation.onException(app,e)) {
      throw new RuntimeException("String_Node_Str" + app.getClass().getName() + "String_Node_Str"+ e.toString(),e);
    }
  }
}

Fixed version (ground truth):
private final void handleBindApplication(AppBindData data){
  mBoundApplication=data;
  mConfiguration=new Configuration(data.config);
  Process.setArgV0(data.processName);
  android.ddm.DdmHandleAppName.setAppName(data.processName);
  TimeZone.setDefault(null);
  Locale.setDefault(data.config.locale);
  Resources.getSystem().updateConfiguration(mConfiguration,null);
  data.info=getPackageInfoNoCheck(data.appInfo);
  if ((data.appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES) == 0) {
    Bitmap.setDefaultDensity(DisplayMetrics.DENSITY_DEFAULT);
  }
  if (data.debugMode != IApplicationThread.DEBUG_OFF) {
    Debug.changeDebugPort(8100);
    if (data.debugMode == IApplicationThread.DEBUG_WAIT) {
      Log.w(TAG,"String_Node_Str" + data.info.getPackageName() + "String_Node_Str");
      IActivityManager mgr=ActivityManagerNative.getDefault();
      try {
        mgr.showWaitingForDebugger(mAppThread,true);
      }
 catch (      RemoteException ex) {
      }
      Debug.waitForDebugger();
      try {
        mgr.showWaitingForDebugger(mAppThread,false);
      }
 catch (      RemoteException ex) {
      }
    }
 else {
      Log.w(TAG,"String_Node_Str" + data.info.getPackageName() + "String_Node_Str");
    }
  }
  if (data.instrumentationName != null) {
    ApplicationContext appContext=new ApplicationContext();
    appContext.init(data.info,null,this);
    InstrumentationInfo ii=null;
    try {
      ii=appContext.getPackageManager().getInstrumentationInfo(data.instrumentationName,0);
    }
 catch (    PackageManager.NameNotFoundException e) {
    }
    if (ii == null) {
      throw new RuntimeException("String_Node_Str" + data.instrumentationName);
    }
    mInstrumentationAppDir=ii.sourceDir;
    mInstrumentationAppPackage=ii.packageName;
    mInstrumentedAppDir=data.info.getAppDir();
    ApplicationInfo instrApp=new ApplicationInfo();
    instrApp.packageName=ii.packageName;
    instrApp.sourceDir=ii.sourceDir;
    instrApp.publicSourceDir=ii.publicSourceDir;
    instrApp.dataDir=ii.dataDir;
    PackageInfo pi=getPackageInfo(instrApp,appContext.getClassLoader(),false,true);
    ApplicationContext instrContext=new ApplicationContext();
    instrContext.init(pi,null,this);
    try {
      java.lang.ClassLoader cl=instrContext.getClassLoader();
      mInstrumentation=(Instrumentation)cl.loadClass(data.instrumentationName.getClassName()).newInstance();
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + data.instrumentationName + "String_Node_Str"+ e.toString(),e);
    }
    mInstrumentation.init(this,instrContext,appContext,new ComponentName(ii.packageName,ii.name),data.instrumentationWatcher);
    if (data.profileFile != null && !ii.handleProfiling) {
      data.handlingProfiling=true;
      File file=new File(data.profileFile);
      file.getParentFile().mkdirs();
      Debug.startMethodTracing(file.toString(),8 * 1024 * 1024);
    }
    try {
      mInstrumentation.onCreate(data.instrumentationArgs);
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + data.instrumentationName + "String_Node_Str"+ e.toString(),e);
    }
  }
 else {
    mInstrumentation=new Instrumentation();
  }
  Application app=data.info.makeApplication(data.restrictedBackupMode,null);
  mInitialApplication=app;
  List<ProviderInfo> providers=data.providers;
  if (providers != null) {
    installContentProviders(app,providers);
  }
  try {
    mInstrumentation.callApplicationOnCreate(app);
  }
 catch (  Exception e) {
    if (!mInstrumentation.onException(app,e)) {
      throw new RuntimeException("String_Node_Str" + app.getClass().getName() + "String_Node_Str"+ e.toString(),e);
    }
  }
}