new_task.setContext(parentTask.getContext());
    public Task planMe(SequentialPlannerPlugin myPlugin) {      SequentialGlobalAirPlugin plugin = (SequentialGlobalAirPlugin) myPlugin;      Logger logger = plugin.getLogger();      UTILExpand expandHelper = plugin.getExpandHelper();      GLMPrepPhrase glmPrepHelper = plugin.getPrepHelper();      if (logger.isDebugEnabled())	logger.debug (".AirPortion.planMe - starting planning.");      NewTask new_task = expandHelper.makeSubTask(myPlugin.publicGetFactory(),						  parentTask,						  parentTask.getDirectObject(),						  myPlugin.publicGetMessageAddress());      Vector getDependencies = getDependencies();      /*	boolean dependsOnISB = false;				for (int i = 0; i < getDependencies.size(); i++) {	if (getDependencies.get (i) instanceof IsbPortion) {	dependsOnISB = true;	break;	}	}      */      Location [] locations = plugin.getPOEandPOD (parentTask, new_task);      Location fromLocation = locations[0];      Location toLocation   = locations[1];      Date end = null;      Date early, best;      if (getDependencies().isEmpty()) { // if there was neither a theater nor a isb leg	end = plugin.getPrefHelper().getLateDate(parentTask);	best = end;      } else {	SequentialScheduleElement sse = (SequentialScheduleElement)getDependencies().elementAt(0);	end = sse.getStartDate();	//	early = plugin.getPrefHelper().getReadyAt(new_task);	best  = new Date(end.getTime() - plugin.bestDateBackoff);	early = plugin.getEarlyArrivalMiddleStep (new_task, best);	if (best.getTime () < early.getTime())	  best = early;			  	plugin.getPrefHelper().replacePreference(new_task, 						 plugin.getPrefHelper().makeEndDatePreference(myPlugin.publicGetFactory(), 											      early,best,end));	GeolocLocation theaterLegFrom = plugin.getPrepHelper ().getFromLocation (sse.getTask());	if (!theaterLegFrom.getGeolocCode ().equals (((GeolocLocation)toLocation).getGeolocCode()))	  plugin.getLogger().error (" - Theater leg task " + sse.getTask().getUID () + 				    " FROM " + theaterLegFrom + " is not equal to air/sea TO " + toLocation);	// if (dependsOnISB)	//	toLocation = plugin.getISBLocation(end); // doesn't matter when      }      if (logger.isDebugEnabled())	logger.debug (".AirPortion.planMe - created leg FROM " + fromLocation + 		     " TO " + toLocation);      glmPrepHelper.replacePrepOnTask(new_task, 				      glmPrepHelper.makePrepositionalPhrase(myPlugin.publicGetFactory(),									    Constants.Preposition.FROM,									    fromLocation));      glmPrepHelper.replacePrepOnTask(new_task, 				      glmPrepHelper.makePrepositionalPhrase(myPlugin.publicGetFactory(),									    Constants.Preposition.TO,									    toLocation));                  Organization middleOrg = plugin.findOrgForMiddleStep ();			      List aspects = new ArrayList ();      aspects.add (AspectValue.newAspectValue (AspectType.START_TIME, 				    (double) plugin.getPrefHelper().getReadyAt(new_task).getTime ()));      aspects.add (AspectValue.newAspectValue (AspectType.END_TIME,   				    (double) best.getTime ()));      plugin.removePrepsFromMiddleStep (new_task);      PlanElement pe = plugin.getAllocHelper().makeAllocation(myPlugin,							      myPlugin.publicGetFactory(), 							      myPlugin.publicGetRealityPlan(),							      new_task, 							      middleOrg,							      (AspectValue []) aspects.toArray (new AspectValue[0]), 							      plugin.getAllocHelper().MEDIUM_CONFIDENCE,							      Constants.Role.TRANSPORTER);      myPlugin.publicPublishAdd(pe);      return new_task;    }