ProcessDescription[] attachToNodes = getNodesToAttach((ProcessDescription[])pds.toArray(new ProcessDescription[pds.size()]));
if (pds.size() == 0) return; ProcessDescription[] attachToNodes = getNodesToAttach(new ArrayList(pds));
  private void attachButton_actionPerformed() {    attachButton.setSelected(false);    ArrayList appServers = getAppServers();    if (appServers == null || appServers.size() == 0)      return;    Hashtable nodeToAppServer = getProcessDescriptions(appServers);    Set pds = nodeToAppServer.keySet();    ProcessDescription[] attachToNodes =       getNodesToAttach((ProcessDescription[])pds.toArray(new ProcessDescription[pds.size()]));    //    printInfoFromAppServer(attachToNodes);    nodeToNodeInfo.clear(); // clear all previous info on nodes    for (int i = 0; i < attachToNodes.length; i++) {      ProcessDescription pd = attachToNodes[i];      Map map = pd.getJavaProperties();      // workaround to immutable map problem      Properties properties = new Properties();      Set keys = map.keySet();      for (Iterator k = keys.iterator(); k.hasNext(); ) {        Object key = k.next();        Object value = map.get(key);        properties.put(key, value);      }      // end workaround      String nodeName = (String)properties.get("org.cougaar.node.name");      String hostName = (String)properties.get("org.cougaar.name.server");      java.util.List args = pd.getCommandLineArguments();      RemoteHost appServer = (RemoteHost)nodeToAppServer.get(pd);      nodeToNodeInfo.put(nodeName,                          new NodeInfo(appServer, nodeName, hostName,                                       properties, args));     }    // TODO: finish this when the attach functionality is working    // FOR DEBUGGING: because we can't attach to running nodes yet    // abort and then run the new nodes; note this doesn't clean up    // the gui properly, but will be ok when attach does the right thing    abortButton_actionPerformed();    experiment = null; // pretend we don't know about any experiment    runButton_actionPerformed();  }