Vector old_prefs = UTILAllocate.enumToVector(taskToChange.getPreferences());
Vector old_prefs; synchronized(taskToChange) { old_prefs = UTILAllocate.enumToVector(taskToChange.getPreferences()); }
  public Preference removePrefWithAspectType(Task taskToChange,						    int aspect_type) {    Vector old_prefs =      UTILAllocate.enumToVector(taskToChange.getPreferences());    Vector new_prefs = new Vector(old_prefs.size());    Preference pref_to_return = null;    Enumeration prefs_e = old_prefs.elements();    while (prefs_e.hasMoreElements()) {      Preference old_pref = (Preference)prefs_e.nextElement();      if (old_pref.getAspectType() != aspect_type)	new_prefs.addElement(old_pref);      else	pref_to_return = old_pref;    }        ((NewTask)taskToChange).setPreferences(new_prefs.elements());        return pref_to_return;  }