docs: public boolean addDescriptor() {
  
          saveLocalization();
          IndexedContainer oldContainer = m_container;
          try {
              createAndLockDescriptorFile();
              unmarshalDescriptor();
              updateBundleDescriptorContent();
              m_hasMasterMode = true;
              m_container = createContainer();
              m_editorState.put(EditMode.DEFAULT, getDefaultState());
              m_editorState.put(EditMode.MASTER, getMasterState());
          } catch (CmsException | IOException e) {
              LOG.error(e.getLocalizedMessage(), e);
              if (m_descContent != null) {
                  m_descContent = null;
              }
              if (m_descFile != null) {
                  m_descFile = null;
              }
              if (m_desc != null) {
                  try {
                      m_cms.deleteResource(m_desc, CmsResourceDeleteMode.valueOf(1));
                  } catch (CmsException ex) {
                      LOG.error(ex.getLocalizedMessage(), ex);
                  }
                  m_desc = null;
              }
              m_hasMasterMode = false;
              m_container = oldContainer;
              return false;
          }
          m_removeDescriptorOnCancel = true;
          return true;
      }