Program: 86316
Project: 86316
Buggy source:
@Override public void accountSelected(Account account){
  view.findViewById(R.id.svAccount).setVisibility(View.GONE);
  view.findViewById(R.id.unsupported_error).setVisibility(View.GONE);
  view.findViewById(R.id.answer_error).setVisibility(View.GONE);
  ((FrameLayout)view.findViewById(R.id.error_view)).removeAllViews();
  view.findViewById(R.id.llLoading).setVisibility(View.VISIBLE);
  refreshing=false;
  supported=true;
  account=app.getAccount();
  if (!app.getApi().isAccountSupported(app.getLibrary()) && (app.getApi().getSupportFlags() & OpacApi.SUPPORT_FLAG_ACCOUNT_EXTENDABLE) == 0) {
    supported=false;
    view.findViewById(R.id.llLoading).setVisibility(View.GONE);
    view.findViewById(R.id.unsupported_error).setVisibility(View.VISIBLE);
    ((TextView)view.findViewById(R.id.tvErrBodyU)).setText(R.string.account_unsupported_api);
    ((Button)view.findViewById(R.id.btSend)).setText(R.string.write_mail);
    ((Button)view.findViewById(R.id.btSend)).setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        Intent emailIntent=new Intent(android.content.Intent.ACTION_SEND);
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[]{"String_Node_Str"});
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"String_Node_Str" + app.getLibrary().getIdent());
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"String_Node_Str");
        emailIntent.setType("String_Node_Str");
        startActivity(Intent.createChooser(emailIntent,getString(R.string.write_mail)));
      }
    }
);
  }
 else   if (!app.getApi().isAccountSupported(app.getLibrary())) {
    supported=false;
    view.findViewById(R.id.llLoading).setVisibility(View.GONE);
    view.findViewById(R.id.unsupported_error).setVisibility(View.VISIBLE);
    ((TextView)view.findViewById(R.id.tvErrBodyU)).setText(R.string.account_unsupported);
    ((Button)view.findViewById(R.id.btSend)).setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        dialog=ProgressDialog.show(getActivity(),"String_Node_Str",getString(R.string.report_sending),true,true,new OnCancelListener(){
          @Override public void onCancel(          DialogInterface arg0){
          }
        }
);
        dialog.show();
        new SendTask().execute(this);
      }
    }
);
  }
 else   if (account.getPassword() == null || account.getPassword().equals("String_Node_Str") || account.getPassword().equals("String_Node_Str") || account.getName() == null || account.getName().equals("String_Node_Str") || account.getName().equals("String_Node_Str")) {
    view.findViewById(R.id.llLoading).setVisibility(View.GONE);
    view.findViewById(R.id.answer_error).setVisibility(View.VISIBLE);
    ((Button)view.findViewById(R.id.btPrefs)).setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        Intent intent=new Intent(getActivity(),AccountEditActivity.class);
        intent.putExtra(AccountEditActivity.EXTRA_ACCOUNT_ID,app.getAccount().getId());
        startActivity(intent);
      }
    }
);
    ((TextView)view.findViewById(R.id.tvErrHeadA)).setText("String_Node_Str");
    ((TextView)view.findViewById(R.id.tvErrBodyA)).setText(R.string.status_nouser);
  }
 else {
    AccountDataSource adatasource=new AccountDataSource(getActivity());
    adatasource.open();
    refreshtime=adatasource.getCachedAccountDataTime(account);
    if (refreshtime > 0) {
      displaydata(adatasource.getCachedAccountData(account),true);
      if (System.currentTimeMillis() - refreshtime > MAX_CACHE_AGE) {
        refresh();
      }
    }
 else {
      refresh();
    }
    adatasource.close();
  }
  getActivity().supportInvalidateOptionsMenu();
}

Fixed version (ground truth):
@Override public void accountSelected(Account account){
  view.findViewById(R.id.svAccount).setVisibility(View.GONE);
  view.findViewById(R.id.unsupported_error).setVisibility(View.GONE);
  view.findViewById(R.id.answer_error).setVisibility(View.GONE);
  ((FrameLayout)view.findViewById(R.id.error_view)).removeAllViews();
  view.findViewById(R.id.llLoading).setVisibility(View.VISIBLE);
  refreshing=false;
  supported=true;
  this.account=app.getAccount();
  if (!app.getApi().isAccountSupported(app.getLibrary()) && (app.getApi().getSupportFlags() & OpacApi.SUPPORT_FLAG_ACCOUNT_EXTENDABLE) == 0) {
    supported=false;
    view.findViewById(R.id.llLoading).setVisibility(View.GONE);
    view.findViewById(R.id.unsupported_error).setVisibility(View.VISIBLE);
    ((TextView)view.findViewById(R.id.tvErrBodyU)).setText(R.string.account_unsupported_api);
    ((Button)view.findViewById(R.id.btSend)).setText(R.string.write_mail);
    ((Button)view.findViewById(R.id.btSend)).setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        Intent emailIntent=new Intent(android.content.Intent.ACTION_SEND);
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[]{"String_Node_Str"});
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"String_Node_Str" + app.getLibrary().getIdent());
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"String_Node_Str");
        emailIntent.setType("String_Node_Str");
        startActivity(Intent.createChooser(emailIntent,getString(R.string.write_mail)));
      }
    }
);
  }
 else   if (!app.getApi().isAccountSupported(app.getLibrary())) {
    supported=false;
    view.findViewById(R.id.llLoading).setVisibility(View.GONE);
    view.findViewById(R.id.unsupported_error).setVisibility(View.VISIBLE);
    ((TextView)view.findViewById(R.id.tvErrBodyU)).setText(R.string.account_unsupported);
    ((Button)view.findViewById(R.id.btSend)).setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        dialog=ProgressDialog.show(getActivity(),"String_Node_Str",getString(R.string.report_sending),true,true,new OnCancelListener(){
          @Override public void onCancel(          DialogInterface arg0){
          }
        }
);
        dialog.show();
        new SendTask().execute(this);
      }
    }
);
  }
 else   if (account.getPassword() == null || account.getPassword().equals("String_Node_Str") || account.getPassword().equals("String_Node_Str") || account.getName() == null || account.getName().equals("String_Node_Str") || account.getName().equals("String_Node_Str")) {
    view.findViewById(R.id.llLoading).setVisibility(View.GONE);
    view.findViewById(R.id.answer_error).setVisibility(View.VISIBLE);
    ((Button)view.findViewById(R.id.btPrefs)).setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        Intent intent=new Intent(getActivity(),AccountEditActivity.class);
        intent.putExtra(AccountEditActivity.EXTRA_ACCOUNT_ID,app.getAccount().getId());
        startActivity(intent);
      }
    }
);
    ((TextView)view.findViewById(R.id.tvErrHeadA)).setText("String_Node_Str");
    ((TextView)view.findViewById(R.id.tvErrBodyA)).setText(R.string.status_nouser);
  }
 else {
    AccountDataSource adatasource=new AccountDataSource(getActivity());
    adatasource.open();
    refreshtime=adatasource.getCachedAccountDataTime(account);
    if (refreshtime > 0) {
      displaydata(adatasource.getCachedAccountData(account),true);
      if (System.currentTimeMillis() - refreshtime > MAX_CACHE_AGE) {
        refresh();
      }
    }
 else {
      refresh();
    }
    adatasource.close();
  }
  getActivity().supportInvalidateOptionsMenu();
}