Program: 183037
Project: 183037
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void init(Context context,IWindowManager windowManager,LocalPowerManager powerManager){
  mContext=context;
  mWindowManager=windowManager;
  mPowerManager=powerManager;
  mKeyguardMediator=new KeyguardViewMediator(context,this,powerManager);
  mHandler=new Handler();
  mOrientationListener=new MyOrientationListener(mContext);
  SettingsObserver settingsObserver=new SettingsObserver(mHandler);
  settingsObserver.observe();
  mShortcutManager=new ShortcutManager(context,mHandler);
  mShortcutManager.observe();
  mHomeIntent=new Intent(Intent.ACTION_MAIN,null);
  mHomeIntent.addCategory(Intent.CATEGORY_HOME);
  mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
  mCarDockIntent=new Intent(Intent.ACTION_MAIN,null);
  mCarDockIntent.addCategory(Intent.CATEGORY_CAR_DOCK);
  mCarDockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
  mDeskDockIntent=new Intent(Intent.ACTION_MAIN,null);
  mDeskDockIntent.addCategory(Intent.CATEGORY_DESK_DOCK);
  mDeskDockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
  PowerManager pm=(PowerManager)context.getSystemService(Context.POWER_SERVICE);
  mBroadcastWakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"String_Node_Str");
  mDockWakeLock=pm.newWakeLock(PowerManager.FULL_WAKE_LOCK,"String_Node_Str");
  mDockWakeLock.setReferenceCounted(false);
  mEnableShiftMenuBugReports="String_Node_Str".equals(SystemProperties.get("String_Node_Str"));
  mLidOpenRotation=readRotation(com.android.internal.R.integer.config_lidOpenRotation);
  mCarDockRotation=readRotation(com.android.internal.R.integer.config_carDockRotation);
  mDeskDockRotation=readRotation(com.android.internal.R.integer.config_deskDockRotation);
  mCarDockKeepsScreenOn=mContext.getResources().getInteger(com.android.internal.R.integer.config_carDockKeepsScreenOn);
  mDeskDockKeepsScreenOn=mContext.getResources().getInteger(com.android.internal.R.integer.config_deskDockKeepsScreenOn);
  mCarDockEnablesAccelerometer=mContext.getResources().getBoolean(com.android.internal.R.bool.config_carDockEnablesAccelerometer);
  mDeskDockEnablesAccelerometer=mContext.getResources().getBoolean(com.android.internal.R.bool.config_deskDockEnablesAccelerometer);
  mLidKeyboardAccessibility=mContext.getResources().getInteger(com.android.internal.R.integer.config_lidKeyboardAccessibility);
  mLidNavigationAccessibility=mContext.getResources().getInteger(com.android.internal.R.integer.config_lidNavigationAccessibility);
  IntentFilter intentFilter=new IntentFilter();
  intentFilter.addAction(Intent.ACTION_POWER_CONNECTED);
  intentFilter.addAction(Intent.ACTION_POWER_DISCONNECTED);
  context.registerReceiver(mPowerReceiver,intentFilter);
  mBatteryStatusFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
  mPlugged=0;
  updatePlugged();
  context.registerReceiver(mDockReceiver,new IntentFilter(Intent.ACTION_DOCK_EVENT));
  mVibrator=new Vibrator();
  mLongPressVibePattern=getLongIntArray(mContext.getResources(),com.android.internal.R.array.config_longPressVibePattern);
  mVirtualKeyVibePattern=getLongIntArray(mContext.getResources(),com.android.internal.R.array.config_virtualKeyVibePattern);
  mSafeModeDisabledVibePattern=getLongIntArray(mContext.getResources(),com.android.internal.R.array.config_safeModeDisabledVibePattern);
  mSafeModeEnabledVibePattern=getLongIntArray(mContext.getResources(),com.android.internal.R.array.config_safeModeEnabledVibePattern);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void init(Context context,IWindowManager windowManager,LocalPowerManager powerManager){
  mContext=context;
  mWindowManager=windowManager;
  mPowerManager=powerManager;
  mKeyguardMediator=new KeyguardViewMediator(context,this,powerManager);
  mHandler=new Handler();
  mOrientationListener=new MyOrientationListener(mContext);
  SettingsObserver settingsObserver=new SettingsObserver(mHandler);
  settingsObserver.observe();
  mShortcutManager=new ShortcutManager(context,mHandler);
  mShortcutManager.observe();
  mHomeIntent=new Intent(Intent.ACTION_MAIN,null);
  mHomeIntent.addCategory(Intent.CATEGORY_HOME);
  mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
  mCarDockIntent=new Intent(Intent.ACTION_MAIN,null);
  mCarDockIntent.addCategory(Intent.CATEGORY_CAR_DOCK);
  mCarDockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
  mDeskDockIntent=new Intent(Intent.ACTION_MAIN,null);
  mDeskDockIntent.addCategory(Intent.CATEGORY_DESK_DOCK);
  mDeskDockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
  PowerManager pm=(PowerManager)context.getSystemService(Context.POWER_SERVICE);
  mBroadcastWakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"String_Node_Str");
  mDockWakeLock=pm.newWakeLock(PowerManager.FULL_WAKE_LOCK,"String_Node_Str");
  mDockWakeLock.setReferenceCounted(false);
  mEnableShiftMenuBugReports="String_Node_Str".equals(SystemProperties.get("String_Node_Str"));
  mLidOpenRotation=readRotation(com.android.internal.R.integer.config_lidOpenRotation);
  mCarDockRotation=readRotation(com.android.internal.R.integer.config_carDockRotation);
  mDeskDockRotation=readRotation(com.android.internal.R.integer.config_deskDockRotation);
  mCarDockKeepsScreenOn=mContext.getResources().getInteger(com.android.internal.R.integer.config_carDockKeepsScreenOn);
  mDeskDockKeepsScreenOn=mContext.getResources().getInteger(com.android.internal.R.integer.config_deskDockKeepsScreenOn);
  mCarDockEnablesAccelerometer=mContext.getResources().getBoolean(com.android.internal.R.bool.config_carDockEnablesAccelerometer);
  mDeskDockEnablesAccelerometer=mContext.getResources().getBoolean(com.android.internal.R.bool.config_deskDockEnablesAccelerometer);
  mLidKeyboardAccessibility=mContext.getResources().getInteger(com.android.internal.R.integer.config_lidKeyboardAccessibility);
  mLidNavigationAccessibility=mContext.getResources().getInteger(com.android.internal.R.integer.config_lidNavigationAccessibility);
  mBatteryStatusFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
  mPlugged=0;
  updatePlugged(context.registerReceiver(null,mBatteryStatusFilter));
  context.registerReceiver(mDockReceiver,new IntentFilter(Intent.ACTION_DOCK_EVENT));
  mVibrator=new Vibrator();
  mLongPressVibePattern=getLongIntArray(mContext.getResources(),com.android.internal.R.array.config_longPressVibePattern);
  mVirtualKeyVibePattern=getLongIntArray(mContext.getResources(),com.android.internal.R.array.config_virtualKeyVibePattern);
  mSafeModeDisabledVibePattern=getLongIntArray(mContext.getResources(),com.android.internal.R.array.config_safeModeDisabledVibePattern);
  mSafeModeEnabledVibePattern=getLongIntArray(mContext.getResources(),com.android.internal.R.array.config_safeModeEnabledVibePattern);
}