Program: 41060
Project: 41060
Buggy source:
/** 
 * Merges into existing structured tables a set of   {@link TabValueGroup}s, typically the values provided with by   {@link Node#getTabValues()}, i.e., the contribute that a node gives to the final resulting table. For instance, if so fare we have built a (structured) table with the headers:  Sample Name, Characteristics [�Organism ], Characteristics [ Organ Part ]� and a new node arrives that contains: Sample Name, ( Characteristics [ Organism ], ( Term Source REF, ( Term Accession ) ) ),  Characteristics [ Sex ] the layer is changed so that it contains the new structure:  Sample Name, ( Characteristics [ Organism ], ( Term Source REF, ( Term Accession ) ) ), Characteristics [ Organ Part ],   Characteristics [ Sex ]. Note the usage of () to mark the nesting of StructuredTable(s) A new row is added to the   {@link #getRows() rows property} of the corresponding StructuredTable that reflects the values of the new node (so, the value is in  {@link #getRows() this.getRows()} or in some other StructuredTable that can be found by recursing over the  {@link #getTail() tail}). Existing headers for which the node has no value to provide with are left null in the new row. 
 */
public static void mergeTabValues(List<StructuredTable> tables,int newSize,List<TabValueGroup> tbvs){
  if (tables == null)   throw new RuntimeException("String_Node_Str");
  if (tbvs == null) {
    mergeNullTabValues(tables,newSize);
    return;
  }
  for (  TabValueGroup tbg : tbvs) {
    String rowHeader=tbg.getHeader();
    boolean done=false;
    for (    StructuredTable table : tables) {
      if (!rowHeader.equals(table.getHeader()))       continue;
      if (table.getRows().size() < newSize) {
        table.addRowValue(tbg.getValue(),newSize);
        mergeTabValues(table.tail,newSize,tbg.getTail());
        done=true;
        break;
      }
    }
    if (done)     continue;
    tables.add(new StructuredTable(tbg,newSize));
  }
}

Fixed version (ground truth):
/** 
 * Merges into existing structured tables a set of   {@link TabValueGroup}s, typically the values provided with by   {@link Node#getTabValues()}, i.e., the contribute that a node gives to the final resulting table. For instance, if so fare we have built a (structured) table with the headers:  Sample Name, Characteristics [�Organism ], Characteristics [ Organ Part ]� and a new node arrives that contains: Sample Name, ( Characteristics [ Organism ], ( Term Source REF, ( Term Accession ) ) ),  Characteristics [ Sex ] the layer is changed so that it contains the new structure:  Sample Name, ( Characteristics [ Organism ], ( Term Source REF, ( Term Accession ) ) ), Characteristics [ Organ Part ],   Characteristics [ Sex ]. Note the usage of () to mark the nesting of StructuredTable(s) A new row is added to the   {@link #getRows() rows property} of the corresponding StructuredTable that reflects the values of the new node (so, the value is in  {@link #getRows() this.getRows()} or in some other StructuredTable that can be found by recursing over the  {@link #getTail() tail}). Existing headers for which the node has no value to provide with are left null in the new row. 
 */
public static void mergeTabValues(List<StructuredTable> tables,int newSize,List<TabValueGroup> tbvs){
  if (tables == null)   throw new RuntimeException("String_Node_Str");
  if (tbvs == null) {
    mergeNullTabValues(tables,newSize);
    return;
  }
  for (  TabValueGroup tbg : tbvs) {
    String rowHeader=tbg.getHeader();
    boolean done=false;
    for (    StructuredTable table : tables) {
      if (rowHeader == null || !rowHeader.equals(table.getHeader()))       continue;
      if (table.getRows().size() < newSize) {
        table.addRowValue(tbg.getValue(),newSize);
        mergeTabValues(table.tail,newSize,tbg.getTail());
        done=true;
        break;
      }
    }
    if (done)     continue;
    tables.add(new StructuredTable(tbg,newSize));
  }
}