if (sortfun != null) { tasks = (ArrayList)Sortings.sort(tasks, sortfun);
Collection packGroups = groupByAggregationClosure(tasks);   for (Iterator iterator = packGroups.iterator(); iterator.hasNext();) { ArrayList packList = (ArrayList) iterator.next();  if (sortfun != null) { packList = (ArrayList)Sortings.sort(packList, sortfun); }  if (DEBUG) { System.out.println("Packer: about to build the sizer in doPacking."); }  AggregationClosure ac = getAggregationClosure(packList);   Sizer sz = new Sizer(packList, this);  if (DEBUG) { System.out.println("Packer: about to build the filler in doPacking."); }   Filler fil = new Filler(sz, this, ac, ard, prefagg);  if (DEBUG) { System.out.println("Packer: about to run the wheelz in doPacking."); }   fil.execute();
  protected boolean doPacking(AggregationClosure ac,                              ArrayList tasks,                              Comparator sortfun,                              PreferenceAggregator prefagg,                              AllocationResultDistributor ard) {        // sort them, if appropriate    if (sortfun != null) {      tasks = (ArrayList)Sortings.sort(tasks, sortfun);    }    if (DEBUG) {      System.out.println("Packer: about to build the sizer in doPacking.");    }    // now we set the double wheel going...    Sizer sz = new Sizer(tasks, this);    if (DEBUG) {      System.out.println("Packer: about to build the filler in doPacking.");    }    Filler fil = new Filler(sz, this, ac, ard, prefagg);    if (DEBUG) {      System.out.println("Packer: about to run the wheelz in doPacking.");    }    boolean success;    try {      fil.execute();      success = true;    } catch (java.lang.Exception e) {      System.err.println("Packer: Failure in attempt to pack.");      System.err.println("Packer: Exception was:");      System.err.println(e);      e.printStackTrace();      success = false;    } finally {    }	         // indicate that the action succeeded.    return success;  }