if (myPrototype != null) {  if (myPrototype.wasSentTo(dest)) { TypeIdentificationPG tipg = myPrototype.getTypeIdentificationPG(); out.writeObject(tipg); } else {  out.writeObject(myPrototype); myPrototype.addSentTo(dest); } } else { out.writeObject(null); }
out.writeObject(myPrototype);
  private void writeObject(ObjectOutputStream out) throws IOException {    ClusterContextTable.ContextState cs = ClusterContextTable.getContextState();    if (cs instanceof ClusterContextTable.MessageContext) {      ClusterContextTable.MessageContext c = (ClusterContextTable.MessageContext)cs;      MessageAddress dest = c.getToAddress();      //boolean protoSentP = (myPrototype==null)?false:(myPrototype.wasSentTo(dest));      out.defaultWriteObject();      out.writeObject(myTypeIdentificationPG);      out.writeObject(myItemIdentificationPG);      // send the proto.TIP as the proto description      if (myPrototype != null) {        // only send the first time.        if (myPrototype.wasSentTo(dest)) {          TypeIdentificationPG tipg = myPrototype.getTypeIdentificationPG();          out.writeObject(tipg);        } else {          //myPrototype.addSentTo(dest);          out.writeObject(myPrototype);          myPrototype.addSentTo(dest);        }      } else {        out.writeObject(null);      }    } else {      // "Network" serialization      //System.err.println("Default serialization of "+this);      out.defaultWriteObject();      out.writeObject(myTypeIdentificationPG);      out.writeObject(myItemIdentificationPG);      out.writeObject(myPrototype);      if (out instanceof org.cougaar.core.persist.PersistenceOutputStream) {        out.writeObject(roleschedule.getAvailableSchedule());      }    }      // End Network serialization  } 