Program: 37582
Project: 37582
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  options=PreferenceManager.getDefaultSharedPreferences(this);
  if (Build.VERSION.SDK_INT >= 11 && options.getBoolean("String_Node_Str",false)) {
    Notification noti=new Notification.Builder(this).setContentTitle("String_Node_Str").setContentText("String_Node_Str").setSmallIcon(R.drawable.icon).build();
    NotificationManager notiManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
    notiManager.notify(0,noti);
  }
  setRequestedOrientation(Integer.parseInt(options.getString(Options.PREF_ORIENTATION,"String_Node_Str")));
  setContentView(R.layout.apps);
  findViewById(R.id.appsWindow).setBackgroundColor(options.getInt(Options.PREF_APPS_WINDOW_BACKGROUND,0));
  findViewById(R.id.topbar).setBackgroundColor(options.getInt(Options.PREF_BAR_BACKGROUND,0x22000000));
  findViewById(R.id.dummy_top_view).setBackgroundColor(options.getInt(Options.PREF_BAR_BACKGROUND,0x22000000));
  findViewById(R.id.dummy_bottom_view).setBackgroundColor(options.getInt(Options.PREF_BAR_BACKGROUND,0x22000000));
  findViewById(R.id.dock_bar).setBackgroundColor(options.getInt(Options.PREF_DOCK_BACKGROUND,0x22000000));
  grid=(GridView)findViewById(R.id.appsGrid);
  ManagerContainer.setIconPackManager(this);
  prefListener=new OnSharedPreferenceChangeListener(){
    @Override public void onSharedPreferenceChanged(    SharedPreferences sharedPreferences,    String key){
      if (key.equals(Options.PREF_ORIENTATION) || key.equals("String_Node_Str") || key.equals("String_Node_Str")) {
        Toast.makeText(Apps.this,getResources().getString(R.string.restartToImplement),Toast.LENGTH_LONG).show();
      }
 else       if (key.equals(Options.PREF_BAR_BACKGROUND)) {
        findViewById(R.id.topbar).setBackgroundColor(options.getInt(Options.PREF_BAR_BACKGROUND,0));
      }
 else       if (key.equals(Options.PREF_APPS_WINDOW_BACKGROUND)) {
        findViewById(R.id.appsWindow).setBackgroundColor(options.getInt(Options.PREF_APPS_WINDOW_BACKGROUND,0));
      }
 else       if (key.equals(Options.PREF_ICON_PACK) || key.equals(Options.PREF_TRANSFORM_DRAWABLE)) {
        MyCache.deleteIcons(Apps.this);
        ManagerContainer.getIconPackManager().setIconPack(sharedPreferences.getString(Options.PREF_ICON_PACK,"String_Node_Str"));
        if (scanner != null && scanner.getStatus() == AsyncTask.Status.RUNNING)         return;
        scanner=new GetApps(Apps.this);
        scanner.execute(true);
        loadFilteredApps();
        setSpinner();
        return;
      }
 else       if (key.equals(Options.PREF_DIRTY) && sharedPreferences.getBoolean(Options.PREF_DIRTY,false)) {
        if (scanner == null || scanner.getStatus() != AsyncTask.Status.RUNNING) {
          scanner=new GetApps(Apps.this);
          scanner.execute(false);
        }
      }
    }
  }
;
  options.registerOnSharedPreferenceChangeListener(prefListener);
  setScrollbar();
  fixPadding();
  categories=null;
  spin=(Spinner)findViewById(R.id.category);
  swipeListener=new View.OnTouchListener(){
    float x, density;
    public boolean onTouch(    View v,    MotionEvent e){
      density=getResources().getDisplayMetrics().density;
      int action=e.getAction() & 255;
switch (action) {
case MotionEvent.ACTION_DOWN:
        x=e.getX();
      return true;
case MotionEvent.ACTION_UP:
    if (e.getX() - x > 30.0 * density) {
      categories.setCurCategory(categories.getPrevCategory());
      loadFilteredApps();
      setSpinner();
      return true;
    }
 else     if (x - e.getX() > 30.0 * density) {
      categories.setCurCategory(categories.getNextCategory());
      loadFilteredApps();
      setSpinner();
      return true;
    }
 else     v.performClick();
default :
  return false;
}
}
}
;
spin.setOnTouchListener(swipeListener);
dock=new Dock(this);
changePrefsOnRotate();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  options=PreferenceManager.getDefaultSharedPreferences(this);
  if (Build.VERSION.SDK_INT >= 11 && options.getBoolean("String_Node_Str",false)) {
    Notification noti=new Notification.Builder(this).setContentTitle("String_Node_Str").setContentText("String_Node_Str").setSmallIcon(R.drawable.icon).build();
    NotificationManager notiManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
    notiManager.notify(0,noti);
  }
  setRequestedOrientation(Integer.parseInt(options.getString(Options.PREF_ORIENTATION,"String_Node_Str")));
  setContentView(R.layout.apps);
  findViewById(R.id.appsWindow).setBackgroundColor(options.getInt(Options.PREF_APPS_WINDOW_BACKGROUND,0));
  findViewById(R.id.topbar).setBackgroundColor(options.getInt(Options.PREF_BAR_BACKGROUND,0x22000000));
  findViewById(R.id.dummy_top_view).setBackgroundColor(options.getInt(Options.PREF_BAR_BACKGROUND,0x22000000));
  findViewById(R.id.dummy_bottom_view).setBackgroundColor(options.getInt(Options.PREF_BAR_BACKGROUND,0x22000000));
  findViewById(R.id.dock_bar).setBackgroundColor(options.getInt(Options.PREF_DOCK_BACKGROUND,0x22000000));
  grid=(GridView)findViewById(R.id.appsGrid);
  ManagerContainer.setIconPackManager(this);
  prefListener=new OnSharedPreferenceChangeListener(){
    @Override public void onSharedPreferenceChanged(    SharedPreferences sharedPreferences,    String key){
      if (key.equals(Options.PREF_ORIENTATION) || key.equals("String_Node_Str") || key.equals("String_Node_Str")) {
        Toast.makeText(Apps.this,getResources().getString(R.string.restartToImplement),Toast.LENGTH_LONG).show();
      }
 else       if (key.equals(Options.PREF_BAR_BACKGROUND)) {
        findViewById(R.id.topbar).setBackgroundColor(options.getInt(Options.PREF_BAR_BACKGROUND,0));
      }
 else       if (key.equals(Options.PREF_APPS_WINDOW_BACKGROUND)) {
        findViewById(R.id.appsWindow).setBackgroundColor(options.getInt(Options.PREF_APPS_WINDOW_BACKGROUND,0));
      }
 else       if (key.equals(Options.PREF_ICON_PACK) || key.equals(Options.PREF_TRANSFORM_DRAWABLE)) {
        MyCache.deleteIcons(Apps.this);
        ManagerContainer.getIconPackManager().setIconPack(sharedPreferences.getString(Options.PREF_ICON_PACK,"String_Node_Str"));
        if (scanner != null && scanner.getStatus() == AsyncTask.Status.RUNNING)         return;
        scanner=new GetApps(Apps.this);
        scanner.execute(true);
        loadFilteredApps();
        setSpinner();
        return;
      }
 else       if (key.equals(Options.PREF_DIRTY) && sharedPreferences.getBoolean(Options.PREF_DIRTY,false)) {
        if (scanner == null || scanner.getStatus() != AsyncTask.Status.RUNNING) {
          scanner=new GetApps(Apps.this);
          scanner.execute(false);
        }
      }
    }
  }
;
  options.registerOnSharedPreferenceChangeListener(prefListener);
  initGrid();
  setScrollbar();
  fixPadding();
  categories=null;
  spin=(Spinner)findViewById(R.id.category);
  swipeListener=new View.OnTouchListener(){
    float x, density;
    public boolean onTouch(    View v,    MotionEvent e){
      density=getResources().getDisplayMetrics().density;
      int action=e.getAction() & 255;
switch (action) {
case MotionEvent.ACTION_DOWN:
        x=e.getX();
      return true;
case MotionEvent.ACTION_UP:
    if (e.getX() - x > 30.0 * density) {
      categories.setCurCategory(categories.getPrevCategory());
      loadFilteredApps();
      setSpinner();
      return true;
    }
 else     if (x - e.getX() > 30.0 * density) {
      categories.setCurCategory(categories.getNextCategory());
      loadFilteredApps();
      setSpinner();
      return true;
    }
 else     v.performClick();
default :
  return false;
}
}
}
;
spin.setOnTouchListener(swipeListener);
dock=new Dock(this);
changePrefsOnRotate();
}