Program: 2444
Project: 2444
Buggy source:
/** 
 * Create a new BrowserFrame to be used in an application.
 * @param context An application context to use when retrieving assets.
 * @param w A WebViewCore used as the view for this frame.
 * @param proxy A CallbackProxy for posting messages to the UI thread andquerying a client for information.
 * @param settings A WebSettings object that holds all settings.XXX: Called by WebCore thread.
 */
public BrowserFrame(Context context,WebViewCore w,CallbackProxy proxy,WebSettingsClassic settings,Map<String,Object> javascriptInterfaces){
  Context appContext=context.getApplicationContext();
  if (sJavaBridge == null) {
    sJavaBridge=new JWebCoreJavaBridge();
    ActivityManager am=(ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
    if (am.getMemoryClass() > 16) {
      sJavaBridge.setCacheSize(8 * 1024 * 1024);
    }
 else {
      sJavaBridge.setCacheSize(4 * 1024 * 1024);
    }
    CacheManager.init(appContext);
    CookieSyncManager.createInstance(appContext);
    PluginManager.getInstance(appContext);
  }
  if (sConfigCallback == null) {
    sConfigCallback=new ConfigCallback((WindowManager)appContext.getSystemService(Context.WINDOW_SERVICE));
    ViewRootImpl.addConfigCallback(sConfigCallback);
  }
  sConfigCallback.addHandler(this);
  mJavaScriptObjects=new HashMap<String,JSObject>();
  addJavaScriptObjects(javascriptInterfaces);
  mRemovedJavaScriptObjects=new HashSet<Object>();
  mSettings=settings;
  mContext=context;
  mCallbackProxy=proxy;
  mWebViewCore=w;
  mSearchBox=new SearchBoxImpl(mWebViewCore,mCallbackProxy);
  AssetManager am=context.getAssets();
  nativeCreateFrame(w,am,proxy.getBackForwardList());
  if (DebugFlags.BROWSER_FRAME) {
    Log.v(LOGTAG,"String_Node_Str" + this);
  }
}

Fixed version (ground truth):
/** 
 * Create a new BrowserFrame to be used in an application.
 * @param context An application context to use when retrieving assets.
 * @param w A WebViewCore used as the view for this frame.
 * @param proxy A CallbackProxy for posting messages to the UI thread andquerying a client for information.
 * @param settings A WebSettings object that holds all settings.XXX: Called by WebCore thread.
 */
public BrowserFrame(Context context,WebViewCore w,CallbackProxy proxy,WebSettingsClassic settings,Map<String,Object> javascriptInterfaces){
  Context appContext=context.getApplicationContext();
  if (sJavaBridge == null) {
    sJavaBridge=new JWebCoreJavaBridge();
    ActivityManager am=(ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
    if (am.getMemoryClass() > 16) {
      sJavaBridge.setCacheSize(8 * 1024 * 1024);
    }
 else {
      sJavaBridge.setCacheSize(4 * 1024 * 1024);
    }
    CacheManager.init(appContext);
    CookieSyncManager.createInstance(appContext);
    PluginManager.getInstance(appContext);
  }
  if (sConfigCallback == null) {
    sConfigCallback=new ConfigCallback((WindowManager)appContext.getSystemService(Context.WINDOW_SERVICE));
    ViewRootImpl.addConfigCallback(sConfigCallback);
  }
  sConfigCallback.addHandler(this);
  mJavaScriptObjects=new HashMap<String,JSObject>();
  addJavaScriptObjects(javascriptInterfaces);
  mRemovedJavaScriptObjects=new HashSet<Object>();
  mSettings=settings;
  mContext=context;
  mCallbackProxy=proxy;
  mDatabase=WebViewDatabaseClassic.getInstance(appContext);
  mWebViewCore=w;
  mSearchBox=new SearchBoxImpl(mWebViewCore,mCallbackProxy);
  AssetManager am=context.getAssets();
  nativeCreateFrame(w,am,proxy.getBackForwardList());
  if (DebugFlags.BROWSER_FRAME) {
    Log.v(LOGTAG,"String_Node_Str" + this);
  }
}