Program: 74359
Project: 74359
Buggy source:
/** 
 * This helper method is used to begin the Ptalon compiler if the ptalonCodeLocation attribute has been updated.
 * @exception IllegalActionException If any exception is thrown.
 */
protected void _initializePtalonCodeLocation() throws IllegalActionException {
  try {
    if (_astCreated) {
      ptalonCodeLocation.setVisibility(Settable.NONE);
      return;
    }
    PtalonLexer lex=null;
    PtalonRecognizer rec=null;
    InputStream inputStream=null;
    URL inputURL=null;
    try {
      inputURL=ptalonCodeLocation.asURL();
      if (inputURL == null) {
        return;
      }
    }
 catch (    IllegalActionException ex) {
      inputURL=Thread.currentThread().getContextClassLoader().getResource(ptalonCodeLocation.getExpression());
      if (inputURL == null) {
        throw new IllegalActionException(this,ex,"String_Node_Str" + "String_Node_Str" + ptalonCodeLocation.getExpression() + "String_Node_Str");
      }
    }
    if (inputURL == null) {
      throw new IllegalActionException(this,"String_Node_Str" + ptalonCodeLocation.asURL() + "String_Node_Str");
    }
    try {
      inputStream=inputURL.openStream();
      lex=new PtalonLexer(inputStream);
      rec=_createPtalonRecognizer(lex);
      rec.setASTNodeClass("String_Node_Str");
      rec.actor_definition();
    }
 catch (    IOException ex2) {
      throw new IllegalActionException(this,ex2,"String_Node_Str" + inputURL + "String_Node_Str");
    }
 finally {
      if (inputStream != null) {
        try {
          inputStream.close();
        }
 catch (        IOException ex4) {
          ex4.printStackTrace();
        }
      }
    }
    _ast=(PtalonAST)rec.getAST();
    PtalonScopeChecker checker=new PtalonScopeChecker();
    checker.setASTNodeClass("String_Node_Str");
    _codeManager=_createPtalonEvaluator(this);
    checker.actor_definition(_ast,_codeManager);
    _ast=(PtalonAST)checker.getAST();
    _codeManager=checker.getCodeManager();
    PtalonPopulator populator=_createPtalonPopulator();
    populator.setASTNodeClass("String_Node_Str");
    populator.actor_definition(_ast,_codeManager);
    _ast=(PtalonAST)populator.getAST();
    _astCreated=true;
    ptalonCodeLocation.setVisibility(Settable.NOT_EDITABLE);
    _codeManager.assignInternalParameters();
  }
 catch (  Exception ex) {
    throw new IllegalActionException(this,ex,"String_Node_Str" + "String_Node_Str" + ptalonCodeLocation + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * This helper method is used to begin the Ptalon compiler if the ptalonCodeLocation attribute has been updated.
 * @exception IllegalActionException If any exception is thrown.
 */
protected void _initializePtalonCodeLocation() throws IllegalActionException {
  try {
    if (_astCreated) {
      ptalonCodeLocation.setVisibility(Settable.NONE);
      return;
    }
    PtalonLexer lex=null;
    PtalonRecognizer rec=null;
    InputStream inputStream=null;
    URL inputURL=null;
    try {
      inputURL=ptalonCodeLocation.asURL();
      if (inputURL == null) {
        return;
      }
    }
 catch (    IllegalActionException ex) {
      inputURL=Thread.currentThread().getContextClassLoader().getResource(ptalonCodeLocation.getExpression());
      if (inputURL == null) {
        throw new IllegalActionException(this,ex,"String_Node_Str" + "String_Node_Str" + ptalonCodeLocation.getExpression() + "String_Node_Str");
      }
    }
    if (inputURL == null) {
      throw new IllegalActionException(this,"String_Node_Str" + ptalonCodeLocation.asURL() + "String_Node_Str");
    }
    try {
      inputStream=inputURL.openStream();
      lex=new PtalonLexer(inputStream);
      rec=_createPtalonRecognizer(lex);
      rec.setASTNodeClass("String_Node_Str");
      rec.actor_definition();
    }
 catch (    IOException ex2) {
      throw new IllegalActionException(this,ex2,"String_Node_Str" + inputURL + "String_Node_Str");
    }
 finally {
      if (inputStream != null) {
        try {
          inputStream.close();
        }
 catch (        IOException ex4) {
          ex4.printStackTrace();
        }
      }
    }
    _ast=(PtalonAST)rec.getAST();
    PtalonScopeChecker checker=new PtalonScopeChecker();
    checker.setASTNodeClass("String_Node_Str");
    _codeManager=_createPtalonEvaluator(this);
    checker.actor_definition(_ast,_codeManager);
    _ast=(PtalonAST)checker.getAST();
    _codeManager=checker.getCodeManager();
    PtalonPopulator populator=_createPtalonPopulator();
    populator.setASTNodeClass("String_Node_Str");
    try {
      populator.actor_definition(_ast,_codeManager);
      _ast=(PtalonAST)populator.getAST();
    }
 catch (    PtalonRuntimeException e) {
      if (_codeManager.hasUnassignedParameters()) {
      }
 else {
        throw e;
      }
    }
    _astCreated=true;
    ptalonCodeLocation.setVisibility(Settable.NOT_EDITABLE);
    _codeManager.assignInternalParameters();
  }
 catch (  Exception ex) {
    throw new IllegalActionException(this,ex,"String_Node_Str" + "String_Node_Str" + ptalonCodeLocation + "String_Node_Str");
  }
}