Program: 74042
Project: 74042
Buggy source:
/** 
 * React to this item being selected. In this base class, if a source file is specified in the configuration of this item, e.g.: <pre> &lt;configure source="some_file.xml"&gt; &lt;/configure&gt; </pre> then the source is read and its contents are used as the moml text. The moml text can also be given directly: <pre> &lt;configure&gt; &lt;entity name="C" class="ptolemy.actor.lib.Const"&gt; &lt;/entity&gt; &lt;/configure&gt; </pre> Depending on whether the parse parameter is true or false, the moml text may be parsed first or not. If it is parsed, the returned NamedObj is used to generate a new moml string to be applied to the model in the current tableau (the nearest tableau that contains this GUI property). If it is not parsed, then the moml text is directly applied to the model.
 * @param parse Whether the configure text should be parsed before applyingto the current model.
 * @throws Exception If error occurs in performing the action.
 */
public void perform(boolean parse){
  if (_momlText != null) {
    NamedObj originalModel=null;
    CompositeEntity model=null;
    try {
      originalModel=getModel();
      _processUnselectedObjects(originalModel,true);
      model=(CompositeEntity)GTTools.cleanupModel(originalModel);
      if (_parsedObject == null) {
        if (_momlSource != null) {
          URL url=_parser.fileNameToURL(_momlSource,null);
          _parsedObject=_parser.parse(url,url);
          _momlSource=null;
        }
 else {
          _parsedObject=_parser.parse(_momlText);
        }
        _parser.reset();
      }
      PteraModalModel ptera=(PteraModalModel)_parsedObject;
      BasicGraphFrame frame=(BasicGraphFrame)getFrame();
      TransformationListener listener=new TransformationListener(ptera,model,frame);
      Manager manager=ptera.getManager();
      if (manager == null) {
        Workspace workspace=ptera.workspace();
        manager=new Manager(workspace,"String_Node_Str");
        ptera.setManager(manager);
      }
      manager.addExecutionListener(listener);
      try {
        manager.execute();
      }
 catch (      Throwable t) {
        MessageHandler.error("String_Node_Str" + "String_Node_Str",t);
      }
 finally {
        manager.removeExecutionListener(listener);
      }
    }
 catch (    Exception e) {
      throw new InternalErrorException(e);
    }
 finally {
      if (originalModel != null) {
        try {
          _processUnselectedObjects(originalModel,false);
        }
 catch (        KernelException e) {
        }
      }
      if (model != null) {
        try {
          _processUnselectedObjects(model,false);
        }
 catch (        KernelException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * React to this item being selected. In this base class, if a source file is specified in the configuration of this item, e.g.: <pre> &lt;configure source="some_file.xml"&gt; &lt;/configure&gt; </pre> then the source is read and its contents are used as the moml text. The moml text can also be given directly: <pre> &lt;configure&gt; &lt;entity name="C" class="ptolemy.actor.lib.Const"&gt; &lt;/entity&gt; &lt;/configure&gt; </pre> Depending on whether the parse parameter is true or false, the moml text may be parsed first or not. If it is parsed, the returned NamedObj is used to generate a new moml string to be applied to the model in the current tableau (the nearest tableau that contains this GUI property). If it is not parsed, then the moml text is directly applied to the model.
 * @param parse Whether the configure text should be parsed before applyingto the current model.
 * @exception Exception If error occurs in performing the action.
 */
public void perform(boolean parse){
  if (_momlText != null) {
    NamedObj originalModel=null;
    CompositeEntity model=null;
    try {
      originalModel=getModel();
      _processUnselectedObjects(originalModel,true);
      model=(CompositeEntity)GTTools.cleanupModel(originalModel);
      if (_parsedObject == null) {
        if (_momlSource != null) {
          URL url=_parser.fileNameToURL(_momlSource,null);
          _parsedObject=_parser.parse(url,url);
          _momlSource=null;
        }
 else {
          _parsedObject=_parser.parse(_momlText);
        }
        _parser.reset();
      }
      PteraModalModel ptera=(PteraModalModel)_parsedObject;
      BasicGraphFrame frame=(BasicGraphFrame)getFrame();
      TransformationListener listener=new TransformationListener(ptera,model,frame);
      Manager manager=ptera.getManager();
      if (manager == null) {
        Workspace workspace=ptera.workspace();
        manager=new Manager(workspace,"String_Node_Str");
        ptera.setManager(manager);
      }
      manager.addExecutionListener(listener);
      try {
        manager.execute();
      }
 catch (      Throwable t) {
        MessageHandler.error("String_Node_Str" + "String_Node_Str",t);
      }
 finally {
        manager.removeExecutionListener(listener);
      }
    }
 catch (    Exception e) {
      throw new InternalErrorException(e);
    }
 finally {
      if (originalModel != null) {
        try {
          _processUnselectedObjects(originalModel,false);
        }
 catch (        KernelException e) {
        }
      }
      if (model != null) {
        try {
          _processUnselectedObjects(model,false);
        }
 catch (        KernelException e) {
        }
      }
    }
  }
}