Program: 35271
Project: 35271
Buggy source:
private boolean insertNoCheck(long[] val){
  if (root == null) {
    if (rootVal == null) {
      rootVal=new long[val.length];
      System.arraycopy(val,0,rootVal,0,val.length);
    }
 else {
      Node n2=createNode(val,rootVal,0);
      if (n2 == null) {
        return false;
      }
      root=n2;
      rootVal=null;
    }
    size++;
    return true;
  }
  Node n=root;
  int currentDepth=0;
  long[] currentPrefix=new long[val.length];
  while (true) {
    readInfix(n,currentDepth,currentPrefix);
    if (n.infix != null) {
      int posDiff=compare(val,currentPrefix);
      if (posDiff < n.posDiff && posDiff != -1) {
        long[] subInfix=extractInfix(n.infix,posDiff + 1,n.posDiff - 1);
        Node newSub=new Node(-1,DEPTH,null,null,subInfix,n.posDiff);
        newSub.hi=n.hi;
        newSub.lo=n.lo;
        newSub.hiVal=n.hiVal;
        newSub.loVal=n.loVal;
        if (BitTools.getBit(val,posDiff)) {
          n.hi=null;
          n.hiVal=createPostFix(val,posDiff);
          n.lo=newSub;
          n.loVal=null;
        }
 else {
          n.hi=newSub;
          n.hiVal=null;
          n.lo=null;
          n.loVal=createPostFix(val,posDiff);
        }
        n.infix=extractInfix(currentPrefix,currentDepth,posDiff - 1);
        n.posDiff=posDiff;
        size++;
        return true;
      }
    }
    currentDepth=n.posDiff;
    if (BitTools.getBit(val,currentDepth)) {
      currentDepth++;
      if (n.hi != null) {
        n=n.hi;
        continue;
      }
 else {
        readPostFix(n.hiVal,currentPrefix);
        Node n2=createNode(val,currentPrefix,currentDepth);
        if (n2 == null) {
          return false;
        }
        n.hi=n2;
        n.hiVal=null;
        size++;
        return true;
      }
    }
 else {
      currentDepth++;
      if (n.lo != null) {
        n=n.lo;
        continue;
      }
 else {
        readPostFix(n.loVal,currentPrefix);
        Node n2=createNode(val,currentPrefix,currentDepth);
        if (n2 == null) {
          return false;
        }
        n.lo=n2;
        n.loVal=null;
        size++;
        return true;
      }
    }
  }
}

Fixed version (ground truth):
private boolean insertNoCheck(long[] val){
  if (root == null) {
    if (rootVal == null) {
      rootVal=new long[val.length];
      System.arraycopy(val,0,rootVal,0,val.length);
    }
 else {
      Node n2=createNode(val,rootVal,0);
      if (n2 == null) {
        return false;
      }
      root=n2;
      rootVal=null;
    }
    size++;
    return true;
  }
  Node n=root;
  int currentDepth=0;
  long[] currentPrefix=new long[val.length];
  while (true) {
    readInfix(n,currentDepth,currentPrefix);
    if (n.infix != null) {
      int posDiff=compare(val,currentPrefix);
      if (posDiff < n.posDiff && posDiff != -1) {
        long[] subInfix=extractInfix(currentPrefix,posDiff + 1,n.posDiff - 1);
        Node newSub=new Node(posDiff + 1,null,null,subInfix,n.posDiff);
        newSub.hi=n.hi;
        newSub.lo=n.lo;
        newSub.hiVal=n.hiVal;
        newSub.loVal=n.loVal;
        if (BitTools.getBit(val,posDiff)) {
          n.hi=null;
          n.hiVal=createPostFix(val,posDiff);
          n.lo=newSub;
          n.loVal=null;
        }
 else {
          n.hi=newSub;
          n.hiVal=null;
          n.lo=null;
          n.loVal=createPostFix(val,posDiff);
        }
        n.infix=extractInfix(currentPrefix,currentDepth,posDiff - 1);
        n.posDiff=posDiff;
        size++;
        return true;
      }
    }
    currentDepth=n.posDiff;
    if (BitTools.getBit(val,currentDepth)) {
      currentDepth++;
      if (n.hi != null) {
        n=n.hi;
        continue;
      }
 else {
        readPostFix(n.hiVal,currentPrefix);
        Node n2=createNode(val,currentPrefix,currentDepth);
        if (n2 == null) {
          return false;
        }
        n.hi=n2;
        n.hiVal=null;
        size++;
        return true;
      }
    }
 else {
      currentDepth++;
      if (n.lo != null) {
        n=n.lo;
        continue;
      }
 else {
        readPostFix(n.loVal,currentPrefix);
        Node n2=createNode(val,currentPrefix,currentDepth);
        if (n2 == null) {
          return false;
        }
        n.lo=n2;
        n.loVal=null;
        size++;
        return true;
      }
    }
  }
}