Program: 78210
Project: 78210
Buggy source:
/** 
 * Renders all blocks using the appropriate block z-order and the containment hierarchy.
 * @param bo
 */
public void render(Map htRenderers,Bounds bo) throws ChartException {
  final boolean bFirstInSequence=(iSeriesIndex == 0);
  final boolean bLastInSequence=(iSeriesIndex == iSeriesCount - 1);
  boolean bStarted=bFirstInSequence;
  long lTimer=System.currentTimeMillis();
  Block bl=cm.getBlock();
  final Enumeration e=bl.children(true);
  final BlockGenerationEvent bge=new BlockGenerationEvent(this);
  final IDeviceRenderer idr=getDevice();
  final ScriptHandler sh=getRunTimeContext().getScriptHandler();
  if (bFirstInSequence) {
    ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
    getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
    bge.updateBlock(bl);
    renderChartBlock(idr,bl,StructureSource.createUnknown(bl));
    ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
    getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
  }
  while (e.hasMoreElements()) {
    bl=(Block)e.nextElement();
    bge.updateBlock(bl);
    if (bl instanceof Plot) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderPlot(ir,(Plot)bl);
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
      if (bFirstInSequence && !bLastInSequence) {
        break;
      }
      if (!bStarted) {
        bStarted=true;
      }
    }
 else     if (bl instanceof TitleBlock && bStarted) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderTitle(ir,(TitleBlock)bl);
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
    }
 else     if (bl instanceof LabelBlock && bStarted) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderLabel(ir,bl,StructureSource.createUnknown(bl));
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
    }
 else     if (bl instanceof Legend && bStarted && bLastInSequence) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderLegend(idr,(Legend)bl,htRenderers);
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
    }
 else     if (bStarted) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderBlock(ir,bl,StructureSource.createUnknown(bl));
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
    }
  }
  lTimer=System.currentTimeMillis() - lTimer;
  if (htRenderers.containsKey(TIMER)) {
    final Long l=(Long)htRenderers.get(TIMER);
    htRenderers.put(TIMER,new Long(l.longValue() + lTimer));
  }
 else {
    htRenderers.put(TIMER,new Long(lTimer));
  }
  if (bLastInSequence) {
    try {
      dc.flush();
    }
 catch (    ChartException ex) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.RENDERING,ex);
    }
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{new Long(lTimer)},rtc.getULocale()));
    htRenderers.remove(TIMER);
  }
}

Fixed version (ground truth):
/** 
 * Renders all blocks using the appropriate block z-order and the containment hierarchy.
 * @param bo
 */
public void render(Map htRenderers,Bounds bo) throws ChartException {
  final boolean bFirstInSequence=(iSeriesIndex == 0);
  final boolean bLastInSequence=(iSeriesIndex == iSeriesCount - 1);
  boolean bStarted=bFirstInSequence;
  long lTimer=System.currentTimeMillis();
  Block bl=cm.getBlock();
  final Enumeration e=bl.children(true);
  final BlockGenerationEvent bge=new BlockGenerationEvent(this);
  final IDeviceRenderer idr=getDevice();
  final ScriptHandler sh=getRunTimeContext().getScriptHandler();
  if (bFirstInSequence) {
    ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
    getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
    bge.updateBlock(bl);
    renderChartBlock(idr,bl,StructureSource.createChartBlock(bl));
    ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
    getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
  }
  while (e.hasMoreElements()) {
    bl=(Block)e.nextElement();
    bge.updateBlock(bl);
    if (bl instanceof Plot) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderPlot(ir,(Plot)bl);
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
      if (bFirstInSequence && !bLastInSequence) {
        break;
      }
      if (!bStarted) {
        bStarted=true;
      }
    }
 else     if (bl instanceof TitleBlock && bStarted) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderTitle(ir,(TitleBlock)bl);
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
    }
 else     if (bl instanceof LabelBlock && bStarted) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderLabel(ir,bl,StructureSource.createUnknown(bl));
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
    }
 else     if (bl instanceof Legend && bStarted && bLastInSequence) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderLegend(idr,(Legend)bl,htRenderers);
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
    }
 else     if (bStarted) {
      ScriptHandler.callFunction(sh,ScriptHandler.BEFORE_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_BLOCK,bl);
      renderBlock(ir,bl,StructureSource.createUnknown(bl));
      ScriptHandler.callFunction(sh,ScriptHandler.AFTER_DRAW_BLOCK,bl,getRunTimeContext().getScriptContext());
      getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_BLOCK,bl);
    }
  }
  lTimer=System.currentTimeMillis() - lTimer;
  if (htRenderers.containsKey(TIMER)) {
    final Long l=(Long)htRenderers.get(TIMER);
    htRenderers.put(TIMER,new Long(l.longValue() + lTimer));
  }
 else {
    htRenderers.put(TIMER,new Long(lTimer));
  }
  if (bLastInSequence) {
    try {
      dc.flush();
    }
 catch (    ChartException ex) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.RENDERING,ex);
    }
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{new Long(lTimer)},rtc.getULocale()));
    htRenderers.remove(TIMER);
  }
}