Source:
<code>protected Integer doInBackground(Void... voids) { try { OutputStream outputStream; switch (fileAbstraction.scheme) { case EditableFileAbstraction.SCHEME_CONTENT: if(fileAbstraction.uri == null) throw new NullPointerException("Something went really wrong!"); <START> outputStream = contentResolver.openOutputStream(fileAbstraction.uri); <END> break; case EditableFileAbstraction.SCHEME_FILE: Context context = this.context.get(); if(context == null) cancel(true); final HybridFileParcelable hybridFileParcelable = fileAbstraction.hybridFileParcelable; if(hybridFileParcelable == null) throw new NullPointerException("Something went really wrong!"); outputStream = FileUtil.getOutputStream(hybridFileParcelable.getFile(), context); if (ThemedActivity.rootMode && outputStream == null) { try { if (cachedFile != null && cachedFile.exists()){ outputStream = new FileOutputStream(cachedFile); } } catch (FileNotFoundException e) { e.printStackTrace(); outputStream = null; } } break; default: throw new IllegalArgumentException("The scheme for '" + fileAbstraction.scheme + "' cannot be processed!"); } if(outputStream == null) throw new StreamNotFoundException(); outputStream.write(dataToSave.getBytes()); outputStream.close(); if (cachedFile != null && cachedFile.exists()) { RootUtils.cat(cachedFile.getPath(), fileAbstraction.hybridFileParcelable.getPath()); cachedFile.delete(); } } catch (IOException e) { e.printStackTrace(); return EXCEPTION_IO; } catch (StreamNotFoundException e) { e.printStackTrace(); return EXCEPTION_STREAM_NOT_FOUND; } catch (ShellNotRunningException e) { e.printStackTrace(); return EXCEPTION_SHELL_NOT_RUNNING; } return NORMAL; }</code><technical_language>catch RuntimeException interact ContentProviders. ContentProviders essentially untrusted third-party apps, written clueless people. is isolation protect code bugs in them. ContentResolver offers some degree of isolation you, throw SecurityException if remote ContentProvider denies access. rethrow RuntimeExceptions, thrown remote content provider. E.g. if remote provider accidentally throws NullPointerException, handle it, *your* app crash</technical_language>

Target:
protected Integer doInBackground(Void... voids) { try { OutputStream outputStream; switch (fileAbstraction.scheme) { case EditableFileAbstraction.SCHEME_CONTENT: if(fileAbstraction.uri == null) throw new NullPointerException("Something went really wrong!"); try { outputStream = contentResolver.openOutputStream(fileAbstraction.uri); } catch (RuntimeException e) { throw new StreamNotFoundException(e); } break; case EditableFileAbstraction.SCHEME_FILE: final HybridFileParcelable hybridFileParcelable = fileAbstraction.hybridFileParcelable; if(hybridFileParcelable == null) throw new NullPointerException("Something went really wrong!"); Context context = this.context.get(); if(context == null) { cancel(true); return null; } outputStream = FileUtil.getOutputStream(hybridFileParcelable.getFile(), context); if (ThemedActivity.rootMode && outputStream == null) { try { if (cachedFile != null && cachedFile.exists()){ outputStream = new FileOutputStream(cachedFile); } } catch (FileNotFoundException e) { e.printStackTrace(); outputStream = null; } } break; default: throw new IllegalArgumentException("The scheme for '" + fileAbstraction.scheme + "' cannot be processed!"); } if(outputStream == null) throw new StreamNotFoundException(); outputStream.write(dataToSave.getBytes()); outputStream.close(); if (cachedFile != null && cachedFile.exists()) { RootUtils.cat(cachedFile.getPath(), fileAbstraction.hybridFileParcelable.getPath()); cachedFile.delete(); } } catch (IOException e) { e.printStackTrace(); return EXCEPTION_IO; } catch (StreamNotFoundException e) { e.printStackTrace(); return EXCEPTION_STREAM_NOT_FOUND; } catch (ShellNotRunningException e) { e.printStackTrace(); return EXCEPTION_SHELL_NOT_RUNNING; } return NORMAL; }