nus-yam/ex-repair huggingface dataset:
Program: 178843
Project: 178843
Buggy source:
public static void main(String[] argv) throws Exception {
  if (argv.length != 2) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  final String imageID=argv[0];
  final String friendlyName=argv[1];
  final String prefix="String_Node_Str" + imageID;
  final String seqDumpDirectory=prefix + "String_Node_Str";
  final String tokenDumpDirectory=prefix + "String_Node_Str";
  final String vectorDumpDirectory=prefix + "String_Node_Str";
  final String clusterDumpDirectory=prefix + "String_Node_Str";
  final String dictionaryDumpDirectory=prefix + "String_Node_Str";
  FSEntryTikaTextExtractor.runPipeline(HBaseTables.ENTRIES_TBL,imageID,friendlyName);
  GrepSearchJob.runPipeline(HBaseTables.ENTRIES_TBL,imageID,GREP_KEYWORDS,friendlyName);
  boolean filesToSequence=(SequenceFsEntryText.runPipeline(seqDumpDirectory,imageID,friendlyName));
  if (filesToSequence) {
    TokenizeAndVectorizeDocuments.runPipeline(seqDumpDirectory,tokenDumpDirectory,vectorDumpDirectory);
    ClusterDocumentsJob.runPipeline(vectorDumpDirectory + "String_Node_Str",clusterDumpDirectory,dictionaryDumpDirectory,.65,.65,imageID,friendlyName);
  }
  GrepReportGenerator.runPipeline(GREP_KEYWORDS,imageID,friendlyName,prefix);
  CrossImageScorerJob.runPipeline(prefix,imageID);
  HDFSArchiver.runPipeline(prefix + "String_Node_Str",prefix + "String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] argv) throws Exception {
  if (argv.length != 2) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  final String imageID=argv[0];
  final String friendlyName=argv[1];
  final String prefix="String_Node_Str" + imageID;
  final String seqDumpDirectory=prefix + "String_Node_Str";
  final String tokenDumpDirectory=prefix + "String_Node_Str";
  final String vectorDumpDirectory=prefix + "String_Node_Str";
  final String clusterDumpDirectory=prefix + "String_Node_Str";
  final String dictionaryDumpDirectory=prefix + "String_Node_Str";
  FSEntryTikaTextExtractor.runPipeline(HBaseTables.ENTRIES_TBL,imageID,friendlyName);
  GrepSearchJob.runPipeline(HBaseTables.ENTRIES_TBL,imageID,GREP_KEYWORDS,friendlyName);
  boolean filesToSequence=(SequenceFsEntryText.runPipeline(seqDumpDirectory,imageID,friendlyName));
  if (filesToSequence) {
    TokenizeAndVectorizeDocuments.runPipeline(seqDumpDirectory,tokenDumpDirectory,vectorDumpDirectory);
    ClusterDocumentsJob.runPipeline(vectorDumpDirectory + "String_Node_Str",clusterDumpDirectory,dictionaryDumpDirectory,.65,.65,imageID,friendlyName,prefix);
  }
  GrepReportGenerator.runPipeline(GREP_KEYWORDS,imageID,friendlyName,prefix);
  CrossImageScorerJob.runPipeline(prefix,imageID,friendlyName);
  HDFSArchiver.runPipeline(prefix + "String_Node_Str",prefix + "String_Node_Str");
}
Program: 178844
Project: 178844
Buggy source:
/** 
 * start a new process by executing a command script with arguments
 * @param fileName path to image file
 * @param id job name
 * @return command executed with all arguments
 * @throws Exception
 */
public String runAsync(String fileName,String id) throws IllegalArgumentException {
  if (!imagesSubmitted.containsKey(id)) {
    imagesSubmitted.put(id,Calendar.getInstance().getTime());
  }
  try {
    ProcessBuilder pb=new ProcessBuilder(commandScript,id,fileName,commandJar);
    pb.directory(new File(workDir));
    Map<String,String> env=pb.environment();
    env.put("String_Node_Str",SampleServiceImpl.fsripLib);
    env.put("String_Node_Str",SampleServiceImpl.hadoopHome);
    env.put("String_Node_Str",env.get("String_Node_Str") + SampleServiceImpl.path);
    pb.start();
  }
 catch (  Throwable t) {
    t.printStackTrace();
    throw new IllegalArgumentException(t.getMessage());
  }
  String command=commandScript + "String_Node_Str" + id+ "String_Node_Str"+ fileName+ "String_Node_Str"+ commandJar;
  System.err.println("String_Node_Str" + command);
  return command;
}

Fixed version (ground truth):
/** 
 * start a new process by executing a command script with arguments
 * @param fileName path to image file
 * @param id job name
 * @return command executed with all arguments
 * @throws Exception
 */
public String runAsync(String fileName,String id) throws IllegalArgumentException {
  imagesSubmitted.put(id,Calendar.getInstance().getTime());
  try {
    ProcessBuilder pb=new ProcessBuilder(commandScript,id,fileName,commandJar);
    pb.directory(new File(workDir));
    Map<String,String> env=pb.environment();
    env.put("String_Node_Str",SampleServiceImpl.fsripLib);
    env.put("String_Node_Str",SampleServiceImpl.hadoopHome);
    env.put("String_Node_Str",SampleServiceImpl.path);
    System.err.println("String_Node_Str" + env.get("String_Node_Str"));
    System.err.println("String_Node_Str" + env.get("String_Node_Str"));
    System.err.println("String_Node_Str" + env.get("String_Node_Str"));
    System.err.println("String_Node_Str" + pb.directory().getPath());
    pb.start();
  }
 catch (  Throwable t) {
    t.printStackTrace();
    throw new IllegalArgumentException(t.getMessage());
  }
  String command=commandScript + "String_Node_Str" + id+ "String_Node_Str"+ fileName+ "String_Node_Str"+ commandJar;
  System.err.println("String_Node_Str" + command);
  return command;
}
Program: 178845
Project: 178845
Buggy source:
public static void main(String[] argv) throws Exception {
  if (argv.length != 2) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  final String imageID=argv[0];
  final String friendlyName=argv[1];
  final String prefix="String_Node_Str" + imageID;
  final String seqDumpDirectory=prefix + "String_Node_Str";
  final String tokenDumpDirectory=prefix + "String_Node_Str";
  final String vectorDumpDirectory=prefix + "String_Node_Str";
  final String clusterDumpDirectory=prefix + "String_Node_Str";
  final String dictionaryDumpDirectory=prefix + "String_Node_Str";
  FSEntryTikaTextExtractor.runPipeline(HBaseTables.ENTRIES_TBL,imageID,friendlyName);
  GrepSearchJob.runPipeline(HBaseTables.ENTRIES_TBL,imageID,GREP_KEYWORDS,friendlyName);
  SequenceFsEntryText.runPipeline(seqDumpDirectory,imageID,friendlyName);
  boolean filesToSequence=(SequenceFsEntryText.runPipeline(seqDumpDirectory,imageID,friendlyName));
  if (filesToSequence) {
    TokenizeAndVectorizeDocuments.runPipeline(seqDumpDirectory,tokenDumpDirectory,vectorDumpDirectory);
    ClusterDocuments.runPipeline(vectorDumpDirectory + "String_Node_Str",clusterDumpDirectory,dictionaryDumpDirectory,.65,.65,imageID,friendlyName);
  }
  GrepReportGenerator.runPipeline(GREP_KEYWORDS,imageID,friendlyName);
  HDFSArchiver.runPipeline(prefix + "String_Node_Str",prefix + "String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] argv) throws Exception {
  if (argv.length != 2) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  final String imageID=argv[0];
  final String friendlyName=argv[1];
  final String prefix="String_Node_Str" + imageID;
  final String seqDumpDirectory=prefix + "String_Node_Str";
  final String tokenDumpDirectory=prefix + "String_Node_Str";
  final String vectorDumpDirectory=prefix + "String_Node_Str";
  final String clusterDumpDirectory=prefix + "String_Node_Str";
  final String dictionaryDumpDirectory=prefix + "String_Node_Str";
  FSEntryTikaTextExtractor.runPipeline(HBaseTables.ENTRIES_TBL,imageID,friendlyName);
  GrepSearchJob.runPipeline(HBaseTables.ENTRIES_TBL,imageID,GREP_KEYWORDS,friendlyName);
  boolean filesToSequence=(SequenceFsEntryText.runPipeline(seqDumpDirectory,imageID,friendlyName));
  if (filesToSequence) {
    TokenizeAndVectorizeDocuments.runPipeline(seqDumpDirectory,tokenDumpDirectory,vectorDumpDirectory);
    ClusterDocuments.runPipeline(vectorDumpDirectory + "String_Node_Str",clusterDumpDirectory,dictionaryDumpDirectory,.65,.65,imageID,friendlyName);
  }
  GrepReportGenerator.runPipeline(GREP_KEYWORDS,imageID,friendlyName);
  HDFSArchiver.runPipeline(prefix + "String_Node_Str",prefix + "String_Node_Str");
}
Program: 178846
Project: 178846
Buggy source:
@Override public void map(ImmutableHexWritable key,FsEntry value,Context context) throws InterruptedException, IOException {
  try {
    ArrayList<Object> grepKeywordList=(ArrayList)value.get(HBaseConstants.GREP_SEARCHES);
    for (int i=0; i < grepKeywordList.size(); i++) {
      context.write(new LongWritable((int)(Integer)grepKeywordList.get(i)),new LongWritable(1));
    }
  }
 catch (  Exception ex) {
  }
}

Fixed version (ground truth):
@Override public void map(ImmutableHexWritable key,FsEntry value,Context context) throws InterruptedException, IOException {
  final List<Integer> grepKeywordList=(List<Integer>)value.get(HBaseConstants.GREP_SEARCHES);
  if (grepKeywordList != null) {
    for (    Integer i : grepKeywordList) {
      okey.set(i);
      context.write(okey,oval);
    }
  }
}
Program: 178847
Project: 178847
Buggy source:
public static void main(String[] args) throws Exception {
  final Configuration conf=new Configuration();
  final String[] otherArgs=new GenericOptionsParser(conf,args).getRemainingArgs();
  if (otherArgs.length != 4) {
    System.err.println("String_Node_Str");
    System.exit(2);
  }
  final Job job=new Job(conf,"String_Node_Str");
  job.setJarByClass(ExtractData.class);
  job.setMapperClass(ExtractMapper.class);
  job.setNumReduceTasks(1);
  job.setInputFormatClass(RawFileInputFormat.class);
  RawFileInputFormat.addInputPath(job,new Path(otherArgs[2]));
  job.setOutputFormatClass(TextOutputFormat.class);
  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(Text.class);
  conf.setInt("String_Node_Str",-1);
  conf.set(FsEntryHBaseOutputFormat.ENTRY_TABLE,otherArgs[0]);
  conf.set("String_Node_Str",otherArgs[3]);
  FileOutputFormat.setOutputPath(job,new Path(otherArgs[3]));
  final URI extents=new Path(otherArgs[1]).toUri();
  LOG.info("String_Node_Str" + extents);
  DistributedCache.addCacheFile(new Path(otherArgs[1]).toUri(),conf);
  System.exit(job.waitForCompletion(true) ? 0 : 1);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  final Configuration conf=new Configuration();
  final String[] otherArgs=new GenericOptionsParser(conf,args).getRemainingArgs();
  if (otherArgs.length != 4) {
    System.err.println("String_Node_Str");
    System.exit(2);
  }
  final Job job=new Job(conf,"String_Node_Str");
  job.setJarByClass(ExtractData.class);
  job.setMapperClass(ExtractMapper.class);
  job.setNumReduceTasks(1);
  job.setInputFormatClass(RawFileInputFormat.class);
  RawFileInputFormat.addInputPath(job,new Path(otherArgs[2]));
  job.setOutputFormatClass(TextOutputFormat.class);
  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(Text.class);
  conf.setInt("String_Node_Str",-1);
  conf.set(FsEntryHBaseOutputFormat.ENTRY_TABLE,otherArgs[0]);
  conf.set("String_Node_Str",otherArgs[3]);
  FileOutputFormat.setOutputPath(job,new Path(otherArgs[3]));
  final URI extents=new Path(otherArgs[1]).toUri();
  LOG.info("String_Node_Str" + extents);
  DistributedCache.addCacheFile(extents,job.getConfiguration());
  conf.set("String_Node_Str",extents.toString());
  System.exit(job.waitForCompletion(true) ? 0 : 1);
}
Program: 178848
Project: 178848
Buggy source:
SequenceFile.Reader openExtentsFile(FileSystem hdpFs,Configuration conf) throws IOException {
  SequenceFile.Reader extents=null;
  final Path[] files=DistributedCache.getLocalCacheFiles(conf);
  if (files != null && files.length == 1) {
    final RawLocalFileSystem localfs=new RawLocalFileSystem();
    localfs.initialize(null,conf);
    extents=new SequenceFile.Reader(localfs,files[0],conf);
  }
 else   if (files == null) {
    extents=new SequenceFile.Reader(hdpFs,new Path("String_Node_Str"),conf);
  }
  if (extents == null) {
    throw new RuntimeException("String_Node_Str" + files.length);
  }
  return extents;
}

Fixed version (ground truth):
SequenceFile.Reader openExtentsFile(FileSystem hdpFs,Configuration conf) throws IOException {
  SequenceFile.Reader extents=null;
  final Path[] files=DistributedCache.getLocalCacheFiles(conf);
  if (files != null && files.length > 0) {
    final LocalFileSystem localfs=FileSystem.getLocal(conf);
    LOG.info("String_Node_Str" + files[0]);
    extents=new SequenceFile.Reader(localfs,files[0],conf);
  }
 else   if (files == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (extents == null) {
    throw new RuntimeException("String_Node_Str" + files.length);
  }
  return extents;
}
Program: 178849
Project: 178849
Buggy source:
/** 
 * {@inheritDoc} 
 */
public V put(K key,V value){
  Node<K,V> currentNode=root;
  while (currentNode instanceof InternalNode) {
    currentNode=currentNode.getChild(key).left();
  }
  if (currentNode != null) {
    LeafNode<K,V> leaf=(LeafNode<K,V>)currentNode;
    if (!leaf.addValue(key,value)) {
      LeafNode<K,V> right=leaf.split().right();
      if (key.compareTo(right.lowerBound()) >= 0) {
        right.addValue(key,value);
      }
 else {
        leaf.addValue(key,value);
      }
      Node<K,V> newRight=right;
      InternalNode<K,V> parent=(InternalNode<K,V>)right.parent;
      while (parent != null && !parent.addChild(newRight.lowerBound(),newRight)) {
        InternalNode<K,V> parentRight=parent.split().left();
        K newLB=newRight.lowerBound();
        if (newLB.compareTo(parentRight.lowerBound()) >= 0) {
          parentRight.addChild(newLB,newRight);
          newRight.parent=parentRight;
        }
 else {
          parent.addChild(newLB,newRight);
        }
        parent=(InternalNode<K,V>)parent.parent;
        newRight=parentRight;
      }
      if (parent == null) {
        Node<K,V> newRoot=new InternalNode<K,V>(root,newRight);
        root.parent=newRoot;
        newRight.parent=newRoot;
        root=newRoot;
      }
    }
  }
 else {
    root=new LeafNode<K,V>(key,value);
  }
  System.out.println(root);
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public V put(K key,V value){
  Node<K,V> currentNode=root;
  while (currentNode instanceof InternalNode) {
    currentNode=currentNode.getChild(key).left();
  }
  if (currentNode != null) {
    LeafNode<K,V> leaf=(LeafNode<K,V>)currentNode;
    if (!leaf.addValue(key,value)) {
      LeafNode<K,V> right=leaf.split().right();
      if (key.compareTo(right.lowerBound()) >= 0) {
        right.addValue(key,value);
      }
 else {
        leaf.addValue(key,value);
      }
      Node<K,V> newRight=right;
      InternalNode<K,V> parent=(InternalNode<K,V>)right.parent;
      while (parent != null && !parent.addChild(newRight.lowerBound(),newRight)) {
        InternalNode<K,V> parentRight=parent.split().left();
        K newLB=newRight.lowerBound();
        if (newLB.compareTo(parentRight.lowerBound()) >= 0) {
          parentRight.addChild(newLB,newRight);
          newRight.parent=parentRight;
        }
 else {
          parent.addChild(newLB,newRight);
        }
        parent=(InternalNode<K,V>)parent.parent;
        newRight=parentRight;
      }
      if (parent == null) {
        Node<K,V> newRoot=new InternalNode<K,V>(root,newRight);
        root.parent=newRoot;
        newRight.parent=newRoot;
        root=newRoot;
      }
    }
  }
 else {
    root=new LeafNode<K,V>(key,value);
  }
  return null;
}
Program: 178850
Project: 178850
Buggy source:
/** 
 * {@inheritDoc} 
 */
public Union.Left<InternalNode<K,V>,LeafNode<K,V>> split(){
  InternalNode<K,V> newNode;
  newNode=new InternalNode<K,V>(Arrays.copyOfRange(this.keys,(1 + keys.length) / 2,numKeysPerNode),Arrays.copyOfRange(this.children,(1 + children.length) / 2,children.length),this.parent,this.next);
  this.next=newNode;
  this.numKeys=(1 + keys.length) / 2;
  return new Union.Left<InternalNode<K,V>,LeafNode<K,V>>(newNode);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public Union.Left<InternalNode<K,V>,LeafNode<K,V>> split(){
  InternalNode<K,V> newNode;
  newNode=new InternalNode<K,V>(Arrays.copyOfRange(this.keys,(1 + keys.length) / 2,numKeysPerNode),Arrays.copyOfRange(this.children,(1 + children.length) / 2,children.length),this.parent,this.next);
  this.next=newNode;
  this.numKeys=(1 + keys.length) / 2;
  newNode.numKeys=keys.length - numKeys;
  return new Union.Left<InternalNode<K,V>,LeafNode<K,V>>(newNode);
}
Program: 178851
Project: 178851
Buggy source:
public String toString(){
  String output="String_Node_Str";
  for (int i=0; i < numKeys; ++i) {
    output+=children[i].toString() + "String_Node_Str";
  }
  return output + "String_Node_Str";
}

Fixed version (ground truth):
public String toString(){
  String output="String_Node_Str";
  output+="String_Node_Str" + children[0].toString() + "String_Node_Str";
  for (int i=0; i < numKeys; ++i) {
    output+=keys[i] + "String_Node_Str" + children[i + 1].toString();
    if (i < numKeys)     output+="String_Node_Str";
  }
  return output + "String_Node_Str";
}
Program: 178852
Project: 178852
Buggy source:
/** 
 * Inserts a new childNode into this node. <b>Assumes that there is room to store the extra key.</b>
 * @param key The key corresponding to the <b>childNode</b>.
 * @param childNode The node that the <b>key</b> should map to.
 */
public boolean addChild(K key,Node<K,V> childNode){
  if (numKeys < keys.length) {
    int sentry=0;
    while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
      sentry++;
    }
    if (sentry <= numKeys) {
      numKeys++;
      int end=numKeys;
      while (end != sentry) {
        keys[end]=keys[end - 1];
        end--;
      }
      keys[sentry]=key;
      children[sentry]=childNode;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Inserts a new childNode into this node. <b>Assumes that there is room to store the extra key.</b>
 * @param key The key corresponding to the <b>childNode</b>.
 * @param childNode The node that the <b>key</b> should map to.
 */
public boolean addChild(K key,Node<K,V> childNode){
  if (numKeys < keys.length) {
    int sentry=0;
    while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
      sentry++;
    }
    if (sentry < numKeysPerNode) {
      int end=numKeys;
      while (end != sentry) {
        keys[end]=keys[end - 1];
        children[end + 1]=children[end];
        --end;
      }
      keys[sentry]=key;
      children[sentry + 1]=childNode;
      numKeys++;
      return true;
    }
  }
  return false;
}
Program: 178853
Project: 178853
Buggy source:
/** 
 * {@inheritDoc} 
 */
public Union.Right<InternalNode<K,V>,LeafNode<K,V>> split(){
  LeafNode<K,V> newNode;
  newNode=new LeafNode<K,V>(Arrays.copyOfRange(this.keys,(1 + keys.length) / 2,numKeysPerNode),Arrays.copyOfRange(this.children,(1 + keys.length) / 2,keys.length),this.parent,this.next);
  this.next=newNode;
  this.numKeys=(1 + keys.length) / 2;
  return new Union.Right<InternalNode<K,V>,LeafNode<K,V>>(newNode);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public Union.Right<InternalNode<K,V>,LeafNode<K,V>> split(){
  LeafNode<K,V> newNode;
  newNode=new LeafNode<K,V>(Arrays.copyOfRange(this.keys,(1 + keys.length) / 2,numKeysPerNode),Arrays.copyOfRange(this.children,(1 + keys.length) / 2,keys.length),this.parent,this.next);
  this.next=newNode;
  this.numKeys=(1 + keys.length) / 2;
  newNode.numKeys=keys.length - numKeys;
  return new Union.Right<InternalNode<K,V>,LeafNode<K,V>>(newNode);
}
Program: 178854
Project: 178854
Buggy source:
/** 
 * Adds a key:value pair to the current LeafNode.
 * @param key The key of the value to add
 * @param value The value of the key to add.
 * @return True if success, false otherwise.
 */
@SuppressWarnings({"String_Node_Str"}) public boolean addValue(K key,V value){
  int i=0;
  while (i < numKeys && key.compareTo(keys[i]) < 0) {
    ++i;
  }
  if (keys[i].compareTo(key) == 0) {
    children[i]=value;
  }
 else   if (numKeys != numKeysPerNode) {
    for (int j=numKeys; j > i; --j) {
      keys[j]=keys[j - 1];
      children[j]=children[j - 1];
    }
    keys[i]=key;
    children[i]=value;
    numKeys++;
  }
 else {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Adds a key:value pair to the current LeafNode.
 * @param key The key of the value to add
 * @param value The value of the key to add.
 * @return True if success, false otherwise.
 */
@SuppressWarnings({"String_Node_Str"}) public boolean addValue(K key,V value){
  int i=0;
  while (i < numKeys && keys[i].compareTo(key) < 0) {
    ++i;
  }
  if (i != numKeys && keys[i].compareTo(key) == 0) {
    children[i]=value;
  }
 else   if (numKeys != numKeysPerNode) {
    for (int j=numKeys; j > i; --j) {
      keys[j]=keys[j - 1];
      children[j]=children[j - 1];
    }
    keys[i]=key;
    children[i]=value;
    numKeys++;
  }
 else {
    return false;
  }
  return true;
}
Program: 178855
Project: 178855
Buggy source:
/** 
 * Test to make sure that the   {@link BTree} doesn't crash when we tryto insert things into it.
 * @param tree The BTree that we'll be (barely) testing.
 */
public static void testInsertion(BTree<Integer,Integer> tree){
  for (int i=0; i < 100; i++) {
    System.out.println(i + "String_Node_Str" + (i * 10));
    tree.put(i,i * 10);
  }
}

Fixed version (ground truth):
/** 
 * Test to make sure that the   {@link BTree} doesn't crash when we tryto insert things into it.
 * @param tree The BTree that we'll be (barely) testing.
 */
public static void testInsertion(BTree<Integer,Integer> tree){
  for (int i=0; i < 100; i++) {
    System.out.println(i + "String_Node_Str" + (i * 10));
    tree.put(i,i * 10);
    if (i <= 11) {
      System.out.println(tree);
    }
  }
}
Program: 178857
Project: 178857
Buggy source:
/** 
 * {@inheritDoc} 
 */
public V remove(K key){
  assert(false);
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public V remove(K key){
  V oldVal=get(key);
  if (oldVal != null) {
    put(key,null);
  }
  return oldVal;
}
Program: 178858
Project: 178858
Buggy source:
/** 
 * Get a child node of this node.
 * @param key The key to get the child of.
 * @return A Node in a Union.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Left<Node<K,V>,V> getChild(K key){
  int sentry=0;
  while (sentry < numKeys && keys[sentry].compareTo(key) <= 0) {
    sentry++;
  }
  System.out.println(this + "String_Node_Str" + key+ "String_Node_Str"+ sentry+ children[sentry]);
  return new Union.Left<Node<K,V>,V>(children[sentry]);
}

Fixed version (ground truth):
/** 
 * Get a child node of this node.
 * @param key The key to get the child of.
 * @return A Node in a Union.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Left<Node<K,V>,V> getChild(K key){
  int sentry=0;
  while (sentry < numKeys && keys[sentry].compareTo(key) <= 0) {
    sentry++;
  }
  return new Union.Left<Node<K,V>,V>(children[sentry]);
}
Program: 178859
Project: 178859
Buggy source:
public InternalNode(K[] keys,Node<K,V>[] children,Node<K,V> parent,Node<K,V> next){
  super(keys,parent);
  this.children=(Node<K,V>[])Arrays.copyOf((Node<K,V>[])children,numKeysPerNode + 1);
  this.next=next;
}

Fixed version (ground truth):
public InternalNode(K[] keys,Node<K,V>[] children,Node<K,V> parent,Node<K,V> next){
  super(keys,parent,next);
  this.children=(Node<K,V>[])Arrays.copyOf((Node<K,V>[])children,numKeysPerNode + 1);
}
Program: 178860
Project: 178860
Buggy source:
/** 
 * Inserts a new childNode into this node. <b>Assumes that there is room to store the extra key.</b>
 * @param key The key corresponding to the <b>childNode</b>.
 * @param childNode The node that the <b>key</b> should map to.
 */
public boolean addChild(K key,Node<K,V> childNode){
  if (numKeys < numKeysPerNode) {
    int sentry=0;
    while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
      sentry++;
    }
    System.out.println(this + "String_Node_Str" + key+ "String_Node_Str"+ (sentry + 1)+ children[sentry + 1]);
    if (sentry < numKeysPerNode) {
      int end=numKeys;
      while (end != sentry) {
        keys[end]=keys[end - 1];
        children[end + 1]=children[end];
        --end;
      }
      keys[sentry]=key;
      children[sentry + 1]=childNode;
      numKeys++;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Inserts a new childNode into this node. <b>Assumes that there is room to store the extra key.</b>
 * @param key The key corresponding to the <b>childNode</b>.
 * @param childNode The node that the <b>key</b> should map to.
 */
public boolean addChild(K key,Node<K,V> childNode){
  if (numKeys < numKeysPerNode) {
    int sentry=0;
    while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
      sentry++;
    }
    if (sentry < numKeysPerNode) {
      int end=numKeys;
      while (end != sentry) {
        keys[end]=keys[end - 1];
        children[end + 1]=children[end];
        --end;
      }
      keys[sentry]=key;
      children[sentry + 1]=childNode;
      numKeys++;
      return true;
    }
  }
  return false;
}
Program: 178861
Project: 178861
Buggy source:
private LeafNode(K[] keys,V[] values,Node<K,V> parent,Node<K,V> next){
  super(keys,parent);
  children=Arrays.copyOf(values,numKeysPerNode + 2);
  this.next=next;
}

Fixed version (ground truth):
private LeafNode(K[] keys,V[] values,Node<K,V> parent,Node<K,V> next){
  super(keys,parent,next);
  children=Arrays.copyOf(values,numKeysPerNode + 2);
}
Program: 178862
Project: 178862
Buggy source:
/** 
 * Get the child of the given key.
 * @param key The key to get the child of.
 * @return A node in a Union or null.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Right<Node<K,V>,V> getChild(K key){
  int i=0;
  while (i < numKeys && keys[i].compareTo(key) < 0) {
    ++i;
  }
  if (keys[i] != null && keys[i].equals(key)) {
    return new Union.Right<Node<K,V>,V>(children[i]);
  }
 else {
    return new Union.Right<Node<K,V>,V>(null);
  }
}

Fixed version (ground truth):
/** 
 * Get the child of the given key.
 * @param key The key to get the child of.
 * @return A node in a Union or null.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Right<Node<K,V>,V> getChild(K key){
  int i=0;
  while (i < numKeys && keys[i].compareTo(key) < 0) {
    ++i;
  }
  if (i < numKeysPerNode && keys[i] != null && keys[i].equals(key)) {
    return new Union.Right<Node<K,V>,V>(children[i]);
  }
 else {
    return new Union.Right<Node<K,V>,V>(null);
  }
}
Program: 178863
Project: 178863
Buggy source:
/** 
 * Creates a node with the given keys and parent.
 * @param keys The keys in this node.
 * @param parent The parent node.
 */
protected Node(K[] keys,Node<K,V> parent){
  this.keys=Arrays.copyOf(keys,numKeysPerNode);
  numKeys=keys.length;
  this.parent=parent;
}

Fixed version (ground truth):
/** 
 * Creates a node with the given keys and parent.
 * @param keys The keys in this node.
 * @param parent The parent node.
 */
protected Node(K[] keys,Node<K,V> parent,Node<K,V> next){
  this.keys=Arrays.copyOf(keys,numKeysPerNode);
  numKeys=keys.length;
  this.parent=parent;
  this.next=next;
}
Program: 178865
Project: 178865
Buggy source:
/** 
 * Get a child node of this node.
 * @param key The key to get the child of.
 * @return A Node in a Union.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Left<Node<K,V>,V> getChild(K key){
  int sentry=0;
  while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
    sentry++;
  }
  return new Union.Left<Node<K,V>,V>(children[sentry]);
}

Fixed version (ground truth):
/** 
 * Get a child node of this node.
 * @param key The key to get the child of.
 * @return A Node in a Union.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Left<Node<K,V>,V> getChild(K key){
  int sentry=0;
  while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
    sentry++;
  }
  System.out.println(this + "String_Node_Str" + key+ "String_Node_Str"+ sentry+ children[sentry]);
  return new Union.Left<Node<K,V>,V>(children[sentry]);
}
Program: 178866
Project: 178866
Buggy source:
public InternalNode(K[] keys,Node<K,V>[] children,Node<K,V> parent,Node<K,V> next){
  super(keys,parent);
  this.children=Arrays.copyOf(children,numKeysPerNode + 1);
  this.next=next;
}

Fixed version (ground truth):
public InternalNode(K[] keys,Node<K,V>[] children,Node<K,V> parent,Node<K,V> next){
  super(keys,parent);
  this.children=(Node<K,V>[])Arrays.copyOf((Node<K,V>[])children,numKeysPerNode + 1);
  this.next=next;
}
Program: 178867
Project: 178867
Buggy source:
/** 
 * Inserts a new childNode into this node. <b>Assumes that there is room to store the extra key.</b>
 * @param key The key corresponding to the <b>childNode</b>.
 * @param childNode The node that the <b>key</b> should map to.
 */
public boolean addChild(K key,Node<K,V> childNode){
  if (numKeys < numKeysPerNode) {
    int sentry=0;
    while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
      sentry++;
    }
    if (sentry < numKeysPerNode) {
      int end=numKeys;
      while (end != sentry) {
        keys[end]=keys[end - 1];
        children[end + 1]=children[end];
        --end;
      }
      keys[sentry]=key;
      children[sentry + 1]=childNode;
      numKeys++;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Inserts a new childNode into this node. <b>Assumes that there is room to store the extra key.</b>
 * @param key The key corresponding to the <b>childNode</b>.
 * @param childNode The node that the <b>key</b> should map to.
 */
public boolean addChild(K key,Node<K,V> childNode){
  if (numKeys < numKeysPerNode) {
    int sentry=0;
    while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
      sentry++;
    }
    System.out.println(this + "String_Node_Str" + key+ "String_Node_Str"+ (sentry + 1)+ children[sentry + 1]);
    if (sentry < numKeysPerNode) {
      int end=numKeys;
      while (end != sentry) {
        keys[end]=keys[end - 1];
        children[end + 1]=children[end];
        --end;
      }
      keys[sentry]=key;
      children[sentry + 1]=childNode;
      numKeys++;
      return true;
    }
  }
  return false;
}
Program: 178868
Project: 178868
Buggy source:
/** 
 * {@inheritDoc} 
 */
public Union.Right<InternalNode<K,V>,LeafNode<K,V>> split(K key,V value){
  LeafNode<K,V> newNode=new LeafNode<K,V>(Arrays.copyOfRange(this.keys,(numKeysPerNode) / 2,numKeysPerNode),Arrays.copyOfRange(this.children,numKeysPerNode / 2,numKeysPerNode),this.parent,this.next);
  this.next=newNode;
  this.numKeys=numKeysPerNode / 2;
  newNode.numKeys=numKeysPerNode / 2;
  if (key.compareTo(newNode.lowerBound()) > 0) {
    newNode.addValue(key,value);
  }
 else {
    addValue(key,value);
  }
  return new Union.Right<InternalNode<K,V>,LeafNode<K,V>>(newNode);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public Union.Right<InternalNode<K,V>,LeafNode<K,V>> split(K key,V value){
  LeafNode<K,V> newNode=new LeafNode<K,V>(Arrays.copyOfRange(this.keys,(numKeysPerNode) / 2,numKeysPerNode),Arrays.copyOfRange(this.children,numKeysPerNode / 2,numKeysPerNode),this.parent,this.next);
  this.next=newNode;
  this.numKeys=numKeysPerNode / 2;
  newNode.numKeys=numKeysPerNode / 2;
  if (key.compareTo(newNode.lowerBound()) >= 0) {
    newNode.addValue(key,value);
  }
 else {
    addValue(key,value);
  }
  return new Union.Right<InternalNode<K,V>,LeafNode<K,V>>(newNode);
}
Program: 178869
Project: 178869
Buggy source:
/** 
 * {@inheritDoc} 
 */
public V put(K key,V value){
  Node<K,V> currentNode=root;
  while (currentNode instanceof InternalNode) {
    currentNode=currentNode.getChild(key).left();
  }
  if (currentNode != null) {
    LeafNode<K,V> leaf=(LeafNode<K,V>)currentNode;
    if (!leaf.addValue(key,value)) {
      LeafNode<K,V> right=leaf.split(key,value).right();
      Node<K,V> newRight=right;
      InternalNode<K,V> parent=(InternalNode<K,V>)right.parent;
      K addToParent=newRight.lowerBound();
      System.out.println(addToParent);
      while (parent != null && !parent.addChild(addToParent,newRight)) {
        InternalNode<K,V> parentRight=(InternalNode<K,V>)parent.split(addToParent,newRight).left();
        K addToParentNew=parent.getMiddleKey();
        addToParent=addToParentNew;
        parent=(InternalNode<K,V>)parent.parent;
        newRight=parentRight;
      }
      if (parent == null) {
        Node<K,V> newRoot=new InternalNode<K,V>(root,newRight,addToParent);
        root.parent=newRoot;
        newRight.parent=newRoot;
        root=newRoot;
      }
    }
  }
 else {
    root=new LeafNode<K,V>(key,value);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public V put(K key,V value){
  if (root != null)   System.out.println("String_Node_Str" + root.getClass());
  Node<K,V> currentNode=root;
  while (currentNode instanceof InternalNode) {
    currentNode=currentNode.getChild(key).left();
  }
  if (currentNode != null) {
    LeafNode<K,V> leaf=(LeafNode<K,V>)currentNode;
    if (!leaf.addValue(key,value)) {
      LeafNode<K,V> right=leaf.split(key,value).right();
      Node<K,V> newRight=right;
      System.out.println("String_Node_Str" + right);
      InternalNode<K,V> parent=(InternalNode<K,V>)right.parent;
      K addToParent=newRight.lowerBound();
      if (parent != null)       System.out.println("String_Node_Str" + newRight.upperUpper() + "String_Node_Str"+ parent.upperUpper());
      System.out.println("String_Node_Str" + addToParent + "String_Node_Str");
      while (parent != null) {
        if (newRight.upperUpper().compareTo(parent.upperUpper()) > 0) {
          if (parent != root) {
            parent=(InternalNode<K,V>)parent.parent;
            continue;
          }
        }
        if (parent.addChild(addToParent,newRight)) {
          break;
        }
        InternalNode<K,V> parentRight=(InternalNode<K,V>)parent.split(addToParent,newRight).left();
        K addToParentNew=parent.getMiddleKey();
        addToParent=addToParentNew;
        parent=(InternalNode<K,V>)parent.parent;
        newRight=parentRight;
      }
      if (parent == null) {
        Node<K,V> newRoot=new InternalNode<K,V>(root,newRight,addToParent);
        root.parent=newRoot;
        newRight.parent=newRoot;
        root=newRoot;
      }
    }
  }
 else {
    root=new LeafNode<K,V>(key,value);
  }
  return null;
}
Program: 178870
Project: 178870
Buggy source:
/** 
 * like   {@link testInsertion}, but tests for correctness.
 * @throws RuntimeException If an error is found. Read the exception'smessage for details.
 */
public static void testInsertionCorrectness(BTree<Integer,Integer> tree){
  for (int i=0; i < 100; i++) {
    tree.put(i,i * 10);
    if (tree.get(i) != i * 10) {
      throw new RuntimeException("String_Node_Str" + i + "String_Node_Str"+ i * 10 + "String_Node_Str" + tree.get(i) + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * like   {@link testInsertion}, but tests for correctness.
 * @throws RuntimeException If an error is found. Read the exception'smessage for details.
 */
public static void testInsertionCorrectness(BTree<Integer,Integer> tree){
  System.out.println("String_Node_Str");
  for (int i=0; i < 100; i++) {
    System.out.println(i + "String_Node_Str" + (i * 10));
    tree.put(i,i * 10);
    System.out.println(tree);
    if (tree.get(i) != i * 10) {
      throw new RuntimeException("String_Node_Str" + i + "String_Node_Str"+ i * 10 + "String_Node_Str" + tree.get(i) + "String_Node_Str");
    }
  }
}
Program: 178871
Project: 178871
Buggy source:
public static void main(String[] args) throws IOException {
  Comm.init(args);
  BTree<Integer,Integer> seqBTree=new BTreeSeq<Integer,Integer>();
  Integer k=new Integer(1);
  Integer v=new Integer(11);
  LeafNode<Integer,Integer> root=new LeafNode<Integer,Integer>(k,v);
  root.addValue(new Integer(2),new Integer(11));
  root.addValue(new Integer(3),new Integer(11));
  root.addValue(new Integer(4),new Integer(11));
  root.addValue(new Integer(5),new Integer(11));
  root.addValue(new Integer(6),new Integer(11));
  root.addValue(new Integer(7),new Integer(11));
  root.addValue(new Integer(8),new Integer(11));
  if (false) {
    testInsertion(seqBTree);
    seqBTree.clear();
    testInsertionCorrectness(seqBTree);
    seqBTree.clear();
    System.out.println(seqBTree.getClass().toString() + "String_Node_Str" + stressTestInsertion(seqBTree)+ "String_Node_Str");
  }
  testInternalNodeSplitting();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  Comm.init(args);
  BTree<Integer,Integer> seqBTree=new BTreeSeq<Integer,Integer>();
  Integer k=new Integer(1);
  Integer v=new Integer(11);
  LeafNode<Integer,Integer> root=new LeafNode<Integer,Integer>(k,v);
  root.addValue(new Integer(2),new Integer(11));
  root.addValue(new Integer(3),new Integer(11));
  root.addValue(new Integer(4),new Integer(11));
  root.addValue(new Integer(5),new Integer(11));
  root.addValue(new Integer(6),new Integer(11));
  root.addValue(new Integer(7),new Integer(11));
  root.addValue(new Integer(8),new Integer(11));
  if (true) {
    testInsertion(seqBTree);
    seqBTree.clear();
    testInsertionCorrectness(seqBTree);
    seqBTree.clear();
    System.out.println(seqBTree.getClass().toString() + "String_Node_Str" + stressTestInsertion(seqBTree)+ "String_Node_Str");
  }
  testInternalNodeSplitting();
}
Program: 178872
Project: 178872
Buggy source:
/** 
 * {@inheritDoc} 
 */
public V put(K key,V value){
  Node<K,V> currentNode=root;
  while (currentNode instanceof InternalNode) {
    currentNode=currentNode.getChild(key).left();
  }
  V oldVal=null;
  if (currentNode != null) {
    LeafNode<K,V> leaf=(LeafNode<K,V>)currentNode;
    oldVal=leaf.getChild(key).right();
    if (!leaf.addValue(key,value)) {
      LeafNode<K,V> right=leaf.split(key,value).right();
      Node<K,V> newRight=right;
      InternalNode<K,V> parent=(InternalNode<K,V>)right.parent;
      K addToParent=newRight.lowerBound();
      if (parent != null)       while (parent != null) {
        if (newRight.upperUpper().compareTo(parent.upperUpper()) > 0) {
          if (parent != root) {
            parent=(InternalNode<K,V>)parent.parent;
            continue;
          }
        }
        if (parent.addChild(addToParent,newRight)) {
          break;
        }
        InternalNode<K,V> parentRight=(InternalNode<K,V>)parent.split(addToParent,newRight).left();
        K addToParentNew=parent.getMiddleKey();
        addToParent=addToParentNew;
        parent=(InternalNode<K,V>)parent.parent;
        newRight=parentRight;
      }
      if (parent == null) {
        Node<K,V> newRoot=new InternalNode<K,V>(root,newRight,addToParent);
        root.parent=newRoot;
        newRight.parent=newRoot;
        root=newRoot;
      }
    }
  }
 else {
    root=new LeafNode<K,V>(key,value);
  }
  return oldVal;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public V put(K key,V value){
  Node<K,V> currentNode=root;
  while (currentNode instanceof InternalNode) {
    currentNode=currentNode.getChild(key).left();
  }
  V oldVal=null;
  if (currentNode != null) {
    LeafNode<K,V> leaf=(LeafNode<K,V>)currentNode;
    oldVal=leaf.getChild(key).right();
    if (!leaf.addValue(key,value)) {
      LeafNode<K,V> right=leaf.split(key,value).right();
      Node<K,V> newRight=right;
      InternalNode<K,V> parent=(InternalNode<K,V>)right.parent;
      K addToParent=newRight.lowerBound();
      if (parent != null)       while (parent != null) {
        if (parent.addChild(addToParent,newRight)) {
          break;
        }
        InternalNode<K,V> parentRight=(InternalNode<K,V>)parent.split(addToParent,newRight).left();
        K addToParentNew=parent.getMiddleKey();
        addToParent=addToParentNew;
        parent=(InternalNode<K,V>)parent.parent;
        newRight=parentRight;
      }
      if (parent == null) {
        Node<K,V> newRoot=new InternalNode<K,V>(root,newRight,addToParent);
        root.parent=newRoot;
        newRight.parent=newRoot;
        root=newRoot;
      }
    }
  }
 else {
    root=new LeafNode<K,V>(key,value);
  }
  return oldVal;
}
Program: 178873
Project: 178873
Buggy source:
public InternalNode(K[] keys,Node<K,V>[] children,Node<K,V> parent,Node<K,V> next){
  super(keys,parent,next);
  this.children=(Node<K,V>[])Arrays.copyOf((Node<K,V>[])children,numKeysPerNode + 1);
}

Fixed version (ground truth):
public InternalNode(K[] keys,Node<K,V>[] children,int numKeys,Node<K,V> parent,Node<K,V> next){
  super(keys,numKeys,parent,next);
  this.children=(Node<K,V>[])Arrays.copyOf((Node<K,V>[])children,numKeysPerNode + 2);
  for (int i=0; i <= numKeys; ++i) {
    children[i].parent=this;
  }
}
Program: 178874
Project: 178874
Buggy source:
/** 
 * {@inheritDoc} 
 */
public Union.Right<InternalNode<K,V>,LeafNode<K,V>> split(K key,V value){
  LeafNode<K,V> newNode=new LeafNode<K,V>(Arrays.copyOfRange(this.keys,(numKeysPerNode) / 2,numKeysPerNode),Arrays.copyOfRange(this.children,numKeysPerNode / 2,numKeysPerNode),this.parent,this.next);
  this.next=newNode;
  this.numKeys=numKeysPerNode / 2;
  newNode.numKeys=numKeysPerNode / 2;
  if (key.compareTo(newNode.lowerBound()) >= 0) {
    newNode.addValue(key,value);
  }
 else {
    addValue(key,value);
  }
  return new Union.Right<InternalNode<K,V>,LeafNode<K,V>>(newNode);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public Union.Right<InternalNode<K,V>,LeafNode<K,V>> split(K key,V value){
  LeafNode<K,V> newNode=new LeafNode<K,V>(Arrays.copyOfRange(this.keys,(numKeysPerNode) / 2,numKeysPerNode),Arrays.copyOfRange(this.children,numKeysPerNode / 2,numKeysPerNode),numKeysPerNode / 2,this.parent,this.next);
  this.next=newNode;
  this.numKeys=numKeysPerNode / 2;
  if (key.compareTo(newNode.lowerBound()) >= 0) {
    newNode.addValue(key,value);
  }
 else {
    addValue(key,value);
  }
  return new Union.Right<InternalNode<K,V>,LeafNode<K,V>>(newNode);
}
Program: 178875
Project: 178875
Buggy source:
private LeafNode(K[] keys,V[] values,Node<K,V> parent,Node<K,V> next){
  super(keys,parent,next);
  children=Arrays.copyOf(values,numKeysPerNode + 2);
}

Fixed version (ground truth):
private LeafNode(K[] keys,V[] values,int numKeys,Node<K,V> parent,Node<K,V> next){
  super(keys,numKeys,parent,next);
  children=Arrays.copyOf(values,numKeysPerNode + 2);
}
Program: 178876
Project: 178876
Buggy source:
/** 
 * Creates a node with the given keys and parent.
 * @param keys The keys in this node.
 * @param parent The parent node.
 */
protected Node(K[] keys,Node<K,V> parent,Node<K,V> next){
  this.keys=Arrays.copyOf(keys,numKeysPerNode);
  numKeys=keys.length;
  this.parent=parent;
  this.next=next;
}

Fixed version (ground truth):
/** 
 * Creates a node with the given keys and parent.
 * @param keys The keys in this node.
 * @param parent The parent node.
 */
protected Node(K[] keys,int numKeys,Node<K,V> parent,Node<K,V> next){
  this.keys=Arrays.copyOf(keys,numKeysPerNode + 1);
  this.numKeys=numKeys;
  this.parent=parent;
  this.next=next;
}
Program: 178877
Project: 178877
Buggy source:
/** 
 * Get a child node of this node.
 * @param key The key to get the child of.
 * @return A Node in a Union.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Left<Node<K,V>,V> getChild(K key){
  int sentry=0;
  while (sentry < numKeys && keys[sentry].compareTo(key) < 0) {
    sentry++;
  }
  System.out.println(this + "String_Node_Str" + key+ "String_Node_Str"+ sentry+ children[sentry]);
  return new Union.Left<Node<K,V>,V>(children[sentry]);
}

Fixed version (ground truth):
/** 
 * Get a child node of this node.
 * @param key The key to get the child of.
 * @return A Node in a Union.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Left<Node<K,V>,V> getChild(K key){
  int sentry=0;
  while (sentry < numKeys && keys[sentry].compareTo(key) <= 0) {
    sentry++;
  }
  System.out.println(this + "String_Node_Str" + key+ "String_Node_Str"+ sentry+ children[sentry]);
  return new Union.Left<Node<K,V>,V>(children[sentry]);
}
Program: 178878
Project: 178878
Buggy source:
public Union.Left<Node<K,V>,V> getChild(K key){
  int sentry=0;
  while (keys[sentry].compareTo(key) < 0 && sentry < keys.length) {
    sentry++;
  }
  return new Union.Left<Node<K,V>,V>(children[sentry]);
}

Fixed version (ground truth):
/** 
 * Get a child node of this node.
 * @param key The key to get the child of.
 * @return A Node in a Union.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Left<Node<K,V>,V> getChild(K key){
  int sentry=0;
  while (sentry < keys.length && keys[sentry].compareTo(key) < 0) {
    sentry++;
  }
  return new Union.Left<Node<K,V>,V>(children[sentry]);
}
Program: 178879
Project: 178879
Buggy source:
public InternalNode(K key,Node<K,V> parent){
  super(key,parent);
  children=new Node[numKeysPerNode + 1];
}

Fixed version (ground truth):
/** 
 * Constructs an InternalNode with K as the key and parent as the parent.
 * @param key The initial key in this node.
 * @param parent The parent of this node.
 */
@SuppressWarnings({"String_Node_Str"}) public InternalNode(K key,Node<K,V> parent){
  super(key,parent);
  children=new Node[numKeysPerNode + 1];
}
Program: 178880
Project: 178880
Buggy source:
public LeafNode(K key,Node<K,V> parent){
  super(key,parent);
  children=(V[])(new Object[numKeysPerNode + 1]);
}

Fixed version (ground truth):
/** 
 * Constructs a LeafNode with K as the key and parent as the parent.
 * @param key The initial key in this node.
 * @param parent The parent of this node.
 */
@SuppressWarnings({"String_Node_Str"}) public LeafNode(K key,Node<K,V> parent){
  super(key,parent);
  children=(V[])(new Object[numKeysPerNode]);
}
Program: 178881
Project: 178881
Buggy source:
public Union.Right<Node<K,V>,V> getChild(K key){
  return null;
}

Fixed version (ground truth):
/** 
 * Get the child of the given key.
 * @param key The key to get the child of.
 * @return A node in a Union or null.
 */
@SuppressWarnings({"String_Node_Str"}) public Union.Right<Node<K,V>,V> getChild(K key){
  int i=0;
  while (i < numKeysPerNode && keys[i].compareTo(key) < 0) {
    ++i;
  }
  if (keys[i].equals(key)) {
    return new Union.Right<Node<K,V>,V>(children[i]);
  }
 else {
    return new Union.Right<Node<K,V>,V>(null);
  }
}
Program: 178882
Project: 178882
Buggy source:
/** 
 * {@inheritDoc} 
 */
public V get(K key){
  Node<K,V> currentNode=root;
  while (currentNode instanceof InternalNode) {
    if (currentNode == null) {
      return null;
    }
 else {
      currentNode=currentNode.getChild(key).left();
    }
  }
  if (currentNode instanceof LeafNode) {
    return currentNode.getChild(key).right();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public V get(K key){
  Node<K,V> currentNode=root;
  while (currentNode instanceof InternalNode) {
    currentNode=currentNode.getChild(key).left();
  }
  if (currentNode instanceof LeafNode) {
    return currentNode.getChild(key).right();
  }
 else {
    return null;
  }
}
Program: 178883
Project: 178883
Buggy source:
/** 
 * Constructs a LeafNode with K as the key and parent as the parent.
 * @param key The initial key in this node.
 * @param parent The parent of this node.
 */
@SuppressWarnings({"String_Node_Str"}) public LeafNode(K key,Node<K,V> parent){
  super(key,parent);
  children=(V[])(new Object[numKeysPerNode]);
}

Fixed version (ground truth):
/** 
 * Constructs a LeafNode with K as the key and parent as the parent.
 * @param key The initial key in this node.
 * @param parent The parent of this node.
 */
@SuppressWarnings({"String_Node_Str"}) public LeafNode(K key,V value,Node<K,V> parent){
  super(key,parent);
  children=(V[])(Array.newInstance(value.getClass(),numKeysPerNode));
  children[0]=value;
}
Program: 178884
Project: 178884
Buggy source:
@SuppressWarnings({"String_Node_Str"}) public Node(K key,Node<K,V> parent){
  keys=(K[])(new Object[numKeysPerNode]);
  numKeys=0;
  this.parent=parent;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public Node(K key,Node<K,V> parent){
}