Program: 162591
Project: 162591
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setHasOptionsMenu(false);
  mainActivity=(MainActivity)getActivity();
  utils=new Futils();
  String x=getSelectionColor();
  skinselection=Color.parseColor(x);
  color=calculatevalues(x);
  ColorMatrix colorMatrix=new ColorMatrix(calculatefilter(color));
  colorMatrixColorFilter=new ColorMatrixColorFilter(colorMatrix);
  history=new HistoryManager(getActivity(),"String_Node_Str");
  hidden=new HistoryManager(getActivity(),"String_Node_Str");
  hiddenfiles=hidden.readTable();
  rootMode=Sp.getBoolean("String_Node_Str",false);
  showHidden=Sp.getBoolean("String_Node_Str",false);
  coloriseIcons=Sp.getBoolean("String_Node_Str",false);
  if (islist) {
    folder=res.getDrawable(R.drawable.ic_grid_folder_new);
  }
 else {
    folder=res.getDrawable(R.drawable.ic_grid_folder1);
  }
  folder=res.getDrawable(R.drawable.ic_grid_folder_new);
  getSortModes();
  darkimage=res.getDrawable(R.drawable.ic_doc_image_dark);
  darkvideo=res.getDrawable(R.drawable.ic_doc_video_dark);
  this.setRetainInstance(false);
  File f;
  if (savepaths)   f=new File(current);
 else   f=new File(home);
  mainActivity.initiatebbar();
  scroll=(HorizontalScrollView)rootView.findViewById(R.id.scroll);
  scroll1=(HorizontalScrollView)rootView.findViewById(R.id.scroll1);
  footerView=getActivity().getLayoutInflater().inflate(R.layout.divider,null);
  mSwipeRefreshLayout=(SwipeRefreshLayout)rootView.findViewById(R.id.activity_main_swipe_refresh_layout);
  mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener(){
    @Override public void onRefresh(){
      loadlist(new File(current),false);
    }
  }
);
  if (savedInstanceState == null) {
    if (Intentpath != null) {
      File file1=new File(Intentpath);
      if (file1.isDirectory()) {
        loadlist(file1,false);
      }
 else {
        utils.openFile(file1,mainActivity);
        loadlist(f,false);
      }
    }
 else {
      loadlist(f,false);
    }
  }
 else {
    Bundle b=new Bundle();
    String cur=savedInstanceState.getString("String_Node_Str");
    if (cur != null) {
      b.putInt("String_Node_Str",savedInstanceState.getInt("String_Node_Str"));
      b.putInt("String_Node_Str",savedInstanceState.getInt("String_Node_Str"));
      scrolls.put(cur,b);
      list=savedInstanceState.getParcelableArrayList("String_Node_Str");
      if (savedInstanceState.getBoolean("String_Node_Str")) {
        try {
          createViews(list,true,new File(current));
          ((TextView)ma.pathbar.findViewById(R.id.pathname)).setText(ma.utils.getString(ma.getActivity(),R.string.searchresults));
          results=true;
        }
 catch (        Exception e) {
        }
      }
 else {
        createViews(list,true,new File(cur));
      }
      if (savedInstanceState.getBoolean("String_Node_Str")) {
        for (        int i : savedInstanceState.getIntegerArrayList("String_Node_Str")) {
          adapter.toggleChecked(i);
        }
      }
    }
  }
  mToolbarHeight=getToolbarHeight(getActivity());
  paddingTop=(mToolbarHeight) + dpToPx(72);
  if (hidemode == 2)   mToolbarHeight=paddingTop;
  mToolbarContainer.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
        mToolbarContainer.getViewTreeObserver().removeOnGlobalLayoutListener(this);
      }
 else {
        mToolbarContainer.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      }
      paddingTop=mToolbarContainer.getHeight();
      if (hidemode != 2)       mToolbarHeight=mainActivity.toolbar.getHeight();
    }
  }
);
  mSwipeRefreshLayout.setColorSchemeColors(Color.parseColor(fabSkin));
  mSwipeRefreshLayout.setProgressViewOffset(true,paddingTop,paddingTop + dpToPx(72));
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setHasOptionsMenu(false);
  mainActivity=(MainActivity)getActivity();
  utils=new Futils();
  String x=getSelectionColor();
  skinselection=Color.parseColor(x);
  color=calculatevalues(x);
  ColorMatrix colorMatrix=new ColorMatrix(calculatefilter(color));
  colorMatrixColorFilter=new ColorMatrixColorFilter(colorMatrix);
  history=new HistoryManager(getActivity(),"String_Node_Str");
  hidden=new HistoryManager(getActivity(),"String_Node_Str");
  hiddenfiles=hidden.readTable();
  rootMode=Sp.getBoolean("String_Node_Str",false);
  showHidden=Sp.getBoolean("String_Node_Str",false);
  coloriseIcons=Sp.getBoolean("String_Node_Str",false);
  if (islist) {
    folder=res.getDrawable(R.drawable.ic_grid_folder_new);
  }
 else {
    folder=res.getDrawable(R.drawable.ic_grid_folder1);
  }
  folder=res.getDrawable(R.drawable.ic_grid_folder_new);
  getSortModes();
  darkimage=res.getDrawable(R.drawable.ic_doc_image_dark);
  darkvideo=res.getDrawable(R.drawable.ic_doc_video_dark);
  this.setRetainInstance(false);
  File f;
  if (savepaths)   f=new File(current);
 else   f=new File(home);
  mainActivity.initiatebbar();
  scroll=(HorizontalScrollView)rootView.findViewById(R.id.scroll);
  scroll1=(HorizontalScrollView)rootView.findViewById(R.id.scroll1);
  footerView=getActivity().getLayoutInflater().inflate(R.layout.divider,null);
  mSwipeRefreshLayout=(SwipeRefreshLayout)rootView.findViewById(R.id.activity_main_swipe_refresh_layout);
  mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener(){
    @Override public void onRefresh(){
      loadlist(new File(current),false);
    }
  }
);
  mToolbarHeight=getToolbarHeight(getActivity());
  paddingTop=(mToolbarHeight) + dpToPx(72);
  if (hidemode == 2)   mToolbarHeight=paddingTop;
  mToolbarContainer.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
        mToolbarContainer.getViewTreeObserver().removeOnGlobalLayoutListener(this);
      }
 else {
        mToolbarContainer.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      }
      paddingTop=mToolbarContainer.getHeight();
      if (hidemode != 2)       mToolbarHeight=mainActivity.toolbar.getHeight();
    }
  }
);
  mSwipeRefreshLayout.setColorSchemeColors(Color.parseColor(fabSkin));
  mSwipeRefreshLayout.setProgressViewOffset(true,paddingTop,paddingTop + dpToPx(72));
  if (savedInstanceState == null) {
    if (Intentpath != null) {
      File file1=new File(Intentpath);
      if (file1.isDirectory()) {
        loadlist(file1,false);
      }
 else {
        utils.openFile(file1,mainActivity);
        loadlist(f,false);
      }
    }
 else {
      loadlist(f,false);
    }
  }
 else {
    Bundle b=new Bundle();
    String cur=savedInstanceState.getString("String_Node_Str");
    if (cur != null) {
      b.putInt("String_Node_Str",savedInstanceState.getInt("String_Node_Str"));
      b.putInt("String_Node_Str",savedInstanceState.getInt("String_Node_Str"));
      scrolls.put(cur,b);
      retreiveSmbFromSavedInstance(savedInstanceState);
      list=savedInstanceState.getParcelableArrayList("String_Node_Str");
      if (savedInstanceState.getBoolean("String_Node_Str")) {
        try {
          createViews(list,true,new File(current));
          ((TextView)ma.pathbar.findViewById(R.id.pathname)).setText(ma.utils.getString(ma.getActivity(),R.string.searchresults));
          results=true;
        }
 catch (        Exception e) {
        }
      }
 else {
        createViews(list,true,new File(cur));
      }
      if (savedInstanceState.getBoolean("String_Node_Str")) {
        for (        int i : savedInstanceState.getIntegerArrayList("String_Node_Str")) {
          adapter.toggleChecked(i);
        }
      }
    }
  }
}