Program: 48244
Project: 48244
Buggy source:
@Override protected long nextKey(){
  if (mNextKey == EFixed.NULL_NODE_KEY.getStandardProperty()) {
    return done();
  }
  getTrx().moveTo(mNextKey);
  if (getTrx().getLeftSiblingKey() == getStartKey()) {
    return getTrx().getLeftSiblingKey();
  }
  if (getTrx().hasFirstChild()) {
    mDescendantCount=(int)(getTrx().getDescendantCount() + 1);
    if (mDescendantCount == ITraverseModel.DESCENDANTS_DONE) {
      return done();
    }
 else {
      processMove();
      mChildExtension=mModel.createSunburstItem(mItem,mDepth,mIndex);
      if (mPruning == EPruning.DEPTH && mDepth + 1 >= ITraverseModel.DEPTH_TO_PRUNE) {
        return processPruned();
      }
 else {
        mNextKey=getTrx().getFirstChildKey();
        if (getTrx().hasRightSibling()) {
          mRightSiblingKeyStack.push(getTrx().getRightSiblingKey());
        }
        mAngleStack.push(mAngle);
        mExtensionStack.push(mChildExtension);
        mParentStack.push(mIndex);
        mDescendantsStack.push(mDescendantCount);
        mDepth++;
        mMoved=EMoved.CHILD;
      }
      return mNextKey;
    }
  }
  if (getTrx().hasRightSibling()) {
    mDescendantCount=(int)(getTrx().getDescendantCount() + 1);
    if (mDescendantCount == ITraverseModel.DESCENDANTS_DONE) {
      return done();
    }
 else {
      processMove();
      mChildExtension=mModel.createSunburstItem(mItem,mDepth,mIndex);
      nextRightSibling();
      return mNextKey;
    }
  }
  if (!mRightSiblingKeyStack.isEmpty()) {
    mDescendantCount=(int)(getTrx().getDescendantCount() + 1);
    if (mDescendantCount == ITraverseModel.DESCENDANTS_DONE) {
      return done();
    }
 else {
      processMove();
      mChildExtension=mModel.createSunburstItem(mItem,mDepth,mIndex);
      nextFollowing();
      return mNextKey;
    }
  }
  mDescendantCount=(int)(getTrx().getDescendantCount() + 1);
  if (mDescendantCount == ITraverseModel.DESCENDANTS_DONE) {
    return done();
  }
 else {
    processMove();
    mChildExtension=mModel.createSunburstItem(mItem,mDepth,mIndex);
    mNextKey=(Long)EFixed.NULL_NODE_KEY.getStandardProperty();
    return mNextKey;
  }
}

Fixed version (ground truth):
@Override protected long nextKey(){
  if (mNextKey == EFixed.NULL_NODE_KEY.getStandardProperty()) {
    return done();
  }
  getTrx().moveTo(mNextKey);
  if (getTrx().getLeftSiblingKey() == getStartKey()) {
    return EFixed.NULL_NODE_KEY.getStandardProperty();
  }
  if (getTrx().hasFirstChild()) {
    mDescendantCount=(int)(getTrx().getDescendantCount() + 1);
    if (mDescendantCount == ITraverseModel.DESCENDANTS_DONE) {
      return done();
    }
 else {
      processMove();
      mChildExtension=mModel.createSunburstItem(mItem,mDepth,mIndex);
      if (mPruning == EPruning.DEPTH && mDepth + 1 >= ITraverseModel.DEPTH_TO_PRUNE) {
        return processPruned();
      }
 else {
        mNextKey=getTrx().getFirstChildKey();
        if (getTrx().hasRightSibling()) {
          mRightSiblingKeyStack.push(getTrx().getRightSiblingKey());
        }
        mAngleStack.push(mAngle);
        mExtensionStack.push(mChildExtension);
        mParentStack.push(mIndex);
        mDescendantsStack.push(mDescendantCount);
        mDepth++;
        mMoved=EMoved.CHILD;
      }
      return mNextKey;
    }
  }
  if (getTrx().hasRightSibling()) {
    mDescendantCount=(int)(getTrx().getDescendantCount() + 1);
    if (mDescendantCount == ITraverseModel.DESCENDANTS_DONE) {
      return done();
    }
 else {
      processMove();
      mChildExtension=mModel.createSunburstItem(mItem,mDepth,mIndex);
      nextRightSibling();
      return mNextKey;
    }
  }
  if (!mRightSiblingKeyStack.isEmpty()) {
    mDescendantCount=(int)(getTrx().getDescendantCount() + 1);
    if (mDescendantCount == ITraverseModel.DESCENDANTS_DONE) {
      return done();
    }
 else {
      processMove();
      mChildExtension=mModel.createSunburstItem(mItem,mDepth,mIndex);
      nextFollowing();
      return mNextKey;
    }
  }
  mDescendantCount=(int)(getTrx().getDescendantCount() + 1);
  if (mDescendantCount == ITraverseModel.DESCENDANTS_DONE) {
    return done();
  }
 else {
    processMove();
    mChildExtension=mModel.createSunburstItem(mItem,mDepth,mIndex);
    mNextKey=(Long)EFixed.NULL_NODE_KEY.getStandardProperty();
    return mNextKey;
  }
}