docs: private static void ensureReadWrite(IFile file) throws CoreException {
          /*
           * fix for bug 1683264: we should checkout file before writing to it
           */
          if (file.isReadOnly()) {
              IStatus checkOutStatus = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] { file }, null);
              if (!checkOutStatus.isOK()) {
                  throw new CoreException(checkOutStatus);
              }
          }
      }