System.out.println ("Found a duplicate " + first.getNodeName () + " " + name);
System.out.println ("VishnuPlugIn.duplicateNode - Found a duplicate " + first.getNodeName () + " " + name);
  protected boolean duplicateNode (Node first, List nodes) {    if (nodes.size () == 1)      return false; // if no others to compare against, it's not a duplicate    NodeList firstChildNodes  = first.getChildNodes ();    for (int i = 0; i < nodes.size (); i++) {      Node other = (Node) nodes.get (i);      if (first == other)		continue;  // ignore self to tell if duplicate	  boolean thisIsResource = 		first.getAttributes().getNamedItem ("is_resource").getNodeValue().equals("true");	  boolean otherIsNotResource = 		other.getAttributes().getNamedItem ("is_resource").getNodeValue().equals("false");	  if (thisIsResource && otherIsNotResource)		continue;      NodeList otherChildNodes = other.getChildNodes ();      if (firstChildNodes.getLength () > otherChildNodes.getLength ())		continue; // can't be a subset if more fields      Map fieldNames = new HashMap ();      for (int k = 0; k < otherChildNodes.getLength (); k++) {		String field = otherChildNodes.item (k).getAttributes().getNamedItem ("name").getNodeValue();		String type  = otherChildNodes.item (k).getAttributes().getNamedItem ("datatype").getNodeValue();		fieldNames.put (field, type);      }      boolean allFound = true;      // go through fields of node we're checking      for (int k = 0; k < firstChildNodes.getLength (); k++) {		String firstChildName = 		  firstChildNodes.item (k).getAttributes().getNamedItem ("name").getNodeValue();		if (fieldNames.get (firstChildName) == null) {		  allFound = false;		  break;		}      }	        // we found all the fields of the first node in the fields of another ->      // it's a subset node...      if (allFound) {		if (myExtraExtraOutput) {		  String name  = first.getAttributes().getNamedItem ("name").getNodeValue();		  System.out.println ("Found a duplicate " + first.getNodeName () + " " + name);		}		nodes.remove (first);		return true;      }    }    return false;  }