Program: 11115
Project: 11115
Buggy source:
/** 
 * Execute JavaScript representing a CQL measure in the Rhino engine.
 * @param javascript The script to execute.
 * @param isMeasure Whether or not the script should be wrapped in thetemplate-exec function that imports CQL javascripts and execute the javascript as a Clinical Quality Measure. If  {@code false} the javascriptwill be executed as a plain-old javascript.
 * @return The result set of the execution.
 * @throws Exception if the patient source is {@code null}.
 */
private static Results execute(String javascript,boolean isMeasure) throws Exception {
  if (patientSource == null) {
    throw new Exception("String_Node_Str");
  }
  reset();
  prepWorkingArea(javascript);
  Main dbg=null;
  Context context=null;
  if (debugJavascript) {
    ContextFactory factory=new ContextFactory();
    if (isMeasure) {
      dbg=new Main("String_Node_Str");
    }
 else {
      dbg=new Main("String_Node_Str");
    }
    dbg.attachTo(factory);
    dbg.setBreakOnEnter(true);
    dbg.setBreakOnExceptions(true);
    dbg.setBreakOnReturn(false);
    context=factory.enterContext();
    System.setIn(dbg.getIn());
    System.setOut(dbg.getOut());
    System.setErr(dbg.getErr());
  }
 else {
    context=Context.enter();
  }
  ScriptableObject scope=new ImporterTopLevel(context);
  if (debugJavascript) {
    dbg.setScope(scope);
    dbg.setSize(640,400);
    dbg.setVisible(true);
  }
  patientSource.initialize(context,scope);
  Global global=new Global(context);
  boolean sandboxed=false;
  List<String> modulePath=new ArrayList<String>();
  String mainModule=workingArea.toString();
  modulePath.add(mainModule);
  Require require=global.installRequire(context,modulePath,sandboxed);
  require.install(scope);
  Scriptable arguments=context.newArray(scope,new Object[]{});
  scope.defineProperty("String_Node_Str",arguments,ScriptableObject.DONTENUM);
  try {
    File lib=new File(mainModule);
    File script=null;
    if (isMeasure) {
      script=new File(lib,"String_Node_Str");
    }
 else {
      script=new File(lib,"String_Node_Str");
    }
    String uri=script.toURI().toURL().toExternalForm();
    ScriptableObject.putProperty(scope,"String_Node_Str",uri);
    if (isMeasure) {
      require.requireMain(context,"String_Node_Str");
    }
 else {
      require.requireMain(context,"String_Node_Str");
    }
  }
 catch (  Exception e) {
    System.err.println(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
    System.err.println(workingArea.toAbsolutePath().toString());
    e.printStackTrace();
  }
  Context.exit();
  cleanWorkingArea();
  return results.copy();
}

Fixed version (ground truth):
/** 
 * Execute JavaScript representing a CQL measure in the Rhino engine.
 * @param javascript The script to execute.
 * @param isMeasure Whether or not the script should be wrapped in thetemplate-exec function that imports CQL javascripts and execute the javascript as a Clinical Quality Measure. If  {@code false} the javascriptwill be executed as a plain-old javascript.
 * @return The result set of the execution.
 * @throws Exception if the patient source is {@code null}.
 */
private static Results execute(String javascript,boolean isMeasure) throws Exception {
  if (patientSource == null) {
    throw new Exception("String_Node_Str");
  }
  reset();
  prepWorkingArea(javascript);
  Main dbg=null;
  Context context=null;
  if (debugJavascript) {
    ContextFactory factory=new ContextFactory();
    if (isMeasure) {
      dbg=new Main("String_Node_Str");
    }
 else {
      dbg=new Main("String_Node_Str");
    }
    dbg.attachTo(factory);
    dbg.setBreakOnEnter(true);
    dbg.setBreakOnExceptions(true);
    dbg.setBreakOnReturn(false);
    context=factory.enterContext();
    System.setIn(dbg.getIn());
    System.setOut(dbg.getOut());
    System.setErr(dbg.getErr());
  }
 else {
    context=Context.enter();
  }
  ScriptableObject scope=new ImporterTopLevel(context);
  if (debugJavascript) {
    dbg.setScope(scope);
    dbg.setSize(640,400);
    dbg.setVisible(true);
  }
  patientSource.initialize(context,scope);
  Global global=new Global(context);
  boolean sandboxed=false;
  List<String> modulePath=new ArrayList<String>();
  String mainModule=workingArea.toUri().toString();
  modulePath.add(mainModule);
  Require require=global.installRequire(context,modulePath,sandboxed);
  require.install(scope);
  Scriptable arguments=context.newArray(scope,new Object[]{});
  scope.defineProperty("String_Node_Str",arguments,ScriptableObject.DONTENUM);
  try {
    File lib=new File(mainModule);
    File script=null;
    if (isMeasure) {
      script=new File(lib,"String_Node_Str");
    }
 else {
      script=new File(lib,"String_Node_Str");
    }
    String uri=script.toURI().toURL().toExternalForm();
    ScriptableObject.putProperty(scope,"String_Node_Str",uri);
    if (isMeasure) {
      require.requireMain(context,"String_Node_Str");
    }
 else {
      require.requireMain(context,"String_Node_Str");
    }
  }
 catch (  Exception e) {
    System.err.println(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
    System.err.println(workingArea.toAbsolutePath().toString());
    e.printStackTrace();
  }
  Context.exit();
  cleanWorkingArea();
  return results.copy();
}