Examples of NoSuchChangeException


Examples of com.amazonaws.services.route53.model.NoSuchChangeException

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("NoSuchChange"))
            return null;

        NoSuchChangeException e = (NoSuchChangeException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

Examples of com.amazonaws.services.route53.model.NoSuchChangeException

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("NoSuchChange"))
            return null;

        NoSuchChangeException e = (NoSuchChangeException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

Examples of com.amazonaws.services.route53.model.NoSuchChangeException

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("NoSuchChange"))
            return null;

        NoSuchChangeException e = (NoSuchChangeException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

Examples of com.google.gerrit.server.project.NoSuchChangeException

  public VoidResult call() throws NoSuchChangeException, OrmException, IOException {

    final Change.Id changeId = patchSetId.getParentKey();
    final ChangeControl control = changeControlFactory.validateFor(changeId);
    if (!control.canDeleteDraft(db)) {
      throw new NoSuchChangeException(changeId);
    }

    ChangeUtil.deleteDraftChange(patchSetId, gitManager, replication, db);
    return VoidResult.INSTANCE;
  }
View Full Code Here

Examples of com.google.gerrit.server.project.NoSuchChangeException

    final RestoreChange restoreChange = restoreChangeProvider.get();
    restoreChange.setChangeId(patchSetId.getParentKey());
    restoreChange.setMessage(message);
    final ReviewResult result = restoreChange.call();
    if (result.getErrors().size() > 0) {
      throw new NoSuchChangeException(result.getChangeId());
    }
    return changeDetailFactory.create(result.getChangeId()).call();
  }
View Full Code Here

Examples of com.google.gerrit.server.project.NoSuchChangeException

    control = changeControlFactory.validateFor(changeId);
    change = control.getChange();
    projectKey = change.getProject();
    patchSet = db.patchSets().get(patchSetId);
    if (patchSet == null) {
      throw new NoSuchChangeException(changeId);
    }

    aId = psa != null ? toObjectId(db, psa) : null;
    bId = toObjectId(db, psb);

    final Repository git;
    try {
      git = repoManager.openRepository(projectKey);
    } catch (RepositoryNotFoundException e) {
      log.error("Repository " + projectKey + " not found", e);
      throw new NoSuchChangeException(changeId, e);
    } catch (IOException e) {
      log.error("Cannot open repository " + projectKey, e);
      throw new NoSuchChangeException(changeId, e);
    }
    try {
      final PatchList list = listFor(keyFor(diffPrefs.getIgnoreWhitespace()));
      final PatchScriptBuilder b = newBuilder(list, git);
      final PatchListEntry content = list.get(patchKey.getFileName());

      loadCommentsAndHistory(content.getChangeType(), //
          content.getOldName(), //
          content.getNewName());

        return b.toPatchScript(content, comments, history);
    } catch (PatchListNotAvailableException e) {
      throw new NoSuchChangeException(changeId, e);
    } catch (IOException e) {
      log.error("File content unavailable", e);
      throw new NoSuchChangeException(changeId, e);
    } catch (org.eclipse.jgit.errors.LargeObjectException err) {
      throw new LargeObjectException("File content is too large", err);
    } finally {
      git.close();
    }
View Full Code Here

Examples of com.google.gerrit.server.project.NoSuchChangeException

  }

  private ObjectId toObjectId(final ReviewDb db, final PatchSet.Id psId)
      throws OrmException, NoSuchChangeException {
    if (!changeId.equals(psId.getParentKey())) {
      throw new NoSuchChangeException(changeId);
    }

    final PatchSet ps = db.patchSets().get(psId);
    if (ps == null || ps.getRevision() == null
        || ps.getRevision().get() == null) {
      throw new NoSuchChangeException(changeId);
    }

    try {
      return ObjectId.fromString(ps.getRevision().get());
    } catch (IllegalArgumentException e) {
      log.error("Patch set " + psId + " has invalid revision");
      throw new NoSuchChangeException(changeId, e);
    }
  }
View Full Code Here

Examples of com.google.gerrit.server.project.NoSuchChangeException

  private void validatePatchSetId(final PatchSet.Id psId)
      throws NoSuchChangeException {
    if (psId == null) { // OK, means use base;
    } else if (changeId.equals(psId.getParentKey())) { // OK, same change;
    } else {
      throw new NoSuchChangeException(changeId);
    }
  }
View Full Code Here

Examples of com.google.gerrit.server.project.NoSuchChangeException

    db.changes().beginTransaction(changeId);
    try {
      changeControlFactory.validateFor(changeId);
      if (db.patchSets().get(patchSetId) == null) {
        throw new NoSuchChangeException(changeId);
      }

      final Account.Id me = currentUser.getAccountId();
      if (comment.getKey().get() == null) {
        if (comment.getLine() < 1) {
          throw new IllegalStateException("Comment line must be >= 1, not "
              + comment.getLine());
        }

        if (comment.getParentUuid() != null) {
          final PatchLineComment parent =
              db.patchComments().get(
                  new PatchLineComment.Key(patchKey, comment.getParentUuid()));
          if (parent == null || parent.getSide() != comment.getSide()) {
            throw new IllegalStateException("Parent comment must be on same side");
          }
        }

        final PatchLineComment nc =
            new PatchLineComment(new PatchLineComment.Key(patchKey, ChangeUtil
                .messageUUID(db)), comment.getLine(), me, comment.getParentUuid());
        nc.setSide(comment.getSide());
        nc.setMessage(comment.getMessage());
        db.patchComments().insert(Collections.singleton(nc));
        db.commit();
        return nc;

      } else {
        if (!me.equals(comment.getAuthor())) {
          throw new NoSuchChangeException(changeId);
        }
        comment.updated();
        db.patchComments().update(Collections.singleton(comment));
        db.commit();
        return comment;
View Full Code Here

Examples of com.google.gerrit.server.project.NoSuchChangeException

    final Change.Id changeId = patchSetId.getParentKey();
    final ChangeControl ctl = changeControlFactory.validateFor(changeId);
    change = ctl.getChange();
    patchSet = db.patchSets().get(patchSetId);
    if (patchSet == null) {
      throw new NoSuchChangeException(changeId);
    }
    drafts = drafts();

    db.changes().beginTransaction(changeId);
    try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.