Examples of IncorrectObjectTypeException


Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

              } else if (item.equals("commit")) {
                ref = rw.parseCommit(ref);
              } else if (item.equals("blob")) {
                ref = rw.peel(ref);
                if (!(ref instanceof RevBlob))
                  throw new IncorrectObjectTypeException(ref,
                      Constants.TYPE_BLOB);
              } else if (item.equals("")) {
                ref = rw.peel(ref);
              } else
                throw new RevisionSyntaxException(revstr);
            else
              throw new RevisionSyntaxException(revstr);
            break;
          default:
            ref = rw.parseAny(ref);
            if (ref instanceof RevCommit) {
              RevCommit commit = ((RevCommit) ref);
              if (commit.getParentCount() == 0)
                ref = null;
              else
                ref = commit.getParent(0);
            } else
              throw new IncorrectObjectTypeException(ref,
                  Constants.TYPE_COMMIT);

          }
        } else {
          ref = rw.peel(ref);
          if (ref instanceof RevCommit) {
            RevCommit commit = ((RevCommit) ref);
            if (commit.getParentCount() == 0)
              ref = null;
            else
              ref = commit.getParent(0);
          } else
            throw new IncorrectObjectTypeException(ref,
                Constants.TYPE_COMMIT);
        }
        break;
      case '~':
        if (ref == null) {
          ref = parseSimple(rw, new String(rev, 0, i));
          if (ref == null)
            return null;
        }
        ref = rw.peel(ref);
        if (!(ref instanceof RevCommit))
          throw new IncorrectObjectTypeException(ref,
              Constants.TYPE_COMMIT);
        int l;
        for (l = i + 1; l < rev.length; ++l) {
          if (!Character.isDigit(rev[l]))
            break;
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

      if (typeHint == OBJ_ANY)
        throw new MissingObjectException(objectId.copy(), "unknown");
      throw new MissingObjectException(objectId.copy(), typeHint);
    }
    if (typeHint != OBJ_ANY && ldr.getType() != typeHint)
      throw new IncorrectObjectTypeException(objectId.copy(), typeHint);
    return ldr;
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

    otp.setPathHash(pathHashCode);

    try {
      objectsLists[object.getType()].add(otp);
    } catch (ArrayIndexOutOfBoundsException x) {
      throw new IncorrectObjectTypeException(object,
          JGitText.get().incorrectObjectType_COMMITnorTREEnorBLOBnorTAG);
    } catch (UnsupportedOperationException x) {
      // index pointing to "dummy" empty list
      throw new IncorrectObjectTypeException(object,
          JGitText.get().incorrectObjectType_COMMITnorTREEnorBLOBnorTAG);
    }
    objectsMap.add(otp);
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

      final MutableObjectId idBuffer)
      throws IncorrectObjectTypeException, IOException {
    idBuffer.fromRaw(idBuffer(), idOffset());
    if (!FileMode.TREE.equals(mode)) {
      final ObjectId me = idBuffer.toObjectId();
      throw new IncorrectObjectTypeException(me, Constants.TYPE_TREE);
    }
    return createSubtreeIterator0(reader, idBuffer);
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

  @Override
  public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader)
      throws IncorrectObjectTypeException, IOException {
    if (currentSubtree == null)
      throw new IncorrectObjectTypeException(getEntryObjectId(),
          Constants.TYPE_TREE);
    return new DirCacheIterator(this, currentSubtree);
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

              } else if (item.equals("commit")) {
                rev = rw.parseCommit(rev);
              } else if (item.equals("blob")) {
                rev = rw.peel(rev);
                if (!(rev instanceof RevBlob))
                  throw new IncorrectObjectTypeException(rev,
                      Constants.TYPE_BLOB);
              } else if (item.equals("")) {
                rev = rw.peel(rev);
              } else
                throw new RevisionSyntaxException(revstr);
            else
              throw new RevisionSyntaxException(revstr);
            done = k;
            break;
          default:
            rev = rw.parseAny(rev);
            if (rev instanceof RevCommit) {
              RevCommit commit = ((RevCommit) rev);
              if (commit.getParentCount() == 0)
                rev = null;
              else
                rev = commit.getParent(0);
            } else
              throw new IncorrectObjectTypeException(rev,
                  Constants.TYPE_COMMIT);

          }
        } else {
          rev = rw.peel(rev);
          if (rev instanceof RevCommit) {
            RevCommit commit = ((RevCommit) rev);
            if (commit.getParentCount() == 0)
              rev = null;
            else
              rev = commit.getParent(0);
          } else
            throw new IncorrectObjectTypeException(rev,
                Constants.TYPE_COMMIT);
        }
        break;
      case '~':
        if (rev == null) {
          if (name == null)
            name = new String(revChars, done, i);
          rev = parseSimple(rw, name);
          if (rev == null)
            return null;
        }
        rev = rw.peel(rev);
        if (!(rev instanceof RevCommit))
          throw new IncorrectObjectTypeException(rev,
              Constants.TYPE_COMMIT);
        int l;
        for (l = i + 1; l < revChars.length; ++l) {
          if (!Character.isDigit(revChars[l]))
            break;
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

   */
  public RevCommit getBaseCommit(final int aIdx, final int bIdx)
      throws IncorrectObjectTypeException,
      IOException {
    if (sourceCommits[aIdx] == null)
      throw new IncorrectObjectTypeException(sourceObjects[aIdx],
          Constants.TYPE_COMMIT);
    if (sourceCommits[bIdx] == null)
      throw new IncorrectObjectTypeException(sourceObjects[bIdx],
          Constants.TYPE_COMMIT);
    walk.reset();
    walk.setRevFilter(RevFilter.MERGE_BASE);
    walk.markStart(sourceCommits[aIdx]);
    walk.markStart(sourceCommits[bIdx]);
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

      final MutableObjectId idBuffer)
      throws IncorrectObjectTypeException, IOException {
    idBuffer.fromRaw(idBuffer(), idOffset());
    if (!FileMode.TREE.equals(mode)) {
      final ObjectId me = idBuffer.toObjectId();
      throw new IncorrectObjectTypeException(me, Constants.TYPE_TREE);
    }
    return createSubtreeIterator0(reader, idBuffer);
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

      if (typeHint == OBJ_ANY)
        throw new MissingObjectException(objectId.copy(), "unknown");
      throw new MissingObjectException(objectId.copy(), typeHint);
    }
    if (typeHint != OBJ_ANY && ldr.getType() != typeHint)
      throw new IncorrectObjectTypeException(objectId.copy(), typeHint);
    return ldr;
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.IncorrectObjectTypeException

              } else if (item.equals("commit")) {
                ref = rw.parseCommit(ref);
              } else if (item.equals("blob")) {
                ref = rw.peel(ref);
                if (!(ref instanceof RevBlob))
                  throw new IncorrectObjectTypeException(ref,
                      Constants.TYPE_BLOB);
              } else if (item.equals("")) {
                ref = rw.peel(ref);
              } else
                throw new RevisionSyntaxException(revstr);
            else
              throw new RevisionSyntaxException(revstr);
            break;
          default:
            ref = rw.parseAny(ref);
            if (ref instanceof RevCommit) {
              RevCommit commit = ((RevCommit) ref);
              if (commit.getParentCount() == 0)
                ref = null;
              else
                ref = commit.getParent(0);
            } else
              throw new IncorrectObjectTypeException(ref,
                  Constants.TYPE_COMMIT);

          }
        } else {
          ref = rw.peel(ref);
          if (ref instanceof RevCommit) {
            RevCommit commit = ((RevCommit) ref);
            if (commit.getParentCount() == 0)
              ref = null;
            else
              ref = commit.getParent(0);
          } else
            throw new IncorrectObjectTypeException(ref,
                Constants.TYPE_COMMIT);
        }
        break;
      case '~':
        if (ref == null) {
          ref = parseSimple(rw, new String(rev, 0, i));
          if (ref == null)
            return null;
        }
        ref = rw.peel(ref);
        if (!(ref instanceof RevCommit))
          throw new IncorrectObjectTypeException(ref,
              Constants.TYPE_COMMIT);
        int l;
        for (l = i + 1; l < rev.length; ++l) {
          if (!Character.isDigit(rev[l]))
            break;
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.