Program: 4346
Project: 4346
Buggy source:
private void put(KUID nodeId,ContactNode node){
  if (nodeId == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (node == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!nodeId.equals(node.getNodeID())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  staleNodes.remove(nodeId);
  BucketNode bucket=(BucketNode)bucketsTrie.select(nodeId);
  if (bucket.getNodeCount() < K) {
    if (LOG.isTraceEnabled()) {
      LOG.trace("String_Node_Str" + node + "String_Node_Str"+ bucket);
    }
    bucket.incrementNodeCount();
    bucket.removeReplacementNode(nodeId);
    nodesTrie.put(nodeId,node);
    return;
  }
 else {
    if (LOG.isTraceEnabled()) {
      LOG.trace("String_Node_Str" + bucket + "String_Node_Str");
    }
    BucketNode localBucket=(BucketNode)bucketsTrie.select(context.getLocalNodeID());
    boolean containsLocal=localBucket.equals(bucket);
    BucketNode smallestSubtree=(BucketNode)bucketsTrie.selectNextClosest(localBucket.getNodeID());
    boolean partOfSmallest=bucket.equals(smallestSubtree);
    boolean tooDeep=bucket.getDepth() % B == 0;
    if (containsLocal || partOfSmallest || !tooDeep) {
      if (LOG.isTraceEnabled()) {
        LOG.trace("String_Node_Str" + bucket + "String_Node_Str");
      }
      List newBuckets=bucket.split();
      BucketNode leftSplitBucket=(BucketNode)newBuckets.get(0);
      BucketNode rightSplitBucket=(BucketNode)newBuckets.get(1);
      bucketsTrie.put(leftSplitBucket.getNodeID(),leftSplitBucket);
      bucketsTrie.put(rightSplitBucket.getNodeID(),rightSplitBucket);
      int countLeft=updateBucketNodeCount(leftSplitBucket);
      int countRight=updateBucketNodeCount(rightSplitBucket);
      BucketNode newBucket=(BucketNode)bucketsTrie.select(nodeId);
      if (countLeft + countRight != K) {
        if (LOG.isErrorEnabled()) {
          LOG.error("String_Node_Str");
        }
        return;
      }
      if (newBucket.equals(bucket)) {
        if (LOG.isErrorEnabled()) {
          LOG.error("String_Node_Str");
        }
        return;
      }
      if (newBucket.getNodeCount() < K) {
        if (LOG.isTraceEnabled()) {
          LOG.trace("String_Node_Str" + node + "String_Node_Str"+ newBucket);
        }
        newBucket.incrementNodeCount();
        newBucket.removeReplacementNode(nodeId);
        nodesTrie.put(nodeId,node);
        return;
      }
 else {
        if (LOG.isTraceEnabled()) {
          LOG.trace("String_Node_Str" + newBucket + "String_Node_Str"+ node+ "String_Node_Str");
        }
        bucket.addReplacementNode(node);
        return;
      }
    }
 else {
      if (LOG.isTraceEnabled()) {
        LOG.trace("String_Node_Str" + bucket + "String_Node_Str"+ node+ "String_Node_Str"+ bucket);
      }
      bucket.addReplacementNode(node);
    }
  }
}

Fixed version (ground truth):
private void put(KUID nodeId,ContactNode node){
  if (nodeId == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (node == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!nodeId.equals(node.getNodeID())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  staleNodes.remove(nodeId);
  BucketNode bucket=(BucketNode)bucketsTrie.select(nodeId);
  if (bucket.getNodeCount() < K) {
    if (LOG.isTraceEnabled()) {
      LOG.trace("String_Node_Str" + node + "String_Node_Str"+ bucket);
    }
    bucket.incrementNodeCount();
    bucket.removeReplacementNode(nodeId);
    nodesTrie.put(nodeId,node);
    return;
  }
 else {
    if (LOG.isTraceEnabled()) {
      LOG.trace("String_Node_Str" + bucket + "String_Node_Str");
    }
    BucketNode localBucket=(BucketNode)bucketsTrie.select(context.getLocalNodeID());
    boolean containsLocal=localBucket.equals(bucket);
    BucketNode smallestSubtree=(BucketNode)bucketsTrie.selectNextClosest(localBucket.getNodeID());
    boolean partOfSmallest=bucket.equals(smallestSubtree);
    boolean tooDeep=bucket.getDepth() % B == 0;
    if (containsLocal || partOfSmallest || !tooDeep) {
      if (LOG.isTraceEnabled()) {
        LOG.trace("String_Node_Str" + bucket + "String_Node_Str");
      }
      List newBuckets=bucket.split();
      BucketNode leftSplitBucket=(BucketNode)newBuckets.get(0);
      BucketNode rightSplitBucket=(BucketNode)newBuckets.get(1);
      bucketsTrie.put(leftSplitBucket.getNodeID(),leftSplitBucket);
      bucketsTrie.put(rightSplitBucket.getNodeID(),rightSplitBucket);
      int countLeft=updateBucketNodeCount(leftSplitBucket);
      int countRight=updateBucketNodeCount(rightSplitBucket);
      BucketNode newBucket=(BucketNode)bucketsTrie.select(nodeId);
      if (countLeft + countRight != K) {
        if (LOG.isErrorEnabled()) {
          LOG.error("String_Node_Str");
        }
        return;
      }
      if (newBucket.equals(bucket)) {
        if (LOG.isErrorEnabled()) {
          LOG.error("String_Node_Str");
        }
        return;
      }
      if (newBucket.getNodeCount() < K) {
        if (LOG.isTraceEnabled()) {
          LOG.trace("String_Node_Str" + node + "String_Node_Str"+ newBucket);
        }
        newBucket.incrementNodeCount();
        newBucket.removeReplacementNode(nodeId);
        nodesTrie.put(nodeId,node);
        return;
      }
 else {
        if (LOG.isTraceEnabled()) {
          LOG.trace("String_Node_Str" + newBucket + "String_Node_Str"+ node+ "String_Node_Str");
        }
        newBucket.addReplacementNode(node);
        return;
      }
    }
 else {
      if (LOG.isTraceEnabled()) {
        LOG.trace("String_Node_Str" + bucket + "String_Node_Str"+ node+ "String_Node_Str"+ bucket);
      }
      bucket.addReplacementNode(node);
    }
  }
}