Program: 48649
Project: 48649
Buggy source:
/** 
 * Show a table(include table column names and table contents) by left justifying. More specifically, the   {@code columnNamesWithGetMethodNames}argument is a map struct, the key is table column name and value is method name list which it will be invoked by reflection. The   {@code entities}argument is traversed entity array.It is source of table data. In addition,the method name must be each of the   {@code entities} argument 'smember. The  {@code spacesBeforeStart} argument is whitespace in the frontof the row. <p>
 * @param columnNamesWithGetMethodNames the container of table column name and invoked method name.
 * @param entities the traversed entity array.
 * @param spacesBeforeStart the whitespace in the front of the row.
 * @throws Exception
 */
public static void printInTableFormat(LinkedHashMap<String,List<String>> columnNamesWithGetMethodNames,Object[] entities,String spacesBeforeStart) throws Exception {
  if (entities != null && entities.length > 0) {
    int columnNum=columnNamesWithGetMethodNames.size();
    String[][] table=new String[entities.length + 1][columnNum];
    String[] tableHeader=new String[columnNum];
    Set<String> columnNames=columnNamesWithGetMethodNames.keySet();
    columnNames.toArray(tableHeader);
    table[0]=tableHeader;
    Collection<List<String>> getMethodNamesCollect=columnNamesWithGetMethodNames.values();
    int i=1;
    for (    Object entity : entities) {
      int j=0;
      for (      List<String> getMethodNames : getMethodNamesCollect) {
        Object tempValue=null;
        int k=0;
        for (        String methodName : getMethodNames) {
          if (tempValue == null)           tempValue=entity;
          Object value=tempValue.getClass().getMethod(methodName).invoke(tempValue);
          if (k == getMethodNames.size() - 1) {
            table[i][j]=value == null ? "String_Node_Str" : ((value instanceof Double) ? String.valueOf(round(((Double)value).doubleValue(),2,BigDecimal.ROUND_FLOOR)) : value.toString());
            j++;
          }
 else {
            tempValue=value;
            k++;
          }
        }
      }
      i++;
    }
    printTable(table,spacesBeforeStart);
  }
}

Fixed version (ground truth):
/** 
 * Show a table(include table column names and table contents) by left justifying. More specifically, the   {@code columnNamesWithGetMethodNames}argument is a map struct, the key is table column name and value is method name list which it will be invoked by reflection. The   {@code entities}argument is traversed entity array.It is source of table data. In addition,the method name must be each of the   {@code entities} argument 'smember. The  {@code spacesBeforeStart} argument is whitespace in the frontof the row. <p>
 * @param columnNamesWithGetMethodNames the container of table column name and invoked method name.
 * @param entities the traversed entity array.
 * @param spacesBeforeStart the whitespace in the front of the row.
 * @throws Exception
 */
public static void printInTableFormat(LinkedHashMap<String,List<String>> columnNamesWithGetMethodNames,Object[] entities,String spacesBeforeStart) throws Exception {
  if (entities != null && entities.length > 0) {
    int columnNum=columnNamesWithGetMethodNames.size();
    String[][] table=new String[entities.length + 1][columnNum];
    String[] tableHeader=new String[columnNum];
    Set<String> columnNames=columnNamesWithGetMethodNames.keySet();
    columnNames.toArray(tableHeader);
    table[0]=tableHeader;
    Collection<List<String>> getMethodNamesCollect=columnNamesWithGetMethodNames.values();
    int i=1;
    for (    Object entity : entities) {
      int j=0;
      for (      List<String> getMethodNames : getMethodNamesCollect) {
        Object tempValue=null;
        int k=0;
        for (        String methodName : getMethodNames) {
          if (tempValue == null)           tempValue=entity;
          Object value=tempValue.getClass().getMethod(methodName).invoke(tempValue);
          if (k == getMethodNames.size() - 1) {
            table[i][j]=value == null ? "String_Node_Str" : ((value instanceof Double) ? String.valueOf(round(((Double)value).doubleValue(),2,BigDecimal.ROUND_FLOOR)) : value.toString());
            if (isJansiAvailable()) {
              table[i][j]=transcoding(table[i][j]);
            }
            j++;
          }
 else {
            tempValue=value;
            k++;
          }
        }
      }
      i++;
    }
    printTable(table,spacesBeforeStart);
  }
}