system/src/sc/lang/SemanticNodeList.java
public int replaceChild(Object toReplace, Object other) {
      //int ix = indexOf(toReplace);
      // Don't want to do 'equals' here which turns into 'deepEquals' in SemanticNode because we might find a different version of the
      // same statement and replace the wrong instance.
      // TODO: should we revisit having 'equals' map to deepEquals in semantic node? It seems like a separate operation might be more
      // robust and less error prone.
      int ix = indexOfChild(toReplace);

      if (ix == -1) {
         return -1;
      }
      set(ix, (E) other);
      return ix;
   }
/** Find the supplied node in our list, and replace it with the other one */
Find the supplied node in our list, and replace it with the other one
Find the supplied node in our list and replace it with the other one
public int replaceChild(Object toReplace, Object other) {
      int ix = indexOfChild(toReplace);
      if (ix == -1) {
         return -1;
      }
      set(ix, (E) other);
      return ix;
   }
public int replaceChild ( Object toReplace , Object other ) { int ix = indexOfChild ( toReplace ) ; if ( ix == - 1 ) { return - 1 ; } set ( ix , ( E ) other ) ; return ix ; }
Find the supplied node in our list, and replace it with the other one
Find the supplied node in our list and replace it with the other one
//int ix = indexOf(toReplace); // Don't want to do 'equals' here which turns into 'deepEquals' in SemanticNode because we might find a different version of the // same statement and replace the wrong instance. // TODO: should we revisit having 'equals' map to deepEquals in semantic node? It seems like a separate operation might be more // robust and less error prone.