Program: 32207
Project: 32207
Buggy source:
@Override public void onClick(View v){
  String text=(String)((Button)v).getText();
  final View refreshingView=findViewById(R.id.profile_mask);
  final ApiCallback callback=new SimpleApiCallback<Void>(MemberDetailsActivity.this){
    @Override public void onMatrixError(    MatrixError e){
      if (MatrixError.FORBIDDEN.equals(e.errcode)) {
        Toast.makeText(MemberDetailsActivity.this,e.error,Toast.LENGTH_LONG).show();
      }
      MemberDetailsActivity.this.refresh();
    }
    @Override public void onSuccess(    Void info){
      MemberDetailsActivity.this.refresh();
    }
  }
;
  for (  Button button : mButtonsList) {
    button.setEnabled(false);
  }
  if (text.equals(getResources().getString(R.string.kick))) {
    refreshingView.setVisibility(View.VISIBLE);
    mRoom.kick(mMember.getUserId(),callback);
  }
 else   if (text.equals(getResources().getString(R.string.ban))) {
    refreshingView.setVisibility(View.VISIBLE);
    mRoom.ban(mMember.getUserId(),null,callback);
  }
 else   if (text.equals(getResources().getString(R.string.unban))) {
    refreshingView.setVisibility(View.VISIBLE);
    mRoom.unban(mMember.getUserId(),callback);
  }
 else   if (text.equals(getResources().getString(R.string.invite))) {
    refreshingView.setVisibility(View.VISIBLE);
    mRoom.invite(mMember.getUserId(),callback);
  }
 else   if (text.equals(getResources().getString(R.string.chat))) {
    refreshingView.setVisibility(View.VISIBLE);
    MemberDetailsActivity.this.runOnUiThread(new Runnable(){
      @Override public void run(){
        CommonActivityUtils.goToOneToOneRoom(mMemberId,MemberDetailsActivity.this,new SimpleApiCallback<Void>(MemberDetailsActivity.this){
          @Override public void onMatrixError(          MatrixError e){
            if (MatrixError.FORBIDDEN.equals(e.errcode)) {
              Toast.makeText(MemberDetailsActivity.this,e.error,Toast.LENGTH_LONG).show();
            }
            MemberDetailsActivity.this.refresh();
          }
          @Override public void onNetworkError(          Exception e){
            Toast.makeText(MemberDetailsActivity.this,e.getLocalizedMessage(),Toast.LENGTH_LONG).show();
            MemberDetailsActivity.this.refresh();
          }
          @Override public void onUnexpectedError(          Exception e){
            Toast.makeText(MemberDetailsActivity.this,e.getLocalizedMessage(),Toast.LENGTH_LONG).show();
            MemberDetailsActivity.this.refresh();
          }
        }
);
      }
    }
);
  }
 else   if (text.equals(getResources().getString(R.string.set_power_level))) {
    String title=getResources().getString(R.string.set_power_level);
    String initText=mRoom.getLiveState().getPowerLevels().getUserPowerLevel(mMemberId) + "String_Node_Str";
    final AlertDialog alert=CommonActivityUtils.createEditTextAlert(MemberDetailsActivity.this,title,null,initText,new CommonActivityUtils.OnSubmitListener(){
      @Override public void onSubmit(      String text){
        if (text.length() == 0) {
          return;
        }
        int newPowerLevel=-1;
        try {
          newPowerLevel=Integer.parseInt(text);
        }
 catch (        Exception e) {
        }
        if (newPowerLevel >= 0) {
          refreshingView.setVisibility(View.VISIBLE);
          mRoom.updateUserPowerLevels(mMember.getUserId(),newPowerLevel,callback);
        }
 else {
          MemberDetailsActivity.this.refresh();
        }
      }
      @Override public void onCancelled(){
        MemberDetailsActivity.this.refresh();
      }
    }
);
    MemberDetailsActivity.this.runOnUiThread(new Runnable(){
      @Override public void run(){
        alert.show();
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  String text=(String)((Button)v).getText();
  final View refreshingView=findViewById(R.id.profile_mask);
  final ApiCallback callback=new SimpleApiCallback<Void>(MemberDetailsActivity.this){
    @Override public void onMatrixError(    MatrixError e){
      if (MatrixError.FORBIDDEN.equals(e.errcode)) {
        Toast.makeText(MemberDetailsActivity.this,e.error,Toast.LENGTH_LONG).show();
      }
      MemberDetailsActivity.this.refresh();
    }
    @Override public void onSuccess(    Void info){
      MemberDetailsActivity.this.refresh();
    }
  }
;
  for (  Button button : mButtonsList) {
    button.setEnabled(false);
  }
  if (text.equals(getResources().getString(R.string.kick))) {
    refreshingView.setVisibility(View.VISIBLE);
    mRoom.kick(mMember.getUserId(),callback);
  }
 else   if (text.equals(getResources().getString(R.string.ban))) {
    refreshingView.setVisibility(View.VISIBLE);
    mRoom.ban(mMember.getUserId(),null,callback);
  }
 else   if (text.equals(getResources().getString(R.string.unban))) {
    refreshingView.setVisibility(View.VISIBLE);
    mRoom.unban(mMember.getUserId(),callback);
  }
 else   if (text.equals(getResources().getString(R.string.invite))) {
    refreshingView.setVisibility(View.VISIBLE);
    mRoom.invite(mMember.getUserId(),callback);
  }
 else   if (text.equals(getResources().getString(R.string.chat))) {
    refreshingView.setVisibility(View.VISIBLE);
    MemberDetailsActivity.this.runOnUiThread(new Runnable(){
      @Override public void run(){
        CommonActivityUtils.goToOneToOneRoom(mSession,mMemberId,MemberDetailsActivity.this,new SimpleApiCallback<Void>(MemberDetailsActivity.this){
          @Override public void onMatrixError(          MatrixError e){
            if (MatrixError.FORBIDDEN.equals(e.errcode)) {
              Toast.makeText(MemberDetailsActivity.this,e.error,Toast.LENGTH_LONG).show();
            }
            MemberDetailsActivity.this.refresh();
          }
          @Override public void onNetworkError(          Exception e){
            Toast.makeText(MemberDetailsActivity.this,e.getLocalizedMessage(),Toast.LENGTH_LONG).show();
            MemberDetailsActivity.this.refresh();
          }
          @Override public void onUnexpectedError(          Exception e){
            Toast.makeText(MemberDetailsActivity.this,e.getLocalizedMessage(),Toast.LENGTH_LONG).show();
            MemberDetailsActivity.this.refresh();
          }
        }
);
      }
    }
);
  }
 else   if (text.equals(getResources().getString(R.string.set_power_level))) {
    String title=getResources().getString(R.string.set_power_level);
    String initText=mRoom.getLiveState().getPowerLevels().getUserPowerLevel(mMemberId) + "String_Node_Str";
    final AlertDialog alert=CommonActivityUtils.createEditTextAlert(MemberDetailsActivity.this,title,null,initText,new CommonActivityUtils.OnSubmitListener(){
      @Override public void onSubmit(      String text){
        if (text.length() == 0) {
          return;
        }
        int newPowerLevel=-1;
        try {
          newPowerLevel=Integer.parseInt(text);
        }
 catch (        Exception e) {
        }
        if (newPowerLevel >= 0) {
          refreshingView.setVisibility(View.VISIBLE);
          mRoom.updateUserPowerLevels(mMember.getUserId(),newPowerLevel,callback);
        }
 else {
          MemberDetailsActivity.this.refresh();
        }
      }
      @Override public void onCancelled(){
        MemberDetailsActivity.this.refresh();
      }
    }
);
    MemberDetailsActivity.this.runOnUiThread(new Runnable(){
      @Override public void run(){
        alert.show();
      }
    }
);
  }
}