nus-yam/ex-repair huggingface dataset:
Program: 73612
Project: 73612
Buggy source:
/** 
 * Add hot keys to the actions in the given JGraph.
 * @param jgraph The JGraph to which hot keys are to be added.
 */
protected void _addHotKeys(JGraph jgraph){
  super._addHotKeys(jgraph);
  _classDefinitionController.addHotKeys(getFrame().getJGraph());
}

Fixed version (ground truth):
/** 
 * Add hot keys to the actions in the given JGraph.
 * @param jgraph The JGraph to which hot keys are to be added.
 */
protected void _addHotKeys(JGraph jgraph){
  super._addHotKeys(jgraph);
  _classDefinitionController.addHotKeys(getFrame().getJGraph());
  StringParameter actorInteractionAddon;
  try {
    actorInteractionAddon=(StringParameter)this.getConfiguration().getAttribute("String_Node_Str",Parameter.class);
    if (actorInteractionAddon != null) {
      _dbActorController.addHotKeys(getFrame().getJGraph());
    }
  }
 catch (  Exception e) {
  }
}
Program: 73615
Project: 73615
Buggy source:
/** 
 * Add hot keys to the actions in the given JGraph.
 * @param jgraph The JGraph to which hot keys are to be added.
 */
protected void _addHotKeys(JGraph jgraph){
  super._addHotKeys(jgraph);
  _entityController.addHotKeys(jgraph);
  _classDefinitionController.addHotKeys(jgraph);
  _attributeController.addHotKeys(jgraph);
}

Fixed version (ground truth):
/** 
 * Add hot keys to the actions in the given JGraph.
 * @param jgraph The JGraph to which hot keys are to be added.
 */
protected void _addHotKeys(JGraph jgraph){
  super._addHotKeys(jgraph);
  _entityController.addHotKeys(jgraph);
  _classDefinitionController.addHotKeys(jgraph);
  _attributeController.addHotKeys(jgraph);
  StringParameter actorInteractionAddon;
  try {
    actorInteractionAddon=(StringParameter)this.getConfiguration().getAttribute("String_Node_Str",Parameter.class);
    if (actorInteractionAddon != null) {
      _dbActorController.addHotKeys(jgraph);
    }
  }
 catch (  Exception e) {
  }
}
Program: 73616
Project: 73616
Buggy source:
/** 
 * Set the configuration.  The configuration is used when opening documentation files.
 * @param configuration The configuration.
 */
public void setConfiguration(Configuration configuration){
  super.setConfiguration(configuration);
  _attributeController.setConfiguration(configuration);
  _classDefinitionController.setConfiguration(configuration);
  _entityController.setConfiguration(configuration);
  _entityPortController.setConfiguration(configuration);
  _relationController.setConfiguration(configuration);
  _linkController.setConfiguration(configuration);
}

Fixed version (ground truth):
/** 
 * Set the configuration.  The configuration is used when opening documentation files.
 * @param configuration The configuration.
 */
public void setConfiguration(Configuration configuration){
  super.setConfiguration(configuration);
  _attributeController.setConfiguration(configuration);
  _classDefinitionController.setConfiguration(configuration);
  _entityController.setConfiguration(configuration);
  _entityPortController.setConfiguration(configuration);
  _relationController.setConfiguration(configuration);
  _linkController.setConfiguration(configuration);
  StringParameter actorInteractionAddon;
  try {
    actorInteractionAddon=(StringParameter)this.getConfiguration().getAttribute("String_Node_Str",Parameter.class);
    if (actorInteractionAddon != null) {
      _dbActorController.setConfiguration(configuration);
    }
  }
 catch (  Exception e) {
  }
}
Program: 73617
Project: 73617
Buggy source:
/** 
 * Return the greater concept of the counterexample.
 * @return The greater concept
 * @see java.util.Map.Entry#getValue()
 */
public Concept getValue(){
  return greater;
}

Fixed version (ground truth):
/** 
 * Return the greater concept of the counterexample.
 * @return The greater concept
 * @see java.util.Map.Entry#getValue()
 * @see #setValue(Concept)
 */
public Concept getValue(){
  return greater;
}
Program: 73618
Project: 73618
Buggy source:
/** 
 * Do nothing. (Counterexamples are immutable)
 * @param value Ignored
 * @return Always return null.
 * @see java.util.Map.Entry#setValue(java.lang.Object)
 */
public Concept setValue(Concept value){
  return null;
}

Fixed version (ground truth):
/** 
 * Do nothing. (Counterexamples are immutable)
 * @param value Ignored
 * @return Always return null.
 * @see java.util.Map.Entry#setValue(java.lang.Object)
 * @see #getValue()
 */
public Concept setValue(Concept value){
  return null;
}
Program: 73620
Project: 73620
Buggy source:
/** 
 * Override the base class to record the operation choice.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If the change is not acceptableto this container.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == operation) {
    String newValue=operation.stringValue();
    if (newValue.equals("String_Node_Str")) {
      _addOperation=true;
    }
 else {
      _addOperation=false;
    }
  }
 else   if (attribute == channel) {
    String newValue=channel.stringValue();
    if (!newValue.equals(_channel)) {
      NamedObj container=getContainer();
      if (container instanceof CompositeActor && !(_channel == null || _channel.trim().equals("String_Node_Str"))) {
        ((CompositeActor)container).unlinkToPublishedPort(_channelPattern,input,_global);
      }
      _channel=newValue;
      super.attributeChanged(attribute);
      _channelPattern=Pattern.compile(_channel);
    }
  }
 else   if (attribute == global) {
    _global=((BooleanToken)global.getToken()).booleanValue();
  }
 else {
    super.attributeChanged(attribute);
  }
}

Fixed version (ground truth):
/** 
 * Override the base class to record the operation choice.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If the change is not acceptableto this container.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == operation) {
    String newValue=operation.stringValue();
    if (newValue.equals("String_Node_Str")) {
      _addOperation=true;
    }
 else {
      _addOperation=false;
    }
  }
 else   if (attribute == channel) {
    String newValue=channel.stringValue();
    if (!newValue.equals(_channel)) {
      NamedObj container=getContainer();
      if (container instanceof CompositeActor && !(_channel == null || _channel.trim().equals("String_Node_Str"))) {
        ((CompositeActor)container).unlinkToPublishedPort(_channelPattern,input,_global);
      }
      _channel=newValue;
      super.attributeChanged(attribute);
      _channelPattern=Pattern.compile(_channel);
    }
  }
 else   if (attribute == global) {
    boolean newValue=((BooleanToken)global.getToken()).booleanValue();
    if (newValue == false && _global == true) {
      NamedObj container=getContainer();
      if (container instanceof CompositeActor && !(_channel == null || _channel.trim().equals("String_Node_Str"))) {
        ((CompositeActor)container).unlinkToPublishedPort(_channelPattern,input,_global);
      }
    }
    _global=newValue;
  }
 else {
    super.attributeChanged(attribute);
  }
}
Program: 73621
Project: 73621
Buggy source:
/** 
 * React to a change in an attribute.  This method is called by a contained attribute when its value changes.  This overrides the base class so that if the attribute is an instance of TypeAttribute, then it sets the type of the port.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If the change is not acceptableto this container.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  super.attributeChanged(attribute);
  if (attribute == recompileHierarchy) {
    if (((BooleanToken)recompileHierarchy.getToken()).booleanValue()) {
      List<?> entities=entityList(ModularCodeGenTypedCompositeActor.class);
      for (      Object entity : entities) {
        ((ModularCodeGenTypedCompositeActor)entity).recompileHierarchy.setToken(new BooleanToken(true));
      }
    }
  }
 else   if (attribute != recompileThisLevel) {
  }
}

Fixed version (ground truth):
/** 
 * React to a change in an attribute.  This method is called by a contained attribute when its value changes.  This overrides the base class so that if the attribute is an instance of TypeAttribute, then it sets the type of the port.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If the change is not acceptableto this container.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  super.attributeChanged(attribute);
  if (attribute == recompileHierarchy) {
    if (((BooleanToken)recompileHierarchy.getToken()).booleanValue()) {
      List<?> entities=entityList(ModularCodeGenTypedCompositeActor.class);
      for (      Object entity : entities) {
        ((ModularCodeGenTypedCompositeActor)entity).recompileHierarchy.setToken(new BooleanToken(true));
      }
    }
  }
 else   if (attribute == recompileThisLevel) {
    populate();
  }
 else   if (attribute != recompileThisLevel) {
  }
}
Program: 73624
Project: 73624
Buggy source:
/** 
 * Override the base class to record the operation choice.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If the change is not acceptableto this container.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == operation) {
    String newValue=operation.stringValue();
    if (newValue.equals("String_Node_Str")) {
      _addOperation=true;
    }
 else {
      _addOperation=false;
    }
  }
 else   if (attribute == channel) {
    String newValue=channel.stringValue();
    if (!newValue.equals(_channel)) {
      NamedObj container=getContainer();
      if (container instanceof CompositeActor && !(_channel == null || _channel.trim().equals("String_Node_Str"))) {
        ((CompositeActor)container).unlinkToPublishedPort(_channelPattern,input);
      }
      _channel=newValue;
      super.attributeChanged(attribute);
      _channelPattern=Pattern.compile(_channel);
    }
  }
 else   if (attribute == global) {
    _global=((BooleanToken)global.getToken()).booleanValue();
  }
 else {
    super.attributeChanged(attribute);
  }
}

Fixed version (ground truth):
/** 
 * Override the base class to record the operation choice.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If the change is not acceptableto this container.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == operation) {
    String newValue=operation.stringValue();
    if (newValue.equals("String_Node_Str")) {
      _addOperation=true;
    }
 else {
      _addOperation=false;
    }
  }
 else   if (attribute == channel) {
    String newValue=channel.stringValue();
    if (!newValue.equals(_channel)) {
      NamedObj container=getContainer();
      if (container instanceof CompositeActor && !(_channel == null || _channel.trim().equals("String_Node_Str"))) {
        ((CompositeActor)container).unlinkToPublishedPort(_channelPattern,input,_global);
      }
      _channel=newValue;
      super.attributeChanged(attribute);
      _channelPattern=Pattern.compile(_channel);
    }
  }
 else   if (attribute == global) {
    _global=((BooleanToken)global.getToken()).booleanValue();
  }
 else {
    super.attributeChanged(attribute);
  }
}
Program: 73629
Project: 73629
Buggy source:
/** 
 * Parse the specified command-line arguments, instanting classes and reading files that are specified.
 * @param basePath The basePath to look for configurationsin, usually "ptolemy/configs", but other tools might have other configurations in other directories
 * @param args The command-line arguments.
 * @exception Exception If command line arguments have problems.
 */
public MoMLApplication(String basePath,String[] args) throws Exception {
  super(basePath,args);
  MessageHandler.setMessageHandler(new GraphicalMessageHandler());
}

Fixed version (ground truth):
/** 
 * Parse the specified command-line arguments, instanting classes and reading files that are specified.
 * @param basePath The basePath to look for configurationsin, usually "ptolemy/configs", but other tools might have other configurations in other directories
 * @param args The command-line arguments.
 * @exception Exception If command line arguments have problems.
 */
public MoMLApplication(String basePath,String[] args) throws Exception {
  super(basePath,args);
  MessageHandler.setMessageHandler(new ActorGraphicalMessageHandler());
}
Program: 73631
Project: 73631
Buggy source:
/** 
 * Get the model name for the given model id.  
 * @param modelId Model If for which the model name is required. 
 * @return Model name for the given model id, null if not found.
 * @throws XmlException
 */
private String _getModelNameFromModelId(String modelId) throws XmlException {
  String modelName=null;
  String query="String_Node_Str" + _params.getContainerName() + "String_Node_Str"+ "String_Node_Str"+ modelId+ "String_Node_Str"+ "String_Node_Str";
  XmlQueryContext context=_xmlManager.createQueryContext();
  XmlResults results=_xmlManager.query(query,context,null);
  if (results != null) {
    XmlValue value;
    while (results.hasNext()) {
      value=results.next();
      modelName=value.asString();
      modelName=modelId.substring(modelId.lastIndexOf('/') + 1);
    }
  }
  return modelName;
}

Fixed version (ground truth):
/** 
 * Get the model name for the given model id.  
 * @param modelId Model If for which the model name is required. 
 * @return Model name for the given model id, null if not found.
 * @throws XmlException
 */
private String _getModelNameFromModelId(String modelId) throws XmlException {
  String modelName=null;
  String query="String_Node_Str" + _params.getContainerName() + "String_Node_Str"+ "String_Node_Str"+ modelId+ "String_Node_Str"+ "String_Node_Str";
  XmlQueryContext context=_xmlManager.createQueryContext();
  XmlResults results=_xmlManager.query(query,context,null);
  if (results != null) {
    XmlValue value;
    while (results.hasNext()) {
      value=results.next();
      modelName=value.asString();
      modelName=modelName.substring(modelName.lastIndexOf('/') + 1);
    }
  }
  return modelName;
}
Program: 73633
Project: 73633
Buggy source:
@Override public void windowClosed(WindowEvent e){
  _sourceFrame.setEnabled(true);
}

Fixed version (ground truth):
@Override public void windowClosed(WindowEvent e){
  _sourceFrame.setEnabled(true);
  _sourceFrame.toFront();
}
Program: 73634
Project: 73634
Buggy source:
@Override public void windowClosing(WindowEvent e){
  _sourceFrame.setEnabled(true);
}

Fixed version (ground truth):
@Override public void windowClosing(WindowEvent e){
}
Program: 73635
Project: 73635
Buggy source:
public void add(Concept x1,Concept x2){
  _counterexamples.put(x1,x2);
}

Fixed version (ground truth):
public void add(Concept x1,Concept x2){
  _counterexamples.remove(x1,x2);
  _counterexamples.put(x1,x2);
}
Program: 73637
Project: 73637
Buggy source:
/** 
 * Evaluate a branch of the if statement pointed to by _ifNode and return the result.
 * @param childNumber 1 for the then branch, and 2 for theelse branch.
 * @param xValue The value of the variable "x" during evaluation.
 * @return The concept that the given child evaluates to.
 * @exception IllegalActionException If there is a problem whileevaluating the parse tree, or an invalid childNumber is passed.
 */
private Concept _evaluateChild(int childNumber,Concept xValue) throws IllegalActionException {
  ptolemy.data.expr.ASTPtRootNode childNode=(ptolemy.data.expr.ASTPtRootNode)_ifNode.jjtGetChild(childNumber);
  List<String> argumentNames=new LinkedList<String>();
  argumentNames.add("String_Node_Str");
  List<Concept> argumentValues=new LinkedList<Concept>();
  argumentValues.add(xValue);
  List<Ontology> argumentDomains=new LinkedList<Ontology>();
  argumentDomains.add(_domainOntology);
  ParseTreeEvaluator evaluator=new ExpressionConceptFunctionParseTreeEvaluator(argumentNames,argumentValues,null,argumentDomains);
  ConceptToken evaluatedToken=(ConceptToken)evaluator.evaluateParseTree(childNode);
  return evaluatedToken.conceptValue();
}

Fixed version (ground truth):
/** 
 * Evaluate a branch of the if statement pointed to by _ifNode and return the result.
 * @param childNumber 1 for the then branch, and 2 for theelse branch.
 * @param xValue The value of the variable "x" during evaluation.
 * @return The concept that the given child evaluates to.
 * @exception IllegalActionException If there is a problem whileevaluating the parse tree, or an invalid childNumber is passed.
 */
private Concept _evaluateChild(int childNumber,Concept xValue) throws IllegalActionException {
  ptolemy.data.expr.ASTPtRootNode childNode=(ptolemy.data.expr.ASTPtRootNode)_ifNode.jjtGetChild(childNumber);
  return _evaluateNode(childNode,xValue);
}
Program: 73640
Project: 73640
Buggy source:
private void _importByValue(){
  ArrayList<String> modelNames=new ArrayList();
  for (  SearchResultPanel panel : _resultPanelList) {
    modelNames.addAll(panel.getSelections());
  }
  for (  String modelName : modelNames) {
    try {
      Entity modelToImport=LoadManager.importModel(modelName,false,_containerModel);
      if (modelToImport != null) {
        MoMLChangeRequest change=new MoMLChangeRequest(this,_containerModel,modelToImport.exportMoML());
        change.setUndoable(true);
        _containerModel.requestChange(change);
      }
 else {
        throw new Exception();
      }
    }
 catch (    Exception e) {
      MessageHandler.error("String_Node_Str",e);
    }
  }
  _sourceFrame.toFront();
  JOptionPane.showMessageDialog(_sourceFrame,"String_Node_Str");
}

Fixed version (ground truth):
private void _importByValue(){
  ArrayList<String> modelNames=new ArrayList();
  for (  SearchResultPanel panel : _resultPanelList) {
    modelNames.addAll(panel.getSelections());
  }
  if (modelNames.size() > 0) {
    for (    String modelName : modelNames) {
      try {
        Entity modelToImport=LoadManager.importModel(modelName,false,_containerModel);
        if (modelToImport != null) {
          MoMLChangeRequest change=new MoMLChangeRequest(this,_containerModel,modelToImport.exportMoML());
          change.setUndoable(true);
          _containerModel.requestChange(change);
        }
 else {
          throw new Exception();
        }
      }
 catch (      Exception e) {
        MessageHandler.error("String_Node_Str",e);
      }
    }
    _sourceFrame.toFront();
    JOptionPane.showMessageDialog(_sourceFrame,"String_Node_Str");
  }
 else {
    JOptionPane.showMessageDialog(this,"String_Node_Str");
  }
}
Program: 73641
Project: 73641
Buggy source:
private void _importByReference(){
  ArrayList<String> modelNames=new ArrayList();
  for (  SearchResultPanel panel : _resultPanelList) {
    modelNames.addAll(panel.getSelections());
  }
  for (  String modelName : modelNames) {
    try {
      Entity modelToImport=LoadManager.importModel(modelName,true,_containerModel);
      if (modelToImport != null) {
        MoMLChangeRequest change=new MoMLChangeRequest(this,_containerModel,modelToImport.exportMoML());
        change.setUndoable(true);
        _containerModel.requestChange(change);
      }
 else {
        throw new Exception();
      }
    }
 catch (    Exception e) {
      MessageHandler.error("String_Node_Str",e);
    }
  }
  _sourceFrame.toFront();
  JOptionPane.showMessageDialog(_sourceFrame,"String_Node_Str");
}

Fixed version (ground truth):
private void _importByReference(){
  ArrayList<String> modelNames=new ArrayList();
  for (  SearchResultPanel panel : _resultPanelList) {
    modelNames.addAll(panel.getSelections());
  }
  if (modelNames.size() > 0) {
    for (    String modelName : modelNames) {
      try {
        Entity modelToImport=LoadManager.importModel(modelName,true,_containerModel);
        if (modelToImport != null) {
          MoMLChangeRequest change=new MoMLChangeRequest(this,_containerModel,modelToImport.exportMoML());
          change.setUndoable(true);
          _containerModel.requestChange(change);
        }
 else {
          throw new Exception();
        }
      }
 catch (      Exception e) {
        MessageHandler.error("String_Node_Str",e);
      }
    }
    _sourceFrame.toFront();
    JOptionPane.showMessageDialog(_sourceFrame,"String_Node_Str");
  }
 else {
    JOptionPane.showMessageDialog(this,"String_Node_Str");
  }
}
Program: 73642
Project: 73642
Buggy source:
/** 
 * Implement the update method for Observer interface. Call display to display search results.
 * @param buffer The observer.  Only handled if it is an instance of SearchResultBuffer.
 * @param arg Option argument.  This is unused, but included by Java conventions.
 */
public void update(Observable buffer,Object arg){
  if (buffer instanceof SearchResultBuffer) {
    ArrayList<XMLDBModel> results=((SearchResultBuffer)buffer).getResults();
    if (results != null && results.size() > 0) {
      display(results);
    }
 else {
      if (_resultPanelList.size() == 0) {
        JOptionPane.showMessageDialog(this,"String_Node_Str");
      }
 else {
        JOptionPane.showMessageDialog(this,"String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Implement the update method for Observer interface. Call display to display search results.
 * @param buffer The observer.  Only handled if it is an instance of SearchResultBuffer.
 * @param arg Option argument.  This is unused, but included by Java conventions.
 */
public void update(Observable buffer,Object arg){
  if (buffer instanceof SearchResultBuffer) {
    ArrayList<XMLDBModel> results=((SearchResultBuffer)buffer).getResults();
    if (results != null && results.size() > 0) {
      display(results);
    }
 else {
      if (_resultPanelList.size() == 0) {
        JOptionPane.showMessageDialog(this,"String_Node_Str");
      }
 else {
        JOptionPane.showMessageDialog(this,"String_Node_Str");
      }
      _cancelButton.setEnabled(false);
    }
  }
}
Program: 73643
Project: 73643
Buggy source:
/** 
 * Construct an AddSubtract adapter.
 * @param actor the associated actor
 */
public MovingAverage(ptolemy.actor.lib.MovingAverage actor){
  super(actor);
}

Fixed version (ground truth):
/** 
 * Construct a MovingAverage adapter.
 * @param actor the associated actor
 */
public MovingAverage(ptolemy.actor.lib.MovingAverage actor){
  super(actor);
}
Program: 73644
Project: 73644
Buggy source:
/** 
 * Construct a AddSubtract adapter.
 * @param actor The given ptolemy.actor.lib.AddSubtract actor.
 */
public SampleDelay(ptolemy.domains.sdf.lib.SampleDelay actor){
  super(actor);
}

Fixed version (ground truth):
/** 
 * Construct a SampleDelay adapter.
 * @param actor The given ptolemy.domains.sdf.lib.SampleDelay actor.
 */
public SampleDelay(ptolemy.domains.sdf.lib.SampleDelay actor){
  super(actor);
}
Program: 73645
Project: 73645
Buggy source:
/** 
 * Generate preinitialize code. Read the <code>preinitBlock</code> from AddSubtract.c, replace macros with their values and returns the processed code block.
 * @return The generated code.
 * @exception IllegalActionException If the code stream encounters anerror in processing the specified code block(s).
 */
@Override public String generatePreinitializeCode() throws IllegalActionException {
  super.generatePreinitializeCode();
  ptolemy.domains.sdf.lib.UpSample actor=(ptolemy.domains.sdf.lib.UpSample)getComponent();
  ArrayList<String> args=new ArrayList<String>();
  Type type=actor.input.getType();
  args.add(targetType(type));
  CodeStream codeStream=_templateParser.getCodeStream();
  if (codeStream.isEmpty()) {
    codeStream.append(_eol + getCodeGenerator().comment("String_Node_Str" + getComponent().getName()));
  }
  codeStream.appendCodeBlock("String_Node_Str",args);
  return processCode(codeStream.toString());
}

Fixed version (ground truth):
/** 
 * Generate preinitialize code. Read the <code>preinitBlock</code> from the template file. replace macros with their values and returns the processed code block.
 * @return The generated code.
 * @exception IllegalActionException If the code stream encounters anerror in processing the specified code block(s).
 */
@Override public String generatePreinitializeCode() throws IllegalActionException {
  super.generatePreinitializeCode();
  ptolemy.domains.sdf.lib.UpSample actor=(ptolemy.domains.sdf.lib.UpSample)getComponent();
  ArrayList<String> args=new ArrayList<String>();
  Type type=actor.input.getType();
  args.add(targetType(type));
  CodeStream codeStream=_templateParser.getCodeStream();
  if (codeStream.isEmpty()) {
    codeStream.append(_eol + getCodeGenerator().comment("String_Node_Str" + getComponent().getName()));
  }
  codeStream.appendCodeBlock("String_Node_Str",args);
  return processCode(codeStream.toString());
}
Program: 73646
Project: 73646
Buggy source:
/** 
 * Construct a AddSubtract adapter.
 * @param actor The given ptolemy.actor.lib.AddSubtract actor.
 */
public Const(ptolemy.actor.lib.Const actor){
  super(actor);
}

Fixed version (ground truth):
/** 
 * Construct a Const adapter.
 * @param actor The given ptolemy.actor.lib.Const actor.
 */
public Const(ptolemy.actor.lib.Const actor){
  super(actor);
}
Program: 73647
Project: 73647
Buggy source:
/** 
 * Construct a AddSubtract adapter.
 * @param actor The given ptolemy.actor.lib.AddSubtract actor.
 */
public SampleDelay(ptolemy.domains.sdf.lib.SampleDelay actor){
  super(actor);
}

Fixed version (ground truth):
/** 
 * Construct a SampleDelay adapter.
 * @param actor The given ptolemy.domains.sdf.lib.SampleDelay actor.
 */
public SampleDelay(ptolemy.domains.sdf.lib.SampleDelay actor){
  super(actor);
}
Program: 73648
Project: 73648
Buggy source:
/** 
 * Check with the given name meet the attribute or model name convention. 
 * @param name The name to be verified. 
 * @return true - if the name is valid.<br>false - if the name is invalid. 
 */
public static boolean checkAttributeModelName(String name){
  if (name == null || name.trim().isEmpty()) {
    return false;
  }
  if (name.matches("String_Node_Str")) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Check with the given name meet the attribute or model name convention. 
 * @param name The name to be verified. 
 * @return true - if the name is valid.<br>false - if the name is invalid. 
 * @exception IllegalNameException Thrown if the verifying name is invalid. 
 */
public static boolean checkAttributeModelName(String name) throws IllegalNameException {
  if (name == null || name.trim().isEmpty()) {
    throw new IllegalNameException("String_Node_Str");
  }
  if (name.matches("String_Node_Str")) {
    return true;
  }
 else {
    throw new IllegalNameException("String_Node_Str" + "String_Node_Str");
  }
}
Program: 73649
Project: 73649
Buggy source:
/** 
 * Validate whether the search criteria that the user has input is valid or  not. 
 * @return true - the search criteria is valid.<br>false - the search criteria is invalid. 
 * @exception NameDuplicationException Thrown if attributes with duplicatednames are found in the search criteria. 
 * @exception IllegalActionException Thrown if the intend action is illegal. 
 */
private boolean _isValid() throws NameDuplicationException, IllegalActionException {
  if (_attributesListPanel.getAttributeCount() == 0 && _attributesListPanel.getModelName().trim().isEmpty()) {
    return true;
  }
  if (!_attributesListPanel.getModelName().trim().isEmpty()) {
    if (!Utilities.checkAttributeModelName(_attributesListPanel.getModelName())) {
      JOptionPane.showMessageDialog(this,"String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
      return false;
    }
  }
  if (_attributesListPanel.containsDuplicates()) {
    JOptionPane.showMessageDialog(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
    return false;
  }
  if (!_attributesListPanel.allAttributeNamesSet()) {
    JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
    return false;
  }
  if (!_attributesListPanel.allAttributeValuesSet()) {
    JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Validate whether the search criteria that the user has input is valid or  not. 
 * @return true - the search criteria is valid.<br>false - the search criteria is invalid. 
 * @exception NameDuplicationException Thrown if attributes with duplicatednames are found in the search criteria. 
 * @exception IllegalActionException Thrown if the intend action is illegal. 
 */
private boolean _isValid() throws NameDuplicationException, IllegalActionException {
  if (_attributesListPanel.getAttributeCount() == 0 && _attributesListPanel.getModelName().trim().isEmpty()) {
    return true;
  }
  if (!_attributesListPanel.getModelName().trim().isEmpty()) {
    try {
      Utilities.checkAttributeModelName(_attributesListPanel.getModelName());
    }
 catch (    IllegalNameException e) {
      JOptionPane.showMessageDialog(this,"String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
      return false;
    }
  }
  if (_attributesListPanel.containsDuplicates()) {
    JOptionPane.showMessageDialog(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
    return false;
  }
  if (!_attributesListPanel.allAttributeNamesSet()) {
    JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
    return false;
  }
  if (!_attributesListPanel.allAttributeValuesSet()) {
    JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE,null);
    return false;
  }
  return true;
}
Program: 73651
Project: 73651
Buggy source:
/** 
 * Validate whether the added item is valid to add to the list. 
 * @return true - It is valid to add that item.<br>false - It is invalid to add that item.
 */
private boolean _validate(){
  if (!Utilities.checkAttributeModelName(_listItemTextField.getText())) {
    return false;
  }
  ArrayModelList modelList=((ArrayModelList)_itemsJList.getModel());
  for (int i=0; i < modelList.getSize(); i++) {
    if (_listItemTextField.getText().equals(modelList.getElementAt(i))) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Validate whether the added item is valid to add to the list. 
 * @return true - It is valid to add that item.<br>false - It is invalid to add that item.
 * @exception IllegalNameException Thrown if the item value is legal. 
 */
private boolean _validate() throws IllegalNameException {
  try {
    Utilities.checkAttributeModelName(_listItemTextField.getText());
  }
 catch (  IllegalNameException e) {
    throw new IllegalNameException("String_Node_Str" + "String_Node_Str",e);
  }
  ArrayModelList modelList=((ArrayModelList)_itemsJList.getModel());
  for (int i=0; i < modelList.getSize(); i++) {
    if (_listItemTextField.getText().equals(modelList.getElementAt(i))) {
      throw new IllegalNameException("String_Node_Str");
    }
  }
  return true;
}
Program: 73653
Project: 73653
Buggy source:
/** 
 * Set the graph search criteria.
 * @param graphSearchCriteria The graph search criteria.
 */
public void setGraphSearchCriteria(DBGraphSearchCriteria graphSearchCriteria){
  this._graphSearchCriteria=graphSearchCriteria;
}

Fixed version (ground truth):
/** 
 * Set the graph search criteria.
 * @param graphSearchCriteria The graph search criteria.
 * @see #getGraphSearchCriteria
 */
public void setGraphSearchCriteria(DBGraphSearchCriteria graphSearchCriteria){
  this._graphSearchCriteria=graphSearchCriteria;
}
Program: 73654
Project: 73654
Buggy source:
/** 
 * Return the graphical search criteria.
 * @return The graph search criteria.
 */
public DBGraphSearchCriteria getGraphSearchCriteria(){
  return _graphSearchCriteria;
}

Fixed version (ground truth):
/** 
 * Return the graphical search criteria.
 * @return The graph search criteria.
 * @see #setGraphSearchCriteria
 */
public DBGraphSearchCriteria getGraphSearchCriteria(){
  return _graphSearchCriteria;
}
Program: 73655
Project: 73655
Buggy source:
/** 
 * Create an XML string representation of XMLDBAttribute object.
 * @return The XML string representation of XMLDBAttribute object.
 */
public String getAttributeXMLStringFormat(){
  String attributeNode="String_Node_Str" + _attributeId + "String_Node_Str"+ "String_Node_Str"+ _attributeName+ "String_Node_Str"+ _attributeType+ "String_Node_Str";
  if (_attributeType.equalsIgnoreCase(XMLDBAttribute.ATTRIBUTE_TYPE_LIST)) {
    if (_attributeValues != null && _attributeValues.size() > 0) {
      for (int i=0; i < _attributeValues.size(); i++) {
        attributeNode=attributeNode + "String_Node_Str" + _attributeValues.get(i).toString()+ "String_Node_Str";
      }
    }
  }
  attributeNode=attributeNode + "String_Node_Str";
  return attributeNode;
}

Fixed version (ground truth):
/** 
 * Create an XML string representation of XMLDBAttribute object.
 * @return The XML string representation of XMLDBAttribute object.
 */
public String getAttributeXMLStringFormat(){
  String attributeNode="String_Node_Str" + _attributeId + "String_Node_Str"+ "String_Node_Str"+ _attributeName+ "String_Node_Str"+ _attributeType+ "String_Node_Str";
  StringBuffer attributeBuffer=new StringBuffer(attributeNode);
  if (_attributeType.equalsIgnoreCase(XMLDBAttribute.ATTRIBUTE_TYPE_LIST)) {
    if (_attributeValues != null && _attributeValues.size() > 0) {
      for (int i=0; i < _attributeValues.size(); i++) {
        attributeBuffer.append("String_Node_Str" + _attributeValues.get(i).toString() + "String_Node_Str");
      }
    }
  }
  attributeBuffer.append("String_Node_Str");
  attributeNode=attributeBuffer.toString();
  return attributeNode;
}
Program: 73656
Project: 73656
Buggy source:
/** 
 * Test method for   {@link ptdb.kernel.database.RebuildReferenceFile#RebuildReferenceFile(ptdb.common.dto.DBConnectionParameters)}.
 */
@Test public void testRebuildReferenceFile(){
  DBConnectionParameters dbConnectionParameters=DBConnectorFactory.getDBConnectionParameters();
  try {
    RebuildReferenceFile rebuildReferenceFile=new RebuildReferenceFile(dbConnectionParameters);
  }
 catch (  DBConnectionException e) {
    fail("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link ptdb.kernel.database.RebuildReferenceFile#RebuildReferenceFile(ptdb.common.dto.DBConnectionParameters)}.
 */
@Test public void testRebuildReferenceFile(){
  DBConnectionParameters dbConnectionParameters=DBConnectorFactory.getDBConnectionParameters();
  try {
    new RebuildReferenceFile(dbConnectionParameters);
  }
 catch (  DBConnectionException e) {
    fail("String_Node_Str" + e.getMessage());
  }
}
Program: 73657
Project: 73657
Buggy source:
/** 
 * Test method for   {@link ptdb.kernel.database.RebuildReferenceFile#main(java.lang.String[])}.
 * @throws Exception 
 */
@Test public void testMain() throws Exception {
  try {
    BufferedReader mockBufferedReader=PowerMock.createMock(BufferedReader.class);
    InputStreamReader mockInputStreamReader=PowerMock.createMock(InputStreamReader.class);
    PowerMock.expectNew(InputStreamReader.class,System.in).andReturn(mockInputStreamReader);
    PowerMock.expectNew(BufferedReader.class,mockInputStreamReader).andReturn(mockBufferedReader);
    EasyMock.expect(mockBufferedReader.readLine()).andReturn("String_Node_Str");
    mockBufferedReader.close();
    PowerMock.replay(InputStreamReader.class,BufferedReader.class,mockBufferedReader,mockInputStreamReader);
    RebuildReferenceFile.main(null);
    PowerMock.verify();
  }
 catch (  IOException e) {
    fail("String_Node_Str" + e.getMessage());
  }
catch (  DBConnectionException e) {
    fail("String_Node_Str" + e.getMessage());
  }
catch (  DBExecutionException e) {
    fail("String_Node_Str" + e.getMessage());
  }
catch (  XMLDBModelParsingException e) {
    fail("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link ptdb.kernel.database.RebuildReferenceFile#main(java.lang.String[])}.
 * @throws Exception 
 */
@Test public void testMain() throws Exception {
  try {
    BufferedReader mockBufferedReader=PowerMock.createMock(BufferedReader.class);
    InputStreamReader mockInputStreamReader=PowerMock.createMock(InputStreamReader.class);
    PowerMock.expectNew(InputStreamReader.class,System.in).andReturn(mockInputStreamReader);
    PowerMock.expectNew(BufferedReader.class,mockInputStreamReader).andReturn(mockBufferedReader);
    EasyMock.expect(mockBufferedReader.readLine()).andReturn("String_Node_Str");
    mockBufferedReader.close();
    PowerMock.replay(InputStreamReader.class,BufferedReader.class,mockBufferedReader,mockInputStreamReader);
    RebuildReferenceFile.main(new String[1]);
    PowerMock.verify();
  }
 catch (  IOException e) {
    fail("String_Node_Str" + e.getMessage());
  }
catch (  DBConnectionException e) {
    fail("String_Node_Str" + e.getMessage());
  }
catch (  DBExecutionException e) {
    fail("String_Node_Str" + e.getMessage());
  }
catch (  XMLDBModelParsingException e) {
    fail("String_Node_Str" + e.getMessage());
  }
}
Program: 73661
Project: 73661
Buggy source:
protected void _addMenus(){
  this.setJMenuBar(_menuBar);
  _fileMenu=new JMenu("String_Node_Str");
  _fileMenu.setMnemonic(KeyEvent.VK_F);
  _menuBar.add(_fileMenu);
  GUIUtilities.addHotKey(this.getRootPane(),_newSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_newSearchCriteriaAction);
  GUIUtilities.addHotKey(this.createRootPane(),_openSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_openSearchCriteriaAction);
  GUIUtilities.addHotKey(this.createRootPane(),_saveSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_saveSearchCriteriaAction);
  GUIUtilities.addHotKey(this.createRootPane(),_saveAsSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_saveAsSearchCriteriaAction);
  GUIUtilities.addHotKey(this.getRootPane(),_exitSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_exitSearchCriteriaAction);
}

Fixed version (ground truth):
/** 
 * Add menus to the menu bar.
 */
protected void _addMenus(){
  this.setJMenuBar(_menuBar);
  _fileMenu=new JMenu("String_Node_Str");
  _fileMenu.setMnemonic(KeyEvent.VK_F);
  _menuBar.add(_fileMenu);
  GUIUtilities.addHotKey(this.getRootPane(),_newSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_newSearchCriteriaAction);
  GUIUtilities.addHotKey(this.createRootPane(),_openSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_openSearchCriteriaAction);
  GUIUtilities.addHotKey(this.createRootPane(),_saveSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_saveSearchCriteriaAction);
  GUIUtilities.addHotKey(this.createRootPane(),_saveAsSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_saveAsSearchCriteriaAction);
  GUIUtilities.addHotKey(this.getRootPane(),_exitSearchCriteriaAction);
  GUIUtilities.addMenuItem(_fileMenu,_exitSearchCriteriaAction);
}
Program: 73663
Project: 73663
Buggy source:
protected void _new(){
  if (isModified()) {
    Object[] options={"String_Node_Str","String_Node_Str","String_Node_Str"};
    int n=JOptionPane.showOptionDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[2]);
    if (n == JOptionPane.YES_OPTION) {
      _save();
    }
 else     if (n == JOptionPane.CANCEL_OPTION) {
      return;
    }
  }
  _topPanel.removeAll();
  _attributesListPanel=new AttributesListPanel(new NamedObj());
  _topPanel.add(_attributesListPanel);
  validate();
  repaint();
  _saveLocation=null;
  _searchCriteria=new SearchCriteria();
  setModified(false);
}

Fixed version (ground truth):
/** 
 * Create new search criteria.  If the currently opened search criteria is changed, give the user an opportunity to save it.
 */
protected void _new(){
  if (isModified()) {
    Object[] options={"String_Node_Str","String_Node_Str","String_Node_Str"};
    int n=JOptionPane.showOptionDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[2]);
    if (n == JOptionPane.YES_OPTION) {
      _save();
    }
 else     if (n == JOptionPane.CANCEL_OPTION) {
      return;
    }
  }
  _topPanel.removeAll();
  _attributesListPanel=new AttributesListPanel(new NamedObj());
  _topPanel.add(_attributesListPanel);
  validate();
  repaint();
  _saveLocation=null;
  _searchCriteria=new SearchCriteria();
  setModified(false);
}
Program: 73664
Project: 73664
Buggy source:
protected void _saveAs(){
  try {
    JFileChooser chooser=new JFileChooser();
    FileFilter filter=new SearchCriteriaFileFilter("String_Node_Str");
    chooser.setFileFilter(filter);
    chooser.setDialogTitle("String_Node_Str");
    if (_saveLocation != null) {
      chooser.setSelectedFile(new File(_saveLocation));
    }
    boolean saveComplete=false;
    while (!saveComplete) {
      if (chooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) {
        return;
      }
 else {
        File filename=chooser.getSelectedFile();
        if (filename.exists() && !filename.getCanonicalFile().toString().equals(_saveLocation)) {
          Object[] options={"String_Node_Str","String_Node_Str"};
          int n=JOptionPane.showOptionDialog(this,filename.toString() + "String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE,null,options,options[1]);
          if (n == JOptionPane.YES_OPTION) {
            saveComplete=true;
          }
 else {
            saveComplete=false;
          }
        }
 else {
          saveComplete=true;
        }
        if (saveComplete) {
          _saveLocation=chooser.getSelectedFile().getCanonicalPath();
          setModified(false);
        }
      }
    }
  }
 catch (  IOException e) {
    MessageHandler.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Save the currently opened search criteria to a new location.
 */
protected void _saveAs(){
  try {
    JFileChooser chooser=new JFileChooser();
    FileFilter filter=new SearchCriteriaFileFilter("String_Node_Str");
    chooser.setFileFilter(filter);
    chooser.setDialogTitle("String_Node_Str");
    if (_saveLocation != null) {
      chooser.setSelectedFile(new File(_saveLocation));
    }
    boolean saveComplete=false;
    while (!saveComplete) {
      if (chooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) {
        return;
      }
 else {
        File filename=chooser.getSelectedFile();
        if (filename.exists() && !filename.getCanonicalFile().toString().equals(_saveLocation)) {
          Object[] options={"String_Node_Str","String_Node_Str"};
          int n=JOptionPane.showOptionDialog(this,filename.toString() + "String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE,null,options,options[1]);
          if (n == JOptionPane.YES_OPTION) {
            saveComplete=true;
          }
 else {
            saveComplete=false;
          }
        }
 else {
          saveComplete=true;
        }
        if (saveComplete) {
          _saveLocation=chooser.getSelectedFile().getCanonicalPath();
          setModified(false);
        }
      }
    }
  }
 catch (  IOException e) {
    MessageHandler.error("String_Node_Str",e);
  }
}
Program: 73665
Project: 73665
Buggy source:
protected void _exit(){
  if (isModified()) {
    Object[] options={"String_Node_Str","String_Node_Str","String_Node_Str"};
    int n=JOptionPane.showOptionDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[2]);
    if (n == JOptionPane.YES_OPTION) {
      _save();
    }
 else     if (n == JOptionPane.CANCEL_OPTION) {
      return;
    }
  }
  dispose();
}

Fixed version (ground truth):
/** 
 * Exit the window.  If the search criteria was changed, give the user an opportunity to save it.
 */
protected void _exit(){
  if (isModified()) {
    Object[] options={"String_Node_Str","String_Node_Str","String_Node_Str"};
    int n=JOptionPane.showOptionDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[2]);
    if (n == JOptionPane.YES_OPTION) {
      _save();
    }
 else     if (n == JOptionPane.CANCEL_OPTION) {
      return;
    }
  }
  dispose();
}
Program: 73666
Project: 73666
Buggy source:
protected void _initActorGraphDBFrame(){
  _newSearchCriteriaAction=new NewSearchCriteriaAction();
  _openSearchCriteriaAction=new OpenSearchCriteriaAction();
  _saveSearchCriteriaAction=new SaveSearchCriteriaAction();
  _saveAsSearchCriteriaAction=new SaveAsSearchCriteriaAction();
  _exitSearchCriteriaAction=new ExitSearchCriteriaAction();
}

Fixed version (ground truth):
/** 
 * Establish all event listeners.
 */
protected void _initActorGraphDBFrame(){
  _newSearchCriteriaAction=new NewSearchCriteriaAction();
  _openSearchCriteriaAction=new OpenSearchCriteriaAction();
  _saveSearchCriteriaAction=new SaveSearchCriteriaAction();
  _saveAsSearchCriteriaAction=new SaveAsSearchCriteriaAction();
  _exitSearchCriteriaAction=new ExitSearchCriteriaAction();
}
Program: 73667
Project: 73667
Buggy source:
protected void _save(){
  if (_saveLocation == null) {
    _saveAs();
  }
 else {
  }
}

Fixed version (ground truth):
/** 
 * Save the currently opened search criteria.
 */
protected void _save(){
  if (_saveLocation == null) {
    _saveAs();
  }
 else {
  }
}
Program: 73672
Project: 73672
Buggy source:
/** 
 * Test the migrateModels() method in the case when the given path is incorrect.
 * @exception Exception Thrown by PowerMock if error occurs in the testing.
 */
@Test public void testMigrateModelsIncorrectPath() throws Exception {
  String directoryPath="String_Node_Str";
  MigrateModelsManager migrateModelsManager=new MigrateModelsManager();
  try {
    String csvFilePath=migrateModelsManager.migrateModels(directoryPath);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertTrue(true);
  }
}

Fixed version (ground truth):
/** 
 * Test the migrateModels() method in the case when the given path is incorrect.
 * @exception Exception Thrown by PowerMock if error occurs in the testing.
 */
@Test public void testMigrateModelsIncorrectPath() throws Exception {
  String directoryPath="String_Node_Str";
  MigrateModelsManager migrateModelsManager=new MigrateModelsManager();
  try {
    migrateModelsManager.migrateModels(directoryPath);
    fail("String_Node_Str");
  }
 catch (  IOException e) {
    assertTrue(true);
  }
}
Program: 73673
Project: 73673
Buggy source:
/** 
 * Test the migrateModels() method in the case when the given path is correct and it contains only the models with no sub directories.
 * @exception Exception Thrown by PowerMock if error occurs in the testing.
 */
@Test public void testMigrateModelsFirstLevel() throws Exception {
  String directoryPath=createDirectory(0,3);
  MigrateModelsManager migrateModelsManager=new MigrateModelsManager();
  try {
    String csvFilePath=migrateModelsManager.migrateModels(directoryPath);
    assertTrue(csvFilePath.equals(directoryPath + "String_Node_Str"));
  }
 catch (  Exception e) {
    fail("String_Node_Str" + e.getMessage());
  }
 finally {
    deleteDirectory(directoryPath);
  }
}

Fixed version (ground truth):
/** 
 * Test the migrateModels() method in the case when the given path is correct and it contains only the models with no sub directories.
 * @exception Exception Thrown by PowerMock if error occurs in the testing.
 */
@Test public void testMigrateModelsFirstLevel() throws Exception {
  String directoryPath=createDirectory(0,3);
  MigrateModelsManager migrateModelsManager=new MigrateModelsManager();
  try {
    String csvFilePath=migrateModelsManager.migrateModels(directoryPath);
    assertTrue(csvFilePath.equals(directoryPath + "String_Node_Str"));
  }
 catch (  IOException e) {
    fail("String_Node_Str" + e.getMessage());
  }
 finally {
    deleteDirectory(directoryPath);
  }
}