Program: 13475
Project: 13475
Buggy source:
/** 
 * Override any overrideable objects in the spread's master spread.
 * @throws Exception 
 */
public void overrideMasterSpreadObjects() throws Exception {
  InDesignDocument doc=(InDesignDocument)getParent();
  Map<TextFrame,TextFrame> masterToOverride=new HashMap<TextFrame,TextFrame>();
  for (  InDesignComponent comp : this.masterSpread.getChildren()) {
    if (comp.getBooleanProperty("String_Node_Str")) {
      if (comp instanceof InDesignObject) {
        InDesignObject idObj=(InDesignObject)comp;
        if (idObj instanceof TextFrame) {
          TextFrame masterFrame=(TextFrame)idObj;
          TextFrame overrideFrame=(TextFrame)doc.clone(masterFrame);
          overrideFrame.setMasterFrame(masterFrame);
          masterToOverride.put(masterFrame,overrideFrame);
          this.addRectangle(overrideFrame);
        }
 else         if (idObj instanceof Rectangle) {
          this.addRectangle((Rectangle)(doc.clone(idObj)));
        }
 else {
          this.addChild(idObj);
        }
      }
 else {
        this.addChild(comp);
      }
    }
  }
  for (  TextFrame masterFrame : masterToOverride.keySet()) {
    if (masterFrame.getNextInThread() == null)     continue;
    TextFrame override=masterToOverride.get(masterFrame);
    TextFrame nextMaster=masterFrame.getNextInThread();
    TextFrame nextOverride=masterToOverride.get(nextMaster);
    if (this.frames.containsKey(nextOverride.getId())) {
      override.setNextInThread(nextOverride);
    }
 else {
      override.setNextInThread((TextFrame)null);
    }
  }
  logger.debug("String_Node_Str");
  assignRectanglesToPages();
}

Fixed version (ground truth):
/** 
 * Override any overrideable objects in the spread's master spread.
 * @throws Exception 
 */
public void overrideMasterSpreadObjects() throws Exception {
  InDesignDocument doc=(InDesignDocument)getParent();
  Map<TextFrame,TextFrame> masterToOverride=new HashMap<TextFrame,TextFrame>();
  for (  InDesignComponent comp : this.masterSpread.getChildren()) {
    if (comp.getBooleanProperty("String_Node_Str")) {
      if (comp instanceof InDesignObject) {
        InDesignObject idObj=(InDesignObject)comp;
        if (idObj instanceof TextFrame) {
          TextFrame masterFrame=(TextFrame)idObj;
          TextFrame overrideFrame=(TextFrame)doc.clone(masterFrame);
          overrideFrame.setMasterFrame(masterFrame);
          masterToOverride.put(masterFrame,overrideFrame);
          this.addRectangle(overrideFrame);
        }
 else         if (idObj instanceof Rectangle) {
          this.addRectangle((Rectangle)(doc.clone(idObj)));
        }
 else {
          this.addChild(idObj);
        }
      }
 else {
        this.addChild(comp);
      }
    }
  }
  for (  TextFrame masterFrame : masterToOverride.keySet()) {
    if (masterFrame.getNextInThread() == null)     continue;
    TextFrame override=masterToOverride.get(masterFrame);
    InDesignComponent nextMaster=masterFrame.getNextInThread();
    TextFrame nextOverride=masterToOverride.get(nextMaster);
    if (this.frames.containsKey(nextOverride.getId())) {
      override.setNextInThread(nextOverride);
    }
 else {
      override.setNextInThread((TextFrame)null);
    }
  }
  logger.debug("String_Node_Str");
  assignRectanglesToPages();
}