Program: 162439
Project: 162439
Buggy source:
public static void mkfile(@NonNull final HybridFile file,final Context context,final boolean rootMode,@NonNull final ErrorCallBack errorCallBack){
  new AsyncTask<Void,Void,Void>(){
    private DataUtils dataUtils=DataUtils.getInstance();
    @Override protected Void doInBackground(    Void... params){
      if (!Operations.isFileNameValid(file.getName(context))) {
        errorCallBack.invalidName(file);
        return null;
      }
      if (file.exists()) {
        errorCallBack.exists(file);
        return null;
      }
      if (file.isSftp()) {
        OutputStream out=file.getOutputStream(context);
        try {
          out.close();
          errorCallBack.done(file,true);
          return null;
        }
 catch (        IOException e) {
          errorCallBack.done(file,false);
          return null;
        }
      }
      if (file.isSmb()) {
        try {
          file.getSmbFile(2000).createNewFile();
        }
 catch (        SmbException e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
          return null;
        }
        errorCallBack.done(file,file.exists());
        return null;
      }
 else       if (file.isDropBoxFile()) {
        CloudStorage cloudStorageDropbox=dataUtils.getAccount(OpenMode.DROPBOX);
        try {
          byte[] tempBytes=new byte[0];
          ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(tempBytes);
          cloudStorageDropbox.upload(CloudUtil.stripPath(OpenMode.DROPBOX,file.getPath()),byteArrayInputStream,0l,true);
          errorCallBack.done(file,true);
        }
 catch (        Exception e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
        }
      }
 else       if (file.isBoxFile()) {
        CloudStorage cloudStorageBox=dataUtils.getAccount(OpenMode.BOX);
        try {
          byte[] tempBytes=new byte[0];
          ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(tempBytes);
          cloudStorageBox.upload(CloudUtil.stripPath(OpenMode.BOX,file.getPath()),byteArrayInputStream,0l,true);
          errorCallBack.done(file,true);
        }
 catch (        Exception e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
        }
      }
 else       if (file.isOneDriveFile()) {
        CloudStorage cloudStorageOneDrive=dataUtils.getAccount(OpenMode.ONEDRIVE);
        try {
          byte[] tempBytes=new byte[0];
          ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(tempBytes);
          cloudStorageOneDrive.upload(CloudUtil.stripPath(OpenMode.ONEDRIVE,file.getPath()),byteArrayInputStream,0l,true);
          errorCallBack.done(file,true);
        }
 catch (        Exception e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
        }
      }
 else       if (file.isGoogleDriveFile()) {
        CloudStorage cloudStorageGdrive=dataUtils.getAccount(OpenMode.GDRIVE);
        try {
          byte[] tempBytes=new byte[0];
          ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(tempBytes);
          cloudStorageGdrive.upload(CloudUtil.stripPath(OpenMode.GDRIVE,file.getPath()),byteArrayInputStream,0l,true);
          errorCallBack.done(file,true);
        }
 catch (        Exception e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
        }
      }
 else       if (file.isOtgFile()) {
        DocumentFile fileToCreate=OTGUtil.getDocumentFile(file.getPath(),context,false);
        if (fileToCreate != null)         errorCallBack.exists(file);
        DocumentFile parentDirectory=OTGUtil.getDocumentFile(file.getParent(),context,false);
        if (parentDirectory.isDirectory()) {
          parentDirectory.createFile(file.getName(context).substring(file.getName().lastIndexOf("String_Node_Str")),file.getName(context));
          errorCallBack.done(file,true);
        }
 else         errorCallBack.done(file,false);
        return null;
      }
 else {
        if (file.isLocal() || file.isRoot()) {
          int mode=checkFolder(new File(file.getParent()),context);
          if (mode == 2) {
            errorCallBack.launchSAF(file);
            return null;
          }
          if (mode == 1 || mode == 0)           FileUtil.mkfile(file.getFile(),context);
          if (!file.exists() && rootMode) {
            file.setMode(OpenMode.ROOT);
            if (file.exists())             errorCallBack.exists(file);
            try {
              RootUtils.mkFile(file.getPath());
            }
 catch (            ShellNotRunningException e) {
              e.printStackTrace();
            }
            errorCallBack.done(file,file.exists());
            return null;
          }
          errorCallBack.done(file,file.exists());
          return null;
        }
        errorCallBack.done(file,file.exists());
      }
      return null;
    }
  }
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

Fixed version (ground truth):
public static void mkfile(@NonNull final HybridFile file,final Context context,final boolean rootMode,@NonNull final ErrorCallBack errorCallBack){
  new AsyncTask<Void,Void,Void>(){
    private DataUtils dataUtils=DataUtils.getInstance();
    @Override protected Void doInBackground(    Void... params){
      if (!Operations.isFileNameValid(file.getName(context))) {
        errorCallBack.invalidName(file);
        return null;
      }
      if (file.exists()) {
        errorCallBack.exists(file);
        return null;
      }
      if (file.isSftp()) {
        OutputStream out=file.getOutputStream(context);
        if (out == null) {
          errorCallBack.done(file,false);
          return null;
        }
        try {
          out.close();
          errorCallBack.done(file,true);
          return null;
        }
 catch (        IOException e) {
          errorCallBack.done(file,false);
          return null;
        }
      }
      if (file.isSmb()) {
        try {
          file.getSmbFile(2000).createNewFile();
        }
 catch (        SmbException e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
          return null;
        }
        errorCallBack.done(file,file.exists());
        return null;
      }
 else       if (file.isDropBoxFile()) {
        CloudStorage cloudStorageDropbox=dataUtils.getAccount(OpenMode.DROPBOX);
        try {
          byte[] tempBytes=new byte[0];
          ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(tempBytes);
          cloudStorageDropbox.upload(CloudUtil.stripPath(OpenMode.DROPBOX,file.getPath()),byteArrayInputStream,0l,true);
          errorCallBack.done(file,true);
        }
 catch (        Exception e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
        }
      }
 else       if (file.isBoxFile()) {
        CloudStorage cloudStorageBox=dataUtils.getAccount(OpenMode.BOX);
        try {
          byte[] tempBytes=new byte[0];
          ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(tempBytes);
          cloudStorageBox.upload(CloudUtil.stripPath(OpenMode.BOX,file.getPath()),byteArrayInputStream,0l,true);
          errorCallBack.done(file,true);
        }
 catch (        Exception e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
        }
      }
 else       if (file.isOneDriveFile()) {
        CloudStorage cloudStorageOneDrive=dataUtils.getAccount(OpenMode.ONEDRIVE);
        try {
          byte[] tempBytes=new byte[0];
          ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(tempBytes);
          cloudStorageOneDrive.upload(CloudUtil.stripPath(OpenMode.ONEDRIVE,file.getPath()),byteArrayInputStream,0l,true);
          errorCallBack.done(file,true);
        }
 catch (        Exception e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
        }
      }
 else       if (file.isGoogleDriveFile()) {
        CloudStorage cloudStorageGdrive=dataUtils.getAccount(OpenMode.GDRIVE);
        try {
          byte[] tempBytes=new byte[0];
          ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(tempBytes);
          cloudStorageGdrive.upload(CloudUtil.stripPath(OpenMode.GDRIVE,file.getPath()),byteArrayInputStream,0l,true);
          errorCallBack.done(file,true);
        }
 catch (        Exception e) {
          e.printStackTrace();
          errorCallBack.done(file,false);
        }
      }
 else       if (file.isOtgFile()) {
        DocumentFile fileToCreate=OTGUtil.getDocumentFile(file.getPath(),context,false);
        if (fileToCreate != null)         errorCallBack.exists(file);
        DocumentFile parentDirectory=OTGUtil.getDocumentFile(file.getParent(),context,false);
        if (parentDirectory.isDirectory()) {
          parentDirectory.createFile(file.getName(context).substring(file.getName().lastIndexOf("String_Node_Str")),file.getName(context));
          errorCallBack.done(file,true);
        }
 else         errorCallBack.done(file,false);
        return null;
      }
 else {
        if (file.isLocal() || file.isRoot()) {
          int mode=checkFolder(new File(file.getParent()),context);
          if (mode == 2) {
            errorCallBack.launchSAF(file);
            return null;
          }
          if (mode == 1 || mode == 0)           FileUtil.mkfile(file.getFile(),context);
          if (!file.exists() && rootMode) {
            file.setMode(OpenMode.ROOT);
            if (file.exists())             errorCallBack.exists(file);
            try {
              RootUtils.mkFile(file.getPath());
            }
 catch (            ShellNotRunningException e) {
              e.printStackTrace();
            }
            errorCallBack.done(file,file.exists());
            return null;
          }
          errorCallBack.done(file,file.exists());
          return null;
        }
        errorCallBack.done(file,file.exists());
      }
      return null;
    }
  }
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}