Date arrival = new Date(glmPrefHelper.getBestDate(task).getTime()-1000l);
Date arrival = new Date(glmPrefHelper.getBestDate(task).getTime());
  protected boolean processTask (Object object, Object taskOrAsset) {    super.processTask (object, taskOrAsset);    Task task = (Task) taskOrAsset;    String taskName = getTaskName (); 	    //	if (logger.isDebugEnabled())    //	  logger.debug ("TranscomDataXMLize.processTask - uid " + task.getUID());    dataHelper.createDateField(object, "departure", glmPrefHelper.getReadyAt(task));    // prevents occasional rounding errors from date->string->date    Date arrival = new Date(glmPrefHelper.getBestDate(task).getTime()-1000l);    dataHelper.createDateField(object, "arrival", arrival);    GeolocLocation from = glmPrepHelper.getFromLocation (task);    GeolocLocation to   = glmPrepHelper.getToLocation (task);    try {      if (direct) {	dataHelper.createGeoloc (object, "from", from);	dataHelper.createGeoloc (object, "to",   to);      }      else {	Object field = dataHelper.createField (object, taskName, "from");	dataHelper.createGeoloc (field, "from", from);	field = dataHelper.createField (object, taskName, "to");	dataHelper.createGeoloc (field, "to",   to);      }    } catch (Exception e) {      logger.error ("TranscomDataXMLize.createDoc - ERROR - " + 		    " no from or to geoloc on " + task);    }    try {      dataHelper.createField(object, taskName, "name", getAssetName(task.getDirectObject()));      dataHelper.createField(object, taskName, "type", getAssetType(task.getDirectObject()));    } catch (Exception e) {      logger.error ("TranscomDataXMLize.createDoc - ERROR - " + 	     " no type id pg on direct object of " + task);    }    GLMAsset baseAsset = null;    Asset directObject = task.getDirectObject ();	    if (directObject instanceof AggregateAsset) {      baseAsset = (GLMAsset) ((AggregateAsset)directObject).getAsset ();    }     else {      try {	baseAsset = (GLMAsset)directObject;      } catch (ClassCastException cce) {	logger.error ("TranscomDataXMLize.processTask - ERROR for task " + task +		      "\nDirectObject was not a GLMAsset, as expected.");      }    }    addTaskPersonField (object, baseAsset);    float distance = (float)       ((glmPrepHelper.hasPrepNamed (task, GLMTransConst.SEAROUTE_DISTANCE)) ?       ((Distance) glmPrepHelper.getIndirectObject (task, 						    GLMTransConst.SEAROUTE_DISTANCE)).getNauticalMiles() :       measureHelper.distanceBetween (from, to).getNauticalMiles());    dataHelper.createFloatField(object, "distance", distance);    if (logger.isDebugEnabled())      logger.debug ("TranscomDataXMLize.processTask - did task " + task.getUID());    if (direct && logger.isDebugEnabled())      logger.debug ("TranscomDataXMLize.processTask - created task " + object);    return true;  }