Program: 76252
Project: 76252
Buggy source:
/** 
 * Initialize the applet.
 */
public void init(){
  super.init();
  try {
    getContentPane().add(_createRunControls(2),BorderLayout.NORTH);
    _toplevel.setName("String_Node_Str");
    CTMultiSolverDirector topdir=new CTMultiSolverDirector(_toplevel,"String_Node_Str");
    Const source=new Const(_toplevel,"String_Node_Str");
    source.value.setToken(new DoubleToken(1.0));
    TimedPlotter responsePlot=new TimedPlotter(_toplevel,"String_Node_Str");
    responsePlot.place(getContentPane());
    responsePlot.plot.setBackground(getBackground());
    responsePlot.plot.setGrid(true);
    responsePlot.plot.setTitle("String_Node_Str");
    responsePlot.plot.addLegend(0,"String_Node_Str");
    responsePlot.plot.setConnected(true);
    responsePlot.plot.setImpulses(false);
    responsePlot.plot.setXRange(0.0,5.0);
    responsePlot.plot.setYRange(-0.1,0.3);
    responsePlot.plot.setSize(500,300);
    CTCompositeActor hs=new CTCompositeActor(_toplevel,"String_Node_Str");
    TypedIOPort hsin=(TypedIOPort)hs.newPort("String_Node_Str");
    hsin.setInput(true);
    hsin.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort hsst=(TypedIOPort)hs.newPort("String_Node_Str");
    hsst.setOutput(true);
    hsst.setTypeEquals(BaseType.DOUBLE);
    HSController ctrl=new HSController(hs,"String_Node_Str");
    FSMState ctrlInc=new FSMState(ctrl,"String_Node_Str");
    FSMState ctrlDec=new FSMState(ctrl,"String_Node_Str");
    ctrl.setInitialState(ctrlInc);
    FSMTransition ctrlTr1=ctrl.createTransition(ctrlInc,ctrlDec);
    ctrlTr1.setTriggerEvent("String_Node_Str");
    HSInit hsinit1=new HSInit(ctrlTr1,"String_Node_Str","String_Node_Str");
    FSMTransition ctrlTr2=ctrl.createTransition(ctrlDec,ctrlInc);
    ctrlTr2.setTriggerEvent("String_Node_Str");
    HSInit hsinit2=new HSInit(ctrlTr2,"String_Node_Str","String_Node_Str");
    HSDirector hsdir=new HSDirector(hs,"String_Node_Str");
    hsdir.setController(ctrl);
    CTCompositeActor ctInc=new CTCompositeActor(hs,"String_Node_Str");
    CTZeroOrderHold ctIncH=new CTZeroOrderHold(ctInc,"String_Node_Str");
    Integrator ctIncI=new Integrator(ctInc,"String_Node_Str");
    CTZeroCrossingDetector ctIncD=new CTZeroCrossingDetector(ctInc,"String_Node_Str");
    Expression ctIncGF=new Expression(ctInc,"String_Node_Str");
    TypedIOPort ctIncGFi=(TypedIOPort)ctIncGF.newPort("String_Node_Str");
    ctIncGFi.setInput(true);
    ctIncGFi.setTypeEquals(BaseType.DOUBLE);
    ctIncGF.output.setTypeEquals(BaseType.DOUBLE);
    ctIncGF.expression.setExpression("String_Node_Str");
    TypedIOPort ctIncIn=(TypedIOPort)ctInc.newPort("String_Node_Str");
    ctIncIn.setInput(true);
    ctIncIn.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctIncOut=(TypedIOPort)ctInc.newPort("String_Node_Str");
    ctIncOut.setOutput(true);
    ctIncOut.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctIncSt=(TypedIOPort)ctInc.newPort("String_Node_Str");
    ctIncSt.setOutput(true);
    ctIncSt.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctIncTr=(TypedIOPort)ctInc.newPort("String_Node_Str");
    ctIncTr.setOutput(true);
    ctIncTr.setTypeEquals(BaseType.DOUBLE);
    ctInc.connect(ctIncIn,ctIncH.input);
    ctInc.connect(ctIncH.output,ctIncI.input);
    Relation ctIncR2=ctInc.newRelation("String_Node_Str");
    ctIncGF.output.link(ctIncR2);
    ctIncD.trigger.link(ctIncR2);
    ctIncTr.link(ctIncR2);
    ctInc.connect(ctIncD.output,ctIncOut);
    TypedIORelation ctIncR1=(TypedIORelation)ctInc.newRelation("String_Node_Str");
    ctIncI.output.link(ctIncR1);
    ctIncD.input.link(ctIncR1);
    ctIncGFi.link(ctIncR1);
    ctIncSt.link(ctIncR1);
    CTEmbeddedDirector ctIncDir=new CTEmbeddedDirector(ctInc,"String_Node_Str");
    CTCompositeActor ctDec=new CTCompositeActor(hs,"String_Node_Str");
    CTZeroOrderHold ctDecH=new CTZeroOrderHold(ctDec,"String_Node_Str");
    Integrator ctDecI=new Integrator(ctDec,"String_Node_Str");
    Scale ctGain=new Scale(ctDec,"String_Node_Str");
    CTZeroCrossingDetector ctDecD=new CTZeroCrossingDetector(ctDec,"String_Node_Str");
    Expression ctDecGF=new Expression(ctDec,"String_Node_Str");
    TypedIOPort ctDecGFi=(TypedIOPort)ctDecGF.newPort("String_Node_Str");
    ctDecGFi.setInput(true);
    ctDecGFi.setTypeEquals(BaseType.DOUBLE);
    ctDecGF.output.setTypeEquals(BaseType.DOUBLE);
    ctDecGF.expression.setExpression("String_Node_Str");
    TypedIOPort ctDecIn=(TypedIOPort)ctDec.newPort("String_Node_Str");
    ctDecIn.setInput(true);
    ctDecIn.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctDecOut=(TypedIOPort)ctDec.newPort("String_Node_Str");
    ctDecOut.setOutput(true);
    ctDecOut.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctDecSt=(TypedIOPort)ctDec.newPort("String_Node_Str");
    ctDecSt.setOutput(true);
    ctDecSt.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctDecTr=(TypedIOPort)ctDec.newPort("String_Node_Str");
    ctDecTr.setOutput(true);
    ctDecTr.setTypeEquals(BaseType.DOUBLE);
    ctDec.connect(ctDecIn,ctDecH.input);
    ctDec.connect(ctDecH.output,ctGain.input);
    ctDec.connect(ctGain.output,ctDecI.input);
    Relation ctDecR2=ctDec.newRelation("String_Node_Str");
    ctDecGF.output.link(ctDecR2);
    ctDecD.trigger.link(ctDecR2);
    ctDecTr.link(ctDecR2);
    ctDec.connect(ctDecD.output,ctDecOut);
    TypedIORelation ctDecR1=(TypedIORelation)ctDec.newRelation("String_Node_Str");
    ctDecI.output.link(ctDecR1);
    ctDecD.input.link(ctDecR1);
    ctDecGFi.link(ctDecR1);
    ctDecSt.link(ctDecR1);
    CTEmbeddedDirector ctDecDir=new CTEmbeddedDirector(ctDec,"String_Node_Str");
    ctrlInc.setRefinement(ctInc);
    ctrlDec.setRefinement(ctDec);
    TypedIORelation hsr1=(TypedIORelation)hs.newRelation("String_Node_Str");
    hsin.link(hsr1);
    ctIncIn.link(hsr1);
    ctDecIn.link(hsr1);
    TypedIORelation hsr2=(TypedIORelation)hs.newRelation("String_Node_Str");
    ctIncOut.link(hsr2);
    ctDecOut.link(hsr2);
    TypedIORelation hsr3=(TypedIORelation)hs.newRelation("String_Node_Str");
    hsst.link(hsr3);
    ctIncSt.link(hsr3);
    ctDecSt.link(hsr3);
    Relation hsr4=hs.newRelation("String_Node_Str");
    ctIncTr.link(hsr4);
    ctDecTr.link(hsr4);
    _toplevel.connect(source.output,hsin);
    _toplevel.connect(hsst,responsePlot.input);
    topdir.setStopTime(5.0);
    ctIncDir.InitStepSize.setToken(new DoubleToken(0.01));
    ctIncDir.MinStepSize.setToken(new DoubleToken(1e-3));
    ctIncDir.MaxStepSize.setToken(new DoubleToken(0.05));
    StringToken tok=new StringToken("String_Node_Str");
    ctIncDir.BreakpointODESolver.setToken(tok);
    Parameter dfsol=(Parameter)ctIncDir.getAttribute("String_Node_Str");
    tok=new StringToken("String_Node_Str");
    ctIncDir.ODESolver.setToken(tok);
    ctDecDir.InitStepSize.setToken(new DoubleToken(0.01));
    ctDecDir.MinStepSize.setToken(new DoubleToken(1e-3));
    ctDecDir.MaxStepSize.setToken(new DoubleToken(0.05));
    tok=new StringToken("String_Node_Str");
    ctDecDir.BreakpointODESolver.setToken(tok);
    tok=new StringToken("String_Node_Str");
    ctDecDir.ODESolver.setToken(tok);
    ctGain.factor.setToken(new DoubleToken(-1.0));
    topdir.InitStepSize.setToken(new DoubleToken(0.01));
    topdir.MinStepSize.setToken(new DoubleToken(1e-3));
    topdir.MaxStepSize.setToken(new DoubleToken(0.05));
    tok=new StringToken("String_Node_Str");
    topdir.BreakpointODESolver.setToken(tok);
    tok=new StringToken("String_Node_Str");
    topdir.ODESolver.setToken(tok);
  }
 catch (  KernelException ex) {
    report("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Initialize the applet.
 */
public void init(){
  super.init();
  try {
    getContentPane().add(_createRunControls(2),BorderLayout.NORTH);
    _toplevel.setName("String_Node_Str");
    CTMultiSolverDirector topdir=new CTMultiSolverDirector(_toplevel,"String_Node_Str");
    StreamListener dbl=new StreamListener();
    Const source=new Const(_toplevel,"String_Node_Str");
    source.value.setToken(new DoubleToken(1.0));
    TimedPlotter responsePlot=new TimedPlotter(_toplevel,"String_Node_Str");
    responsePlot.place(getContentPane());
    responsePlot.plot.setBackground(getBackground());
    responsePlot.plot.setGrid(true);
    responsePlot.plot.setTitle("String_Node_Str");
    responsePlot.plot.addLegend(0,"String_Node_Str");
    responsePlot.plot.setConnected(true);
    responsePlot.plot.setImpulses(false);
    responsePlot.plot.setXRange(0.0,5.0);
    responsePlot.plot.setYRange(-0.1,0.3);
    responsePlot.plot.setSize(500,300);
    CTCompositeActor hs=new CTCompositeActor(_toplevel,"String_Node_Str");
    TypedIOPort hsin=(TypedIOPort)hs.newPort("String_Node_Str");
    hsin.setInput(true);
    hsin.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort hsst=(TypedIOPort)hs.newPort("String_Node_Str");
    hsst.setOutput(true);
    hsst.setTypeEquals(BaseType.DOUBLE);
    HSController ctrl=new HSController(hs,"String_Node_Str");
    FSMState ctrlInc=new FSMState(ctrl,"String_Node_Str");
    FSMState ctrlDec=new FSMState(ctrl,"String_Node_Str");
    ctrl.setInitialState(ctrlInc);
    FSMTransition ctrlTr1=ctrl.createTransition(ctrlInc,ctrlDec);
    ctrlTr1.setTriggerEvent("String_Node_Str");
    HSInit hsinit1=new HSInit(ctrlTr1,"String_Node_Str","String_Node_Str");
    FSMTransition ctrlTr2=ctrl.createTransition(ctrlDec,ctrlInc);
    ctrlTr2.setTriggerEvent("String_Node_Str");
    HSInit hsinit2=new HSInit(ctrlTr2,"String_Node_Str","String_Node_Str");
    HSDirector hsdir=new HSDirector(hs,"String_Node_Str");
    hsdir.setController(ctrl);
    CTCompositeActor ctInc=new CTCompositeActor(hs,"String_Node_Str");
    CTZeroOrderHold ctIncH=new CTZeroOrderHold(ctInc,"String_Node_Str");
    Integrator ctIncI=new Integrator(ctInc,"String_Node_Str");
    CTZeroCrossingDetector ctIncD=new CTZeroCrossingDetector(ctInc,"String_Node_Str");
    Expression ctIncGF=new Expression(ctInc,"String_Node_Str");
    TypedIOPort ctIncGFi=(TypedIOPort)ctIncGF.newPort("String_Node_Str");
    ctIncGFi.setInput(true);
    ctIncGFi.setTypeEquals(BaseType.DOUBLE);
    ctIncGF.output.setTypeEquals(BaseType.DOUBLE);
    ctIncGF.expression.setExpression("String_Node_Str");
    TypedIOPort ctIncIn=(TypedIOPort)ctInc.newPort("String_Node_Str");
    ctIncIn.setInput(true);
    ctIncIn.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctIncOut=(TypedIOPort)ctInc.newPort("String_Node_Str");
    ctIncOut.setOutput(true);
    ctIncOut.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctIncSt=(TypedIOPort)ctInc.newPort("String_Node_Str");
    ctIncSt.setOutput(true);
    ctIncSt.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctIncTr=(TypedIOPort)ctInc.newPort("String_Node_Str");
    ctIncTr.setOutput(true);
    ctIncTr.setTypeEquals(BaseType.DOUBLE);
    ctInc.connect(ctIncIn,ctIncH.input);
    ctInc.connect(ctIncH.output,ctIncI.input);
    Relation ctIncR2=ctInc.newRelation("String_Node_Str");
    ctIncGF.output.link(ctIncR2);
    ctIncD.trigger.link(ctIncR2);
    ctIncTr.link(ctIncR2);
    ctInc.connect(ctIncD.output,ctIncOut);
    TypedIORelation ctIncR1=(TypedIORelation)ctInc.newRelation("String_Node_Str");
    ctIncI.output.link(ctIncR1);
    ctIncD.input.link(ctIncR1);
    ctIncGFi.link(ctIncR1);
    ctIncSt.link(ctIncR1);
    CTEmbeddedDirector ctIncDir=new CTEmbeddedDirector(ctInc,"String_Node_Str");
    CTCompositeActor ctDec=new CTCompositeActor(hs,"String_Node_Str");
    CTZeroOrderHold ctDecH=new CTZeroOrderHold(ctDec,"String_Node_Str");
    Integrator ctDecI=new Integrator(ctDec,"String_Node_Str");
    Scale ctGain=new Scale(ctDec,"String_Node_Str");
    CTZeroCrossingDetector ctDecD=new CTZeroCrossingDetector(ctDec,"String_Node_Str");
    Expression ctDecGF=new Expression(ctDec,"String_Node_Str");
    TypedIOPort ctDecGFi=(TypedIOPort)ctDecGF.newPort("String_Node_Str");
    ctDecGFi.setInput(true);
    ctDecGFi.setTypeEquals(BaseType.DOUBLE);
    ctDecGF.output.setTypeEquals(BaseType.DOUBLE);
    ctDecGF.expression.setExpression("String_Node_Str");
    TypedIOPort ctDecIn=(TypedIOPort)ctDec.newPort("String_Node_Str");
    ctDecIn.setInput(true);
    ctDecIn.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctDecOut=(TypedIOPort)ctDec.newPort("String_Node_Str");
    ctDecOut.setOutput(true);
    ctDecOut.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctDecSt=(TypedIOPort)ctDec.newPort("String_Node_Str");
    ctDecSt.setOutput(true);
    ctDecSt.setTypeEquals(BaseType.DOUBLE);
    TypedIOPort ctDecTr=(TypedIOPort)ctDec.newPort("String_Node_Str");
    ctDecTr.setOutput(true);
    ctDecTr.setTypeEquals(BaseType.DOUBLE);
    ctDec.connect(ctDecIn,ctDecH.input);
    ctDec.connect(ctDecH.output,ctGain.input);
    ctDec.connect(ctGain.output,ctDecI.input);
    Relation ctDecR2=ctDec.newRelation("String_Node_Str");
    ctDecGF.output.link(ctDecR2);
    ctDecD.trigger.link(ctDecR2);
    ctDecTr.link(ctDecR2);
    ctDec.connect(ctDecD.output,ctDecOut);
    TypedIORelation ctDecR1=(TypedIORelation)ctDec.newRelation("String_Node_Str");
    ctDecI.output.link(ctDecR1);
    ctDecD.input.link(ctDecR1);
    ctDecGFi.link(ctDecR1);
    ctDecSt.link(ctDecR1);
    CTEmbeddedDirector ctDecDir=new CTEmbeddedDirector(ctDec,"String_Node_Str");
    ctrlInc.setRefinement(ctInc);
    ctrlDec.setRefinement(ctDec);
    TypedIORelation hsr1=(TypedIORelation)hs.newRelation("String_Node_Str");
    hsin.link(hsr1);
    ctIncIn.link(hsr1);
    ctDecIn.link(hsr1);
    TypedIORelation hsr2=(TypedIORelation)hs.newRelation("String_Node_Str");
    ctIncOut.link(hsr2);
    ctDecOut.link(hsr2);
    TypedIORelation hsr3=(TypedIORelation)hs.newRelation("String_Node_Str");
    hsst.link(hsr3);
    ctIncSt.link(hsr3);
    ctDecSt.link(hsr3);
    Relation hsr4=hs.newRelation("String_Node_Str");
    ctIncTr.link(hsr4);
    ctDecTr.link(hsr4);
    _toplevel.connect(source.output,hsin);
    _toplevel.connect(hsst,responsePlot.input);
    topdir.setStopTime(5.0);
    ctIncDir.InitStepSize.setToken(new DoubleToken(0.01));
    ctIncDir.MinStepSize.setToken(new DoubleToken(1e-3));
    ctIncDir.MaxStepSize.setToken(new DoubleToken(0.05));
    StringToken tok=new StringToken("String_Node_Str");
    ctIncDir.BreakpointODESolver.setToken(tok);
    Parameter dfsol=(Parameter)ctIncDir.getAttribute("String_Node_Str");
    tok=new StringToken("String_Node_Str");
    ctIncDir.ODESolver.setToken(tok);
    ctDecDir.InitStepSize.setToken(new DoubleToken(0.01));
    ctDecDir.MinStepSize.setToken(new DoubleToken(1e-3));
    ctDecDir.MaxStepSize.setToken(new DoubleToken(0.05));
    tok=new StringToken("String_Node_Str");
    ctDecDir.BreakpointODESolver.setToken(tok);
    tok=new StringToken("String_Node_Str");
    ctDecDir.ODESolver.setToken(tok);
    ctGain.factor.setToken(new DoubleToken(-1.0));
    topdir.InitStepSize.setToken(new DoubleToken(0.01));
    topdir.MinStepSize.setToken(new DoubleToken(1e-3));
    topdir.MaxStepSize.setToken(new DoubleToken(0.05));
    tok=new StringToken("String_Node_Str");
    topdir.BreakpointODESolver.setToken(tok);
    tok=new StringToken("String_Node_Str");
    topdir.ODESolver.setToken(tok);
  }
 catch (  KernelException ex) {
    report("String_Node_Str",ex);
  }
}