Leg li = (Leg)tmpLegs.get(i);
Leg li = (Leg)tmpLegs.get((int)i);
  public static final void computeAllLegs(      Registry toReg,      Collection legTasks) {    if (DEBUG) {      System.out.println("DataComputer.computeAllLegs");    }    // a temporary "helper" list    List tmpLegs = new ArrayList();    // Get all the leg tasks -- i.e. tasks in this cluster    // that have a plan element that is an allocation AND    // that the asset allocated to is a physical asset    Iterator legTaskIter = legTasks.iterator();    for (int n = legTasks.size(); n > 0; n--) {      Task task = (Task)legTaskIter.next();      if (DEBUG) {        System.out.println("DataComputer.computeAllLegs - " +             "Task w/ physical asset: "+             task.getUID().toString());      }      // get the "skeleton" legs for this task      //   later we will fill in the ids, carrier, etc      tmpLegs.clear();      if (!(computeLegs(toReg, tmpLegs, task))) {        // invalid?        continue;      }      int nTmpLegs = tmpLegs.size();      if (nTmpLegs > 0) {        // get the other task-based information        Allocation alloc = (Allocation)task.getPlanElement();        // get the "cargo" == whatever's being moved        Asset cargoAsset = task.getDirectObject();        // get the "carrier" == the conveyer == the mover        Asset carrierAsset = alloc.getAsset();        // register the carrier.  if not already registered then        //   register the instance as self-propelled.        String carrierId =           DataRegistry.registerCarrierInstance(              toReg, carrierAsset, true);        // leg is just "detail" if allocated to a Deck,        //   as opposed to an allocation to the Ship/etc.        boolean isDetail = (carrierAsset instanceof Deck);        // register the cargo        List cargoIds = new ArrayList();	boolean validCargoID = 	  DataRegistry.registerCargoInstance(toReg, 					     cargoIds, 					     cargoAsset);        if (!validCargoID) {          // invalid cargo?	  System.err.println ("DataComputer got null cargoID for " + cargoAsset + 			      "? This should never happen.");          continue;        }        int nCargoIds = cargoIds.size();        // get a unique leg prefix        String legIdPrefix = task.getUID().toString() + "-";        // configure and register our legs        int i = 0;         do {          Leg li = (Leg)tmpLegs.get(i);          // configure leg          li.UID = legIdPrefix + Integer.toString(i);          li.conveyanceUID = carrierId;          li.isDetail = isDetail;          // inefficient:          for (int j = 0; j < nCargoIds; j++) {            li.addCarriedAsset((String)cargoIds.get(j));          }          // register the leg          DataRegistry.registerLeg(toReg, li);        } while (++i < nTmpLegs);      }    }    // success!    toReg.endComputeTime = System.currentTimeMillis();  }