Program: 162558
Project: 162558
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Sp=PreferenceManager.getDefaultSharedPreferences(this);
  fabSkin=PreferenceUtils.getFabColor(Sp.getInt("String_Node_Str",1));
  theme=Integer.parseInt(Sp.getString("String_Node_Str","String_Node_Str"));
  theme1=theme == 2 ? PreferenceUtils.hourOfDay() : theme;
  nodes=new ArrayList<>();
  it=nodes.listIterator();
  if (Build.VERSION.SDK_INT >= 21) {
switch (fabSkin) {
case "String_Node_Str":
      if (theme1 == 0)       setTheme(R.style.pref_accent_light_red);
 else       setTheme(R.style.pref_accent_dark_red);
    break;
case "String_Node_Str":
  if (theme1 == 0)   setTheme(R.style.pref_accent_light_pink);
 else   setTheme(R.style.pref_accent_dark_pink);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_purple);
 else setTheme(R.style.pref_accent_dark_purple);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_deep_purple);
 else setTheme(R.style.pref_accent_dark_deep_purple);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_indigo);
 else setTheme(R.style.pref_accent_dark_indigo);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_blue);
 else setTheme(R.style.pref_accent_dark_blue);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_light_blue);
 else setTheme(R.style.pref_accent_dark_light_blue);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_cyan);
 else setTheme(R.style.pref_accent_dark_cyan);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_teal);
 else setTheme(R.style.pref_accent_dark_teal);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_green);
 else setTheme(R.style.pref_accent_dark_green);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_light_green);
 else setTheme(R.style.pref_accent_dark_light_green);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_amber);
 else setTheme(R.style.pref_accent_dark_amber);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_orange);
 else setTheme(R.style.pref_accent_dark_orange);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_deep_orange);
 else setTheme(R.style.pref_accent_dark_deep_orange);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_brown);
 else setTheme(R.style.pref_accent_dark_brown);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_black);
 else setTheme(R.style.pref_accent_dark_black);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_blue_grey);
 else setTheme(R.style.pref_accent_dark_blue_grey);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_super_su);
 else setTheme(R.style.pref_accent_dark_super_su);
break;
}
}
 else {
if (theme1 == 1) {
setTheme(R.style.appCompatDark);
}
 else {
setTheme(R.style.appCompatLight);
}
}
if (theme1 == 1) {
getWindow().getDecorView().setBackgroundColor(getResources().getColor(R.color.holo_dark_background));
}
setContentView(R.layout.search);
toolbar=(android.support.v7.widget.Toolbar)findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
skin=PreferenceUtils.getSkinColor(Sp.getInt("String_Node_Str",4));
if (Build.VERSION.SDK_INT >= 21) {
ActivityManager.TaskDescription taskDescription=new ActivityManager.TaskDescription("String_Node_Str",((BitmapDrawable)getResources().getDrawable(R.mipmap.ic_launcher)).getBitmap(),Color.parseColor(skin));
((Activity)this).setTaskDescription(taskDescription);
}
skinStatusBar=PreferenceUtils.getStatusColor(skin);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(skin)));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
rootMode=PreferenceManager.getDefaultSharedPreferences(c).getBoolean("String_Node_Str",false);
int sdk=Build.VERSION.SDK_INT;
if (sdk == 20 || sdk == 19) {
SystemBarTintManager tintManager=new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintColor(Color.parseColor(skin));
FrameLayout.MarginLayoutParams p=(ViewGroup.MarginLayoutParams)findViewById(R.id.texteditor).getLayoutParams();
SystemBarTintManager.SystemBarConfig config=tintManager.getConfig();
p.setMargins(0,config.getStatusBarHeight(),0,0);
}
 else if (Build.VERSION.SDK_INT >= 21) {
boolean colourednavigation=Sp.getBoolean("String_Node_Str",true);
Window window=getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor((PreferenceUtils.getStatusColor(skin)));
if (colourednavigation) window.setNavigationBarColor((PreferenceUtils.getStatusColor(skin)));
}
mInput=(EditText)findViewById(R.id.fname);
try {
if (getIntent().getData() != null) mFile=new File(getIntent().getData().getPath());
 else mFile=new File(getIntent().getStringExtra("String_Node_Str"));
}
 catch (Exception e) {
mFile=null;
}
mInput.addTextChangedListener(this);
try {
if (theme1 == 1) mInput.setBackgroundColor(getResources().getColor(R.color.holo_dark_background));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 catch (Exception e) {
}
setTitle(mFile.getName());
load(mFile);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Sp=PreferenceManager.getDefaultSharedPreferences(this);
  fabSkin=PreferenceUtils.getFabColor(Sp.getInt("String_Node_Str",1));
  theme=Integer.parseInt(Sp.getString("String_Node_Str","String_Node_Str"));
  theme1=theme == 2 ? PreferenceUtils.hourOfDay() : theme;
  nodes=new ArrayList<>();
  if (Build.VERSION.SDK_INT >= 21) {
switch (fabSkin) {
case "String_Node_Str":
      if (theme1 == 0)       setTheme(R.style.pref_accent_light_red);
 else       setTheme(R.style.pref_accent_dark_red);
    break;
case "String_Node_Str":
  if (theme1 == 0)   setTheme(R.style.pref_accent_light_pink);
 else   setTheme(R.style.pref_accent_dark_pink);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_purple);
 else setTheme(R.style.pref_accent_dark_purple);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_deep_purple);
 else setTheme(R.style.pref_accent_dark_deep_purple);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_indigo);
 else setTheme(R.style.pref_accent_dark_indigo);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_blue);
 else setTheme(R.style.pref_accent_dark_blue);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_light_blue);
 else setTheme(R.style.pref_accent_dark_light_blue);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_cyan);
 else setTheme(R.style.pref_accent_dark_cyan);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_teal);
 else setTheme(R.style.pref_accent_dark_teal);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_green);
 else setTheme(R.style.pref_accent_dark_green);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_light_green);
 else setTheme(R.style.pref_accent_dark_light_green);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_amber);
 else setTheme(R.style.pref_accent_dark_amber);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_orange);
 else setTheme(R.style.pref_accent_dark_orange);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_deep_orange);
 else setTheme(R.style.pref_accent_dark_deep_orange);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_brown);
 else setTheme(R.style.pref_accent_dark_brown);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_black);
 else setTheme(R.style.pref_accent_dark_black);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_blue_grey);
 else setTheme(R.style.pref_accent_dark_blue_grey);
break;
case "String_Node_Str":
if (theme1 == 0) setTheme(R.style.pref_accent_light_super_su);
 else setTheme(R.style.pref_accent_dark_super_su);
break;
}
}
 else {
if (theme1 == 1) {
setTheme(R.style.appCompatDark);
}
 else {
setTheme(R.style.appCompatLight);
}
}
if (theme1 == 1) {
getWindow().getDecorView().setBackgroundColor(getResources().getColor(R.color.holo_dark_background));
}
setContentView(R.layout.search);
toolbar=(android.support.v7.widget.Toolbar)findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
skin=PreferenceUtils.getSkinColor(Sp.getInt("String_Node_Str",4));
if (Build.VERSION.SDK_INT >= 21) {
ActivityManager.TaskDescription taskDescription=new ActivityManager.TaskDescription("String_Node_Str",((BitmapDrawable)getResources().getDrawable(R.mipmap.ic_launcher)).getBitmap(),Color.parseColor(skin));
((Activity)this).setTaskDescription(taskDescription);
}
skinStatusBar=PreferenceUtils.getStatusColor(skin);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(skin)));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
rootMode=PreferenceManager.getDefaultSharedPreferences(c).getBoolean("String_Node_Str",false);
int sdk=Build.VERSION.SDK_INT;
if (sdk == 20 || sdk == 19) {
SystemBarTintManager tintManager=new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintColor(Color.parseColor(skin));
FrameLayout.MarginLayoutParams p=(ViewGroup.MarginLayoutParams)findViewById(R.id.texteditor).getLayoutParams();
SystemBarTintManager.SystemBarConfig config=tintManager.getConfig();
p.setMargins(0,config.getStatusBarHeight(),0,0);
}
 else if (Build.VERSION.SDK_INT >= 21) {
boolean colourednavigation=Sp.getBoolean("String_Node_Str",true);
Window window=getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor((PreferenceUtils.getStatusColor(skin)));
if (colourednavigation) window.setNavigationBarColor((PreferenceUtils.getStatusColor(skin)));
}
mInput=(EditText)findViewById(R.id.fname);
try {
if (getIntent().getData() != null) mFile=new File(getIntent().getData().getPath());
 else mFile=new File(getIntent().getStringExtra("String_Node_Str"));
}
 catch (Exception e) {
mFile=null;
}
mInput.addTextChangedListener(this);
try {
if (theme1 == 1) mInput.setBackgroundColor(getResources().getColor(R.color.holo_dark_background));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 catch (Exception e) {
}
setTitle(mFile.getName());
load(mFile);
}