Program: 162541
Project: 162541
Buggy source:
private void showPropertiesDialog(final BaseFile baseFile,final String permissions,BasicActivity basic,boolean isRoot,AppTheme appTheme,boolean showPermissions){
  final ExecutorService executor=Executors.newFixedThreadPool(3);
  final Context c=basic.getApplicationContext();
  int accentColor=basic.getColorPreference().getColor(ColorUsage.ACCENT);
  long last=baseFile.getDate();
  final String date=getDate(last), items=basic.getResources().getString(R.string.calculating), name=baseFile.getName(), parent=baseFile.getReadablePath(baseFile.getParent(c));
  SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(c);
  String fabskin=PreferenceUtils.getAccentString(sharedPrefs);
  MaterialDialog.Builder builder=new MaterialDialog.Builder(basic);
  builder.title(basic.getResources().getString(R.string.properties));
  builder.theme(appTheme.getMaterialDialogTheme());
  View v=basic.getLayoutInflater().inflate(R.layout.properties_dialog,null);
  TextView itemsText=(TextView)v.findViewById(R.id.t7);
{
    TextView mNameTitle=(TextView)v.findViewById(R.id.title_name);
    mNameTitle.setTextColor(accentColor);
    TextView mDateTitle=(TextView)v.findViewById(R.id.title_date);
    mDateTitle.setTextColor(accentColor);
    TextView mSizeTitle=(TextView)v.findViewById(R.id.title_size);
    mSizeTitle.setTextColor(accentColor);
    TextView mLocationTitle=(TextView)v.findViewById(R.id.title_location);
    mLocationTitle.setTextColor(accentColor);
    TextView md5Title=(TextView)v.findViewById(R.id.title_md5);
    md5Title.setTextColor(accentColor);
    TextView sha256Title=(TextView)v.findViewById(R.id.title_sha256);
    sha256Title.setTextColor(accentColor);
    ((TextView)v.findViewById(R.id.t5)).setText(name);
    ((TextView)v.findViewById(R.id.t6)).setText(parent);
    itemsText.setText(items);
    ((TextView)v.findViewById(R.id.t8)).setText(date);
    LinearLayout mNameLinearLayout=(LinearLayout)v.findViewById(R.id.properties_dialog_name);
    LinearLayout mLocationLinearLayout=(LinearLayout)v.findViewById(R.id.properties_dialog_location);
    LinearLayout mSizeLinearLayout=(LinearLayout)v.findViewById(R.id.properties_dialog_size);
    LinearLayout mDateLinearLayout=(LinearLayout)v.findViewById(R.id.properties_dialog_date);
    mNameLinearLayout.setOnLongClickListener(new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        Futils.copyToClipboard(c,name);
        Toast.makeText(c,c.getResources().getString(R.string.name) + "String_Node_Str" + c.getResources().getString(R.string.properties_copied_clipboard),Toast.LENGTH_SHORT).show();
        return false;
      }
    }
);
    mLocationLinearLayout.setOnLongClickListener(new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        Futils.copyToClipboard(c,parent);
        Toast.makeText(c,c.getResources().getString(R.string.location) + "String_Node_Str" + c.getResources().getString(R.string.properties_copied_clipboard),Toast.LENGTH_SHORT).show();
        return false;
      }
    }
);
    mSizeLinearLayout.setOnLongClickListener(new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        Futils.copyToClipboard(c,items);
        Toast.makeText(c,c.getResources().getString(R.string.size) + "String_Node_Str" + c.getResources().getString(R.string.properties_copied_clipboard),Toast.LENGTH_SHORT).show();
        return false;
      }
    }
);
    mDateLinearLayout.setOnLongClickListener(new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        Futils.copyToClipboard(c,date);
        Toast.makeText(c,c.getResources().getString(R.string.date) + "String_Node_Str" + c.getResources().getString(R.string.properties_copied_clipboard),Toast.LENGTH_SHORT).show();
        return false;
      }
    }
);
  }
  CountFolderItems countFolderItems=new CountFolderItems(c,itemsText,baseFile);
  countFolderItems.executeOnExecutor(executor);
  GenerateHashes hashGen=new GenerateHashes(baseFile,c,v);
  hashGen.executeOnExecutor(executor);
{
    PieChart chart=(PieChart)v.findViewById(R.id.chart);
    chart.setTouchEnabled(false);
    chart.setDrawEntryLabels(false);
    chart.setDescription(null);
    chart.setNoDataText(c.getString(R.string.loading));
    chart.getLegend().setEnabled(true);
    chart.getLegend().setForm(Legend.LegendForm.CIRCLE);
    chart.getLegend().setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
    chart.getLegend().setTypeface(Typeface.create("String_Node_Str",Typeface.NORMAL));
    chart.animateY(1000);
    chart.invalidate();
    LoadFolderSpaceData loadFolderSpaceData=new LoadFolderSpaceData(c,chart,baseFile);
    loadFolderSpaceData.executeOnExecutor(executor);
  }
  if (showPermissions) {
    final MainFragment main=((MainActivity)basic).mainFragment;
    AppCompatButton appCompatButton=(AppCompatButton)v.findViewById(R.id.permissionsButton);
    appCompatButton.setAllCaps(true);
    final View permissionsTable=v.findViewById(R.id.permtable);
    final View button=v.findViewById(R.id.set);
    if (isRoot && permissions.length() > 6) {
      appCompatButton.setVisibility(View.VISIBLE);
      appCompatButton.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          if (permissionsTable.getVisibility() == View.GONE) {
            permissionsTable.setVisibility(View.VISIBLE);
            button.setVisibility(View.VISIBLE);
            setPermissionsDialog(permissionsTable,button,baseFile,permissions,c,main);
          }
 else {
            button.setVisibility(View.GONE);
            permissionsTable.setVisibility(View.GONE);
          }
        }
      }
);
    }
  }
  builder.customView(v,true);
  builder.positiveText(basic.getResources().getString(R.string.ok));
  builder.positiveColor(Color.parseColor(fabskin));
  builder.dismissListener(new DialogInterface.OnDismissListener(){
    @Override public void onDismiss(    DialogInterface dialog){
      executor.shutdown();
    }
  }
);
  MaterialDialog materialDialog=builder.build();
  materialDialog.show();
  materialDialog.getActionButton(DialogAction.NEGATIVE).setEnabled(false);
}

Fixed version (ground truth):
private void showPropertiesDialog(final BaseFile baseFile,final String permissions,BasicActivity basic,boolean isRoot,AppTheme appTheme,boolean showPermissions){
  final ExecutorService executor=Executors.newFixedThreadPool(3);
  final Context c=basic.getApplicationContext();
  int accentColor=basic.getColorPreference().getColor(ColorUsage.ACCENT);
  long last=baseFile.getDate();
  final String date=getDate(last), items=basic.getResources().getString(R.string.calculating), name=baseFile.getName(), parent=baseFile.getReadablePath(baseFile.getParent(c));
  SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(c);
  String fabskin=PreferenceUtils.getAccentString(sharedPrefs);
  MaterialDialog.Builder builder=new MaterialDialog.Builder(basic);
  builder.title(basic.getResources().getString(R.string.properties));
  builder.theme(appTheme.getMaterialDialogTheme());
  View v=basic.getLayoutInflater().inflate(R.layout.properties_dialog,null);
  TextView itemsText=(TextView)v.findViewById(R.id.t7);
{
    TextView mNameTitle=(TextView)v.findViewById(R.id.title_name);
    mNameTitle.setTextColor(accentColor);
    TextView mDateTitle=(TextView)v.findViewById(R.id.title_date);
    mDateTitle.setTextColor(accentColor);
    TextView mSizeTitle=(TextView)v.findViewById(R.id.title_size);
    mSizeTitle.setTextColor(accentColor);
    TextView mLocationTitle=(TextView)v.findViewById(R.id.title_location);
    mLocationTitle.setTextColor(accentColor);
    TextView md5Title=(TextView)v.findViewById(R.id.title_md5);
    md5Title.setTextColor(accentColor);
    TextView sha256Title=(TextView)v.findViewById(R.id.title_sha256);
    sha256Title.setTextColor(accentColor);
    ((TextView)v.findViewById(R.id.t5)).setText(name);
    ((TextView)v.findViewById(R.id.t6)).setText(parent);
    itemsText.setText(items);
    ((TextView)v.findViewById(R.id.t8)).setText(date);
    LinearLayout mNameLinearLayout=(LinearLayout)v.findViewById(R.id.properties_dialog_name);
    LinearLayout mLocationLinearLayout=(LinearLayout)v.findViewById(R.id.properties_dialog_location);
    LinearLayout mSizeLinearLayout=(LinearLayout)v.findViewById(R.id.properties_dialog_size);
    LinearLayout mDateLinearLayout=(LinearLayout)v.findViewById(R.id.properties_dialog_date);
    mNameLinearLayout.setOnLongClickListener(new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        Futils.copyToClipboard(c,name);
        Toast.makeText(c,c.getResources().getString(R.string.name) + "String_Node_Str" + c.getResources().getString(R.string.properties_copied_clipboard),Toast.LENGTH_SHORT).show();
        return false;
      }
    }
);
    mLocationLinearLayout.setOnLongClickListener(new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        Futils.copyToClipboard(c,parent);
        Toast.makeText(c,c.getResources().getString(R.string.location) + "String_Node_Str" + c.getResources().getString(R.string.properties_copied_clipboard),Toast.LENGTH_SHORT).show();
        return false;
      }
    }
);
    mSizeLinearLayout.setOnLongClickListener(new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        Futils.copyToClipboard(c,items);
        Toast.makeText(c,c.getResources().getString(R.string.size) + "String_Node_Str" + c.getResources().getString(R.string.properties_copied_clipboard),Toast.LENGTH_SHORT).show();
        return false;
      }
    }
);
    mDateLinearLayout.setOnLongClickListener(new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View v){
        Futils.copyToClipboard(c,date);
        Toast.makeText(c,c.getResources().getString(R.string.date) + "String_Node_Str" + c.getResources().getString(R.string.properties_copied_clipboard),Toast.LENGTH_SHORT).show();
        return false;
      }
    }
);
  }
  CountFolderItems countFolderItems=new CountFolderItems(c,itemsText,baseFile);
  countFolderItems.executeOnExecutor(executor);
  GenerateHashes hashGen=new GenerateHashes(baseFile,c,v);
  hashGen.executeOnExecutor(executor);
{
    PieChart chart=(PieChart)v.findViewById(R.id.chart);
    chart.setTouchEnabled(false);
    chart.setDrawEntryLabels(false);
    chart.setDescription(null);
    chart.setNoDataText(c.getString(R.string.loading));
    chart.setRotationAngle(0f);
    chart.getLegend().setEnabled(true);
    chart.getLegend().setForm(Legend.LegendForm.CIRCLE);
    chart.getLegend().setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
    chart.getLegend().setTypeface(Typeface.create("String_Node_Str",Typeface.NORMAL));
    chart.animateY(1000);
    chart.invalidate();
    LoadFolderSpaceData loadFolderSpaceData=new LoadFolderSpaceData(c,chart,baseFile);
    loadFolderSpaceData.executeOnExecutor(executor);
  }
  if (showPermissions) {
    final MainFragment main=((MainActivity)basic).mainFragment;
    AppCompatButton appCompatButton=(AppCompatButton)v.findViewById(R.id.permissionsButton);
    appCompatButton.setAllCaps(true);
    final View permissionsTable=v.findViewById(R.id.permtable);
    final View button=v.findViewById(R.id.set);
    if (isRoot && permissions.length() > 6) {
      appCompatButton.setVisibility(View.VISIBLE);
      appCompatButton.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          if (permissionsTable.getVisibility() == View.GONE) {
            permissionsTable.setVisibility(View.VISIBLE);
            button.setVisibility(View.VISIBLE);
            setPermissionsDialog(permissionsTable,button,baseFile,permissions,c,main);
          }
 else {
            button.setVisibility(View.GONE);
            permissionsTable.setVisibility(View.GONE);
          }
        }
      }
);
    }
  }
  builder.customView(v,true);
  builder.positiveText(basic.getResources().getString(R.string.ok));
  builder.positiveColor(Color.parseColor(fabskin));
  builder.dismissListener(new DialogInterface.OnDismissListener(){
    @Override public void onDismiss(    DialogInterface dialog){
      executor.shutdown();
    }
  }
);
  MaterialDialog materialDialog=builder.build();
  materialDialog.show();
  materialDialog.getActionButton(DialogAction.NEGATIVE).setEnabled(false);
}