nus-yam/ex-repair huggingface dataset:
Program: 75769
Project: 75769
Buggy source:
/** 
 * Create a new analysis based on the given invoke graph and side effect information. 
 */
public MaybeAliasAnalysis(UnitGraph g,InvokeGraph invokeGraph,SideEffectAnalysis sideEffectAnalysis){
  super(g);
  _invokeGraph=invokeGraph;
  _sideEffectAnalysis=sideEffectAnalysis;
  _countMap=new HashMap();
  int index=0;
  _constructorMap=new HashMap();
  for (Iterator units=g.getBody().getUnits().iterator(); units.hasNext(); ) {
    Stmt stmt=(Stmt)units.next();
    if (stmt instanceof DefinitionStmt) {
      Value rvalue=((DefinitionStmt)stmt).getRightOp();
      if (!_isAliasableType(rvalue.getType())) {
        continue;
      }
      if (rvalue instanceof NewExpr || rvalue instanceof NewArrayExpr) {
        Object object=new String("String_Node_Str" + index++ + "String_Node_Str"+ rvalue.toString());
        _constructorMap.put(rvalue,object);
      }
 else       if (rvalue instanceof Constant) {
        Object object=new String("String_Node_Str" + index++ + "String_Node_Str"+ rvalue.toString());
        _constructorMap.put(rvalue,object);
      }
    }
  }
  doAnalysis();
  if (_debug) {
    for (Iterator units=g.getBody().getUnits().iterator(); units.hasNext(); ) {
      Stmt stmt=(Stmt)units.next();
      System.out.println("String_Node_Str" + _countMap.get(stmt) + "String_Node_Str"+ stmt);
    }
  }
  _invokeGraph=null;
  _sideEffectAnalysis=null;
  _countMap=null;
}

Fixed version (ground truth):
/** 
 * Create a new analysis based on the given invoke graph and side effect information. 
 */
public MaybeAliasAnalysis(UnitGraph g,InvokeGraph invokeGraph,SideEffectAnalysis sideEffectAnalysis){
  super(g);
  _invokeGraph=invokeGraph;
  _sideEffectAnalysis=sideEffectAnalysis;
  if (_debug) {
    _countMap=new HashMap();
  }
  int index=0;
  _constructorMap=new HashMap();
  for (Iterator units=g.getBody().getUnits().iterator(); units.hasNext(); ) {
    Stmt stmt=(Stmt)units.next();
    if (stmt instanceof DefinitionStmt) {
      Value rvalue=((DefinitionStmt)stmt).getRightOp();
      if (!_isAliasableType(rvalue.getType())) {
        continue;
      }
      if (rvalue instanceof NewExpr || rvalue instanceof NewArrayExpr) {
        Object object=new String("String_Node_Str" + index++ + "String_Node_Str"+ rvalue.toString());
        _constructorMap.put(rvalue,object);
      }
 else       if (rvalue instanceof Constant) {
        Object object=new String("String_Node_Str" + index++ + "String_Node_Str"+ rvalue.toString());
        _constructorMap.put(rvalue,object);
      }
    }
  }
  doAnalysis();
  if (_debug) {
    for (Iterator units=g.getBody().getUnits().iterator(); units.hasNext(); ) {
      Stmt stmt=(Stmt)units.next();
      System.out.println("String_Node_Str" + _countMap.get(stmt) + "String_Node_Str"+ stmt);
    }
  }
  _invokeGraph=null;
  _sideEffectAnalysis=null;
  _countMap=null;
}
Program: 75770
Project: 75770
Buggy source:
private void _setCanPointToAnything(GraphFlow graph,Object object){
  graph.addEdge(object,_universeRepresentative);
  for (Iterator constructors=_constructorMap.keySet().iterator(); constructors.hasNext(); ) {
    Value constructor=(Value)constructors.next();
    if (object instanceof SootField) {
      SootField field=(SootField)object;
      if (constructor.getType() instanceof RefType && field.getType() instanceof RefType) {
        if (constructor.getType().merge(field.getType(),Scene.v()).equals(constructor.getType())) {
          continue;
        }
      }
    }
    Object target=_constructorMap.get(constructor);
    if (graph.containsNode(target)) {
      graph.addEdge(object,target);
    }
  }
}

Fixed version (ground truth):
private void _setCanPointToAnything(GraphFlow graph,Object object){
  graph.addEdge(object,_universeRepresentative);
  for (Iterator constructors=_constructorMap.keySet().iterator(); constructors.hasNext(); ) {
    Value constructor=(Value)constructors.next();
    if (object instanceof SootField) {
      SootField field=(SootField)object;
      Type constructorType=constructor.getType();
      Type fieldType=field.getType();
      if (!_isCompatibileAliasAssignment(constructorType,fieldType)) {
        continue;
      }
    }
    Object target=_constructorMap.get(constructor);
    if (graph.containsNode(target)) {
      graph.addEdge(object,target);
    }
  }
}
Program: 75771
Project: 75771
Buggy source:
/** 
 * Return a Token from the matlab engine.
 * @param name Matlab variable name used to initialize the returned Token
 * @return PtolemyII Token.
 * @exception IllegalActionException If the matlab engine is not opened, orif the matlab variable was not found in the engine. In this case, the matlab engine's stdout is included in the exception message.
 * @see Engine
 */
public Token get(String name) throws IllegalActionException {
}

Fixed version (ground truth):
/** 
 * Return a Token from the matlab engine.
 * @param name Matlab variable name used to initialize the returned Token
 * @return PtolemyII Token.
 * @exception IllegalActionException If the matlab engine is not opened, orif the matlab variable was not found in the engine. In this case, the matlab engine's stdout is included in the exception message.
 * @see Engine
 */
public Token get(String name) throws IllegalActionException {
  Token retval=null;
synchronized (semaphore) {
    if (eng == 0) {
      throw new IllegalActionException("String_Node_Str" + errNotOpened);
    }
    long ma=ptmatlabEngGetArray(eng,name);
    if (ma == 0) {
      throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str"+ name+ "String_Node_Str"+ getOutput().stringValue());
    }
    retval=_convertMxArrayToToken(ma);
    ptmatlabDestroy(ma,name);
    if (debug > 0) {
      System.out.println("String_Node_Str" + name + "String_Node_Str"+ retval.toString());
    }
  }
  return retval;
}
Program: 75773
Project: 75773
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public Expression(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException, java.lang.Exception {
  super(container,name);
  output=new TypedIOPort(this,"String_Node_Str",false,true);
  expression=new StringAttribute(this,"String_Node_Str");
  _iteration=new Variable(this,"String_Node_Str",new IntToken(1));
  TransientSingletonConfigurableAttribute iconDescription=new TransientSingletonConfigurableAttribute(this,"String_Node_Str");
  iconDescription.configure(null,null,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  matlabEngine=new Engine();
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public Expression(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException, java.lang.Exception {
  super(container,name);
  output=new TypedIOPort(this,"String_Node_Str",false,true);
  expression=new StringAttribute(this,"String_Node_Str");
  _iteration=new Variable(this,"String_Node_Str",new IntToken(1));
  TransientSingletonConfigurableAttribute iconDescription=new TransientSingletonConfigurableAttribute(this,"String_Node_Str");
  matlabEngine=new Engine();
}
Program: 75777
Project: 75777
Buggy source:
/** 
 * Construct a BoundaryDetector with the specified containing receiver.
 * @param rcvr The receiver containing this BoundaryDetector.
 */
public BoundaryDetector(Receiver rcvr){
  _rcvr=rcvr;
}

Fixed version (ground truth):
/** 
 * Construct a BoundaryDetector with the specified containing receiver.
 * @param receiver The receiver containing this BoundaryDetector.
 */
public BoundaryDetector(Receiver receiver){
  _receiver=receiver;
}
Program: 75780
Project: 75780
Buggy source:
/** 
 * Return the producer receiver that this branch gets data from.
 * @return The producer receiver that this branch gets data from.
 * @see ptolemy.actor.process.BoundaryDetector
 */
public ProcessReceiver getProdReceiver(){
  return _prodRcvr;
}

Fixed version (ground truth):
/** 
 * Return the producer receiver that this branch gets data from.
 * @return The producer receiver that this branch gets data from.
 * @see ptolemy.actor.process.BoundaryDetector
 */
public ProcessReceiver getProdReceiver(){
  return _producerReceiver;
}
Program: 75781
Project: 75781
Buggy source:
/** 
 * Construct a branch object with a producer receiver, a consumer receiver and a branch controller.
 * @param prodRcvr The producer receiver assigned to this branch.
 * @param consRcvr The consumer receiver assigned to this branch.
 * @param cntlr The branch controller assigned to this branch.
 * @exception IllegalActionException If the receivers assigned tothis branch are null or improperly configured.
 */
public Branch(ProcessReceiver prodRcvr,ProcessReceiver consRcvr,BranchController cntlr) throws IllegalActionException {
  _controller=cntlr;
  if (prodRcvr == null || consRcvr == null) {
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str");
  }
  if (!prodRcvr.isProducerReceiver()) {
    String name=((Nameable)consRcvr.getContainer()).getName();
    throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
  }
  _prodRcvr=prodRcvr;
  if (!consRcvr.isConsumerReceiver()) {
    String name=((Nameable)consRcvr.getContainer()).getName();
    throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
  }
  _consRcvr=consRcvr;
}

Fixed version (ground truth):
/** 
 * Construct a branch object with a producer receiver, a consumer receiver and a branch controller.
 * @param producerReceiver The producer receiver assigned to this branch.
 * @param consumerReceiver The consumer receiver assigned to this branch.
 * @param controller The branch controller assigned to this branch.
 * @exception IllegalActionException If the receivers assigned tothis branch are null or improperly configured.
 */
public Branch(ProcessReceiver producerReceiver,ProcessReceiver consumerReceiver,BranchController controller) throws IllegalActionException {
  _controller=controller;
  if (producerReceiver == null || consumerReceiver == null) {
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str");
  }
  if (!producerReceiver.isProducerReceiver()) {
    String name=((Nameable)consumerReceiver.getContainer()).getName();
    throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
  }
  _producerReceiver=producerReceiver;
  if (!consumerReceiver.isConsumerReceiver()) {
    String name=((Nameable)consumerReceiver.getContainer()).getName();
    throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
  }
  _consumerReceiver=consumerReceiver;
}
Program: 75782
Project: 75782
Buggy source:
/** 
 * Transfer a single token from the producer receiver to the consumer receiver. If either the producer receiver or consumer receiver is null then return without attempting token transfer.
 */
public void transferToken(){
  if (_prodRcvr == null) {
    return;
  }
 else   if (_consRcvr == null) {
    return;
  }
  Token token=_prodRcvr.get(this);
  _consRcvr.put(token,this);
}

Fixed version (ground truth):
/** 
 * Transfer a single token from the producer receiver to the consumer receiver. If either the producer receiver or consumer receiver is null then return without attempting token transfer.
 */
public void transferToken(){
  if (_producerReceiver == null) {
    return;
  }
 else   if (_consumerReceiver == null) {
    return;
  }
  Token token=_producerReceiver.get(this);
  _consumerReceiver.put(token,this);
}
Program: 75783
Project: 75783
Buggy source:
/** 
 * Return the consumer receiver that this branch puts data into.
 * @return The consumer receiver that this branch puts data into.
 * @see ptolemy.actor.process.BoundaryDetector
 */
public ProcessReceiver getConsReceiver(){
  return _consRcvr;
}

Fixed version (ground truth):
/** 
 * Return the consumer receiver that this branch puts data into.
 * @return The consumer receiver that this branch puts data into.
 * @see ptolemy.actor.process.BoundaryDetector
 */
public ProcessReceiver getConsReceiver(){
  return _consumerReceiver;
}
Program: 75784
Project: 75784
Buggy source:
/** 
 * Register that the receiver controlled by this branch is no longer blocked.
 * @param rcvr The receiver assigned to this branch forwhich a block is being removed.
 */
public void registerRcvrUnBlocked(ProcessReceiver rcvr){
  if (_rcvrBlocked) {
    _rcvrBlocked=false;
    _controller._branchUnBlocked(rcvr);
  }
}

Fixed version (ground truth):
/** 
 * Register that the receiver controlled by this branch is no longer blocked.
 * @param receiver The receiver assigned to this branch forwhich a block is being removed.
 */
public void registerRcvrUnBlocked(ProcessReceiver receiver){
  if (_receiverBlocked) {
    _receiverBlocked=false;
    _controller._branchUnBlocked(receiver);
  }
}
Program: 75785
Project: 75785
Buggy source:
/** 
 * Register that the receiver controlled by this branch is blocked. The blocked receiver, either the producer or consumer receiver (but not both) are passed as an argument according to which one is blocked.
 * @param rcvr The receiver assigned to this branch thatis blocked.
 */
public void registerRcvrBlocked(ProcessReceiver rcvr){
  if (!_rcvrBlocked) {
    _rcvrBlocked=true;
    _controller._branchBlocked(rcvr);
  }
}

Fixed version (ground truth):
/** 
 * Register that the receiver controlled by this branch is blocked. The blocked receiver, either the producer or consumer receiver (but not both) are passed as an argument according to which one is blocked.
 * @param receiver The receiver assigned to this branch thatis blocked.
 */
public void registerRcvrBlocked(ProcessReceiver receiver){
  if (!_receiverBlocked) {
    _receiverBlocked=true;
    _controller._branchBlocked(receiver);
  }
}
Program: 75786
Project: 75786
Buggy source:
/** 
 * Remove the specified entity, and if there are no more tableaux contained, then remove this object from its container.
 * @param entity The tableau to remove.
 */
protected void _removeEntity(ComponentEntity entity){
  super._removeEntity(entity);
  if (entityList(Tableau.class).size() == 0) {
    try {
      setContainer(null);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
      throw new InternalErrorException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Remove the specified entity, and if there are no remaining tableaux contained by this effigy or any effigy it contains, then remove this object from its container.
 * @param entity The tableau to remove.
 */
protected void _removeEntity(ComponentEntity entity){
  super._removeEntity(entity);
  if (numberOfOpenTableaux() == 0) {
    try {
      setContainer(null);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
      throw new InternalErrorException("String_Node_Str");
    }
  }
}
Program: 75787
Project: 75787
Buggy source:
private void _entities(JimpleBody body,Local thisLocal,CompositeEntity composite,EntitySootClass modelClass,Map options){
  for (Iterator entities=composite.entityList().iterator(); entities.hasNext(); ) {
    Entity entity=(Entity)entities.next();
    System.out.println("String_Node_Str" + entity);
    String className;
    if (Options.getBoolean(options,"String_Node_Str")) {
      className=ActorTransformer.getInstanceClassName(entity,options);
    }
 else {
      className=entity.getClass().getName();
    }
    String entityName=getFieldNameForEntity(entity);
    Local local=PtolemyUtilities.createNamedObjAndLocal(body,className,thisLocal,entityName);
    _entityLocalMap.put(entity,local);
    if (entity instanceof CompositeEntity) {
      _composite(body,local,(CompositeEntity)entity,modelClass,options);
    }
 else {
      _ports(body,thisLocal,composite,local,entity,modelClass);
    }
    if (Options.getBoolean(options,"String_Node_Str")) {
      SootUtilities.createAndSetFieldFromLocal(body,local,modelClass,PtolemyUtilities.actorType,entityName);
    }
 else {
      createFieldsForAttributes(body,composite,thisLocal,entity,local,modelClass);
    }
  }
}

Fixed version (ground truth):
private void _entities(JimpleBody body,Local thisLocal,CompositeEntity composite,EntitySootClass modelClass,Map options){
  for (Iterator entities=composite.entityList().iterator(); entities.hasNext(); ) {
    Entity entity=(Entity)entities.next();
    System.out.println("String_Node_Str" + entity);
    String className;
    if (Options.getBoolean(options,"String_Node_Str")) {
      className=ActorTransformer.getInstanceClassName(entity,options);
    }
 else {
      className=entity.getClass().getName();
    }
    Local local=PtolemyUtilities.createNamedObjAndLocal(body,className,thisLocal,entity.getName());
    _entityLocalMap.put(entity,local);
    if (entity instanceof CompositeEntity) {
      _composite(body,local,(CompositeEntity)entity,modelClass,options);
    }
 else {
      _ports(body,thisLocal,composite,local,entity,modelClass);
    }
    if (Options.getBoolean(options,"String_Node_Str")) {
      String entityFieldName=getFieldNameForEntity(entity);
      SootUtilities.createAndSetFieldFromLocal(body,local,modelClass,PtolemyUtilities.actorType,entityFieldName);
    }
 else {
      createFieldsForAttributes(body,composite,thisLocal,entity,local,modelClass);
    }
  }
}
Program: 75788
Project: 75788
Buggy source:
/** 
 * Construct an actor with the specified container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the entity cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public SingleEvent(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  output=new TypedIOPort(this,"String_Node_Str",false,true);
  time=new Parameter(this,"String_Node_Str",new DoubleToken(0.0));
  value=new Parameter(this,"String_Node_Str",new BooleanToken(true));
  output.setTypeSameAs(value);
}

Fixed version (ground truth):
/** 
 * Construct an actor with the specified container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the entity cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public SingleEvent(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  output=new TypedIOPort(this,"String_Node_Str",false,true);
  time=new Parameter(this,"String_Node_Str",new DoubleToken(0.0));
  time.setTypeEquals(BaseType.DOUBLE);
  value=new Parameter(this,"String_Node_Str",new BooleanToken(true));
  output.setTypeSameAs(value);
}
Program: 75789
Project: 75789
Buggy source:
/** 
 * Clone the actor into the specified workspace. This calls the base class and then links the type of the <i>value</i> parameter to the output.
 * @param workspace The workspace for the new object.
 * @return A new actor.
 * @exception CloneNotSupportedException If a derived class hashas an attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  SingleEvent newObject=(SingleEvent)super.clone(workspace);
  newObject.output.setTypeSameAs(value);
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the actor into the specified workspace. This calls the base class and then links the type of the <i>value</i> parameter to the output.
 * @param workspace The workspace for the new object.
 * @return A new actor.
 * @exception CloneNotSupportedException If a derived class hashas an attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  SingleEvent newObject=(SingleEvent)super.clone(workspace);
  newObject.output.setTypeSameAs(newObject.value);
  return newObject;
}
Program: 75791
Project: 75791
Buggy source:
public void setType(IOPort port,Integer type) throws NotSchedulableException {
  if (!_map.containsKey(port)) {
    _map.put(port,type);
    Entity actor=(Entity)port.getContainer();
    if (type.equals(CONTINUOUS) && !_continuousActors.contains(actor)) {
      _continuousActors.add(actor);
    }
    if (type.equals(DISCRETE) && !_discreteActors.contains(actor)) {
      _discreteActors.add(actor);
    }
  }
 else {
    Integer previousType=(Integer)_map.get(port);
    if (!previousType.equals(type)) {
      throw new NotSchedulableException(port.getFullName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void setType(IOPort port,Integer type) throws NotSchedulableException {
  if (!_map.containsKey(port)) {
    _map.put(port,type);
    Entity actor=(Entity)port.getContainer();
    if (type.equals(CONTINUOUS) && actor != CTScheduler.this.getContainer().getContainer() && !_continuousActors.contains(actor)) {
      _continuousActors.add(actor);
    }
    if (type.equals(DISCRETE) && actor != CTScheduler.this.getContainer().getContainer() && !_discreteActors.contains(actor)) {
      _discreteActors.add(actor);
    }
  }
 else {
    Integer previousType=(Integer)_map.get(port);
    if (!previousType.equals(type)) {
      throw new NotSchedulableException(port.getFullName() + "String_Node_Str");
    }
  }
}
Program: 75792
Project: 75792
Buggy source:
protected void _execute() throws Exception {
  super._execute();
  Entity entity=container.getEntity(newName);
  Iterator ports=container.portList().iterator();
  while (ports.hasNext()) {
    Port port=(Port)ports.next();
    try {
      if (entity instanceof Refinement) {
        ((Refinement)entity)._mirrorDisable=true;
      }
 else       if (entity instanceof ModalController) {
        ((ModalController)entity)._mirrorDisable=true;
      }
      Port newPort=entity.newPort(port.getName());
      if (newPort instanceof RefinementPort && port instanceof IOPort) {
        try {
          ((RefinementPort)newPort)._mirrorDisable=true;
          if (((IOPort)port).isInput()) {
            ((RefinementPort)newPort).setInput(true);
          }
          if (((IOPort)port).isOutput()) {
            ((RefinementPort)newPort).setOutput(true);
          }
          if (((IOPort)port).isMultiport()) {
            ((RefinementPort)newPort).setMultiport(true);
          }
        }
  finally {
          ((RefinementPort)newPort)._mirrorDisable=false;
        }
      }
    }
  finally {
      if (entity instanceof Refinement) {
        ((Refinement)entity)._mirrorDisable=false;
      }
 else       if (entity instanceof ModalController) {
        ((ModalController)entity)._mirrorDisable=false;
      }
    }
  }
  if (_configuration != null) {
    _configuration.openModel(entity);
  }
}

Fixed version (ground truth):
protected void _execute() throws Exception {
  super._execute();
  Entity entity=container.getEntity(newName);
  Iterator ports=container.portList().iterator();
  while (ports.hasNext()) {
    Port port=(Port)ports.next();
    try {
      if (entity instanceof Refinement) {
        ((Refinement)entity)._mirrorDisable=true;
      }
 else       if (entity instanceof ModalController) {
        ((ModalController)entity)._mirrorDisable=true;
      }
      Port newPort=entity.newPort(port.getName());
      if (newPort instanceof RefinementPort && port instanceof IOPort) {
        try {
          ((RefinementPort)newPort)._mirrorDisable=true;
          if (((IOPort)port).isInput()) {
            ((RefinementPort)newPort).setInput(true);
          }
          if (((IOPort)port).isOutput()) {
            ((RefinementPort)newPort).setOutput(true);
          }
          if (((IOPort)port).isMultiport()) {
            ((RefinementPort)newPort).setMultiport(true);
          }
          if (port instanceof TypedIOPort && newPort instanceof TypedIOPort) {
            ((TypedIOPort)newPort).setTypeSameAs((TypedIOPort)port);
          }
        }
  finally {
          ((RefinementPort)newPort)._mirrorDisable=false;
        }
      }
    }
  finally {
      if (entity instanceof Refinement) {
        ((Refinement)entity)._mirrorDisable=false;
      }
 else       if (entity instanceof ModalController) {
        ((ModalController)entity)._mirrorDisable=false;
      }
    }
  }
  if (_configuration != null) {
    _configuration.openModel(entity);
  }
}
Program: 75794
Project: 75794
Buggy source:
/** 
 * If the argument is true, make the port an output port. If the argument is false, make the port not an output port. This method overrides the base class to make the same change on the mirror ports in the controller and state refinments. This method invalidates the schedule and resolved types of the director of the container, if there is one. It is write-synchronized on the workspace, and increments the version of the workspace.
 * @param isOutput True to make the port an output.
 */
public void setOutput(boolean isOutput){
  try {
    _workspace.getWriteAccess();
    super.setOutput(isOutput);
    ModalModel container=(ModalModel)getContainer();
    Iterator entities=container.entityList().iterator();
    while (entities.hasNext()) {
      Entity entity=(Entity)entities.next();
      Port mirrorPort=entity.getPort(getName());
      if (mirrorPort instanceof RefinementPort) {
        RefinementPort castPort=(RefinementPort)mirrorPort;
        boolean disableStatus=castPort._mirrorDisable;
        try {
          castPort._mirrorDisable=true;
          castPort.setOutput(isOutput);
        }
  finally {
          castPort._mirrorDisable=disableStatus;
        }
      }
    }
  }
  finally {
    _workspace.doneWriting();
  }
}

Fixed version (ground truth):
/** 
 * If the argument is true, make the port an output port. If the argument is false, make the port not an output port. This method overrides the base class to make the same change on the mirror ports in the controller and state refinments. This method invalidates the schedule and resolved types of the director of the container, if there is one. It is write-synchronized on the workspace, and increments the version of the workspace.
 * @param isOutput True to make the port an output.
 */
public void setOutput(boolean isOutput){
  try {
    _workspace.getWriteAccess();
    super.setOutput(isOutput);
    ModalModel container=(ModalModel)getContainer();
    Iterator entities=container.entityList().iterator();
    while (entities.hasNext()) {
      Entity entity=(Entity)entities.next();
      Port mirrorPort=entity.getPort(getName());
      if (mirrorPort instanceof RefinementPort) {
        RefinementPort castPort=(RefinementPort)mirrorPort;
        boolean disableStatus=castPort._mirrorDisable;
        try {
          castPort._mirrorDisable=true;
          castPort.setOutput(isOutput);
        }
  finally {
          castPort._mirrorDisable=disableStatus;
        }
        if (entity.getName().equals("String_Node_Str")) {
          boolean controlPortStatus=castPort._mirrorDisable;
          try {
            castPort._mirrorDisable=true;
            castPort.setInput(true);
          }
  finally {
            castPort._mirrorDisable=controlPortStatus;
          }
        }
      }
    }
  }
  finally {
    _workspace.doneWriting();
  }
}
Program: 75796
Project: 75796
Buggy source:
/** 
 * Generate code for a special invoke expression.
 * @param v the expression.
 * @return the code.
 */
public void caseSpecialInvokeExpr(SpecialInvokeExpr v){
  SootClass methodClass=v.getMethod().getDeclaringClass();
  SootMethod method=v.getMethod();
  if (!(v.getBase().getType() instanceof RefType)) {
    _unexpectedCase(v,"String_Node_Str");
  }
 else {
    SootClass baseClass=((RefType)(v.getBase().getType())).getSootClass();
    if (baseClass == methodClass) {
      if (method.isStatic()) {
        _unexpectedCase(v,"String_Node_Str");
      }
 else {
        _generateInstanceInvokeExpression(v);
      }
    }
 else     if ((!baseClass.hasSuperclass()) || (baseClass.getSuperclass() != methodClass)) {
      _unexpectedCase(v,"String_Node_Str");
    }
 else     if (_context.getSingleClassMode()) {
      return;
    }
 else {
      v.getBase().apply(this);
      StringBuffer baseCode=_pop();
      _push(CNames.classStructureNameOf(methodClass) + "String_Node_Str" + CNames.methodNameOf(method)+ "String_Node_Str"+ baseCode+ "String_Node_Str"+ _generateArguments(v,1)+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Generate code for a special invoke expression.
 * @param v the expression.
 * @return the code.
 */
public void caseSpecialInvokeExpr(SpecialInvokeExpr v){
  SootClass methodClass=v.getMethod().getDeclaringClass();
  SootMethod method=v.getMethod();
  if (!(v.getBase().getType() instanceof RefType)) {
    _unexpectedCase(v,"String_Node_Str");
  }
 else {
    SootClass baseClass=((RefType)(v.getBase().getType())).getSootClass();
    if (baseClass == methodClass) {
      if (method.isStatic()) {
        _unexpectedCase(v,"String_Node_Str");
      }
 else {
        _generateInstanceInvokeExpression(v);
      }
    }
 else     if ((!baseClass.hasSuperclass()) || (baseClass.getSuperclass() != methodClass)) {
      _unexpectedCase(v,"String_Node_Str");
    }
 else     if (_context.getSingleClassMode()) {
      return;
    }
 else {
      v.getBase().apply(this);
      StringBuffer baseCode=_pop();
      _push(CNames.classStructureNameOf(methodClass) + "String_Node_Str" + CNames.methodNameOf(method)+ "String_Node_Str"+ baseCode+ _generateArguments(v,1)+ "String_Node_Str");
    }
  }
}
Program: 75797
Project: 75797
Buggy source:
public void caseNullConstant(NullConstant v){
  defaultCase(v);
}

Fixed version (ground truth):
public void caseNullConstant(NullConstant v){
  _push("String_Node_Str");
}
Program: 75798
Project: 75798
Buggy source:
/** 
 * Create a graph model for the specified Ptolemy II model.
 * @param composite The Ptolemy II model.
 */
public AbstractPtolemyGraphModel(CompositeEntity composite){
  super(composite);
  _composite=composite;
  composite.addChangeListener(new GraphChangeListener());
}

Fixed version (ground truth):
/** 
 * Create a graph model for the specified Ptolemy II model.
 * @param composite The Ptolemy II model.
 */
public AbstractPtolemyGraphModel(CompositeEntity composite){
  super(composite);
  _composite=composite;
  _graphChangeListener=new GraphChangeListener();
  composite.addChangeListener(_graphChangeListener);
}
Program: 75799
Project: 75799
Buggy source:
public List typeConstraintList(){
  try {
    _workspace.getReadAccess();
    List result=new LinkedList();
    Iterator inPorts=inputPortList().iterator();
    while (inPorts.hasNext()) {
      TypedIOPort inport=(TypedIOPort)inPorts.next();
      boolean isUndeclared=inport.getTypeTerm().isSettable();
      if (isUndeclared) {
        Iterator outPorts=outputPortList().iterator();
        while (outPorts.hasNext()) {
          TypedIOPort outport=(TypedIOPort)outPorts.next();
          isUndeclared=outport.getTypeTerm().isSettable();
          if (isUndeclared && inport != outport) {
            Inequality ineq=new Inequality(inport.getTypeTerm(),outport.getTypeTerm());
            result.add(ineq);
          }
        }
      }
    }
    Iterator ports=portList().iterator();
    while (ports.hasNext()) {
      Typeable port=(Typeable)ports.next();
      result.addAll(port.typeConstraintList());
    }
    Iterator attrib=attributeList(Typeable.class).iterator();
    while (attrib.hasNext()) {
      Typeable att=(Typeable)attrib.next();
      result.addAll(att.typeConstraintList());
    }
    Iterator trs=relationList().iterator();
    while (trs.hasNext()) {
      Relation tr=(Relation)trs.next();
      attrib=tr.attributeList(Typeable.class).iterator();
      while (attrib.hasNext()) {
        Typeable att=(Typeable)attrib.next();
        result.addAll(att.typeConstraintList());
      }
    }
    return result;
  }
  finally {
    _workspace.doneReading();
  }
}

Fixed version (ground truth):
public List typeConstraintList(){
  try {
    _workspace.getReadAccess();
    List result=new LinkedList();
    Iterator inPorts=inputPortList().iterator();
    while (inPorts.hasNext()) {
      TypedIOPort inport=(TypedIOPort)inPorts.next();
      boolean isUndeclared=inport.getTypeTerm().isSettable();
      if (isUndeclared) {
        Iterator outPorts=outputPortList().iterator();
        while (outPorts.hasNext()) {
          TypedIOPort outport=(TypedIOPort)outPorts.next();
          isUndeclared=outport.getTypeTerm().isSettable();
          if (isUndeclared && inport != outport) {
            Inequality ineq=new Inequality(inport.getTypeTerm(),outport.getTypeTerm());
            result.add(ineq);
          }
        }
      }
    }
    Iterator ports=portList().iterator();
    while (ports.hasNext()) {
      Typeable port=(Typeable)ports.next();
      result.addAll(port.typeConstraintList());
    }
    Iterator attributes=attributeList(Typeable.class).iterator();
    while (attributes.hasNext()) {
      Typeable attribute=(Typeable)attributes.next();
      result.addAll(attribute.typeConstraintList());
    }
    Iterator transitionRelations=relationList().iterator();
    while (transitionRelations.hasNext()) {
      Relation transitionRelation=(Relation)transitionRelations.next();
      attributes=transitionRelation.attributeList(Typeable.class).iterator();
      while (attributes.hasNext()) {
        Typeable attribute=(Typeable)attributes.next();
        result.addAll(attribute.typeConstraintList());
      }
    }
    return result;
  }
  finally {
    _workspace.doneReading();
  }
}
Program: 75800
Project: 75800
Buggy source:
/** 
 * decreaseTemporaryMarking() is to decrease the _tempoararyMarking by i 
 */
public void decreaseTemporaryMarking(int i){
  _temporaryMarking=_temporaryMarking - i;
}

Fixed version (ground truth):
/** 
 * decreaseTemporaryMarking() is to decrease the _temporaryMarking by i 
 */
public void decreaseTemporaryMarking(int i){
  _temporaryMarking=_temporaryMarking - i;
}
Program: 75801
Project: 75801
Buggy source:
/** 
 * setTemporaryMarking() is to set the _tempoararyMarking to i 
 */
public void setTemporaryMarking(int i){
  _temporaryMarking=i;
}

Fixed version (ground truth):
/** 
 * setTemporaryMarking() is to set the _temporaryMarking to i 
 */
public void setTemporaryMarking(int i){
  _temporaryMarking=i;
}
Program: 75806
Project: 75806
Buggy source:
/** 
 * Given an AST TypedDecl, return the class or interface declaration (ClassDecl) associated with the declared entity's type, if one exists.  For example, if this method is called on a field declaration of the form 'myClass myField;', it will return the declaration of 'myClass'.
 * @param typedNode The AST TypedNode.
 * @return The declaration associated with the type of the AST TypedNode.Return null if we cannot resolve the desired declaration.
 */
public static ClassDecl typedDeclToClassDecl(TypedDecl typedDecl){
  if (typedDecl == null) {
    return null;
  }
  TypeNode type=((TypedDecl)typedDecl).getType();
  if (!(type instanceof TypeNameNode)) {
    return null;
  }
  JavaDecl declaration=JavaDecl.getDecl((TreeNode)type);
  if (!(declaration instanceof ClassDecl)) {
    return null;
  }
  return (ClassDecl)declaration;
}

Fixed version (ground truth):
/** 
 * Given an AST TypedDecl, return the class or interface declaration (ClassDecl) associated with the declared entity's type, if one exists.  For example, if this method is called on a field declaration of the form 'myClass myField;', it will return the declaration of 'myClass'.
 * @param typedDecl The AST TypedNode.
 * @return The declaration associated with the type of the AST TypedNode.Return null if we cannot resolve the desired declaration.
 */
public static ClassDecl typedDeclToClassDecl(TypedDecl typedDecl){
  if (typedDecl == null) {
    return null;
  }
  TypeNode type=((TypedDecl)typedDecl).getType();
  if (!(type instanceof TypeNameNode)) {
    return null;
  }
  JavaDecl declaration=JavaDecl.getDecl((TreeNode)type);
  if (!(declaration instanceof ClassDecl)) {
    return null;
  }
  return (ClassDecl)declaration;
}
Program: 75807
Project: 75807
Buggy source:
/** 
 * Return a string representation of the list of loaded classes and interfaces,  the associated hash map keys, and the loading statuses. This is useful for diagnostic purposes.
 * @return The string representation of loaded classes and interfaces.
 */
public static String getLoadedASTNames(){
  StringBuffer names=new StringBuffer("String_Node_Str");
  Iterator keys=allPass0ResolvedMap.keySet().iterator();
  while (keys.hasNext()) {
    Object nextKey=keys.next();
    CompileUnitNode unit=(CompileUnitNode)allPass0ResolvedMap.get(nextKey);
    UserTypeDeclNode declaration=NodeUtil.getDefinedType(unit);
    names.append(nextKey + "String_Node_Str" + ASTReflect.getFullyQualifiedName(declaration)+ "String_Node_Str"+ ASTReflect.getLoadingMode(declaration)+ "String_Node_Str");
  }
  return names.toString();
}

Fixed version (ground truth):
/** 
 * Return a string representation of the list of loaded classes and interfaces,  the associated hash map keys, and the loading statuses. This is useful for diagnostic purposes. Note that if a given compile unit contains multiple user type definitions (e.g., an interface and a class definition), then there will accordingly be multiple listings with the same hash map key.
 * @return The string representation of loaded classes and interfaces.
 */
public static String getLoadedASTNames(){
  StringBuffer names=new StringBuffer("String_Node_Str");
  Iterator keys=allPass0ResolvedMap.keySet().iterator();
  while (keys.hasNext()) {
    Object nextKey=keys.next();
    CompileUnitNode unit=(CompileUnitNode)allPass0ResolvedMap.get(nextKey);
    Iterator definedTypes=NodeUtil.getDefinedTypes(unit);
    while (definedTypes.hasNext()) {
      UserTypeDeclNode declaration=(UserTypeDeclNode)(definedTypes.next());
      names.append(nextKey + "String_Node_Str" + ASTReflect.getFullyQualifiedName(declaration)+ "String_Node_Str"+ ASTReflect.getLoadingMode(declaration)+ "String_Node_Str");
    }
  }
  return names.toString();
}
Program: 75808
Project: 75808
Buggy source:
private Object _visitVarInitDeclNode(VarInitDeclNode node){
  if (_debug) {
    System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ node);
  }
  TypeNode type=node.getDefType();
  TypedDecl typedDecl=(TypedDecl)JavaDecl.getDecl((NamedNode)node);
  InequalityTerm term=_makeVariableTerm(type,typedDecl);
  InequalityTerm initExprTerm=(InequalityTerm)node.getInitExpr().accept(this,null);
  if (_debug) {
    System.out.println("String_Node_Str" + "String_Node_Str" + node + "String_Node_Str"+ term+ "String_Node_Str"+ type+ "String_Node_Str"+ typedDecl+ "String_Node_Str"+ initExprTerm);
  }
  if (term != null) {
    _declToTermMap.put(typedDecl,term);
    if (_debug) {
      System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    _solver.addInequality(new Inequality(term,_makeConstantTerm(type,null)));
    if (initExprTerm != null) {
      if (_debug) {
        System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
      _solver.addInequality(new Inequality(initExprTerm,term));
    }
  }
  return null;
}

Fixed version (ground truth):
private Object _visitVarInitDeclNode(VarInitDeclNode node){
  if (_debug) {
    System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ node);
  }
  TypeNode type=node.getDefType();
  TypedDecl typedDecl=(TypedDecl)JavaDecl.getDecl((NamedNode)node);
  InequalityTerm term=_makeVariableTerm(type,typedDecl);
  InequalityTerm initExprTerm=(InequalityTerm)node.getInitExpr().accept(this,null);
  if (_debug) {
    System.out.println("String_Node_Str" + "String_Node_Str" + node + "String_Node_Str"+ term+ "String_Node_Str"+ type+ "String_Node_Str"+ typedDecl+ "String_Node_Str"+ initExprTerm);
  }
  if (term != null) {
    _declToTermMap.put(typedDecl,term);
    if (_debug) {
      System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    _solver.addInequality(new Inequality(term,_makeConstantTerm(type,null)));
    if (initExprTerm != null) {
      if (_debug) {
        System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
      try {
        term.setValue((ClassDecl)initExprTerm.getValue());
      }
 catch (      IllegalActionException e) {
        throw new RuntimeException("String_Node_Str" + e);
      }
      _solver.addInequality(new Inequality(initExprTerm,term));
    }
  }
  return null;
}
Program: 75811
Project: 75811
Buggy source:
/** 
 * Call the sendAbsent() method of each of the output ports of the specified actor if the actor is strict.
 */
private void _sendAbsentToAllUnknownOutputsOf(Actor actor) throws IllegalActionException {
  if ((!_isNonStrict(actor)) || (!_isFinishedFiring(actor))) {
    _debug("String_Node_Str","String_Node_Str",_getNameOf(actor));
    Iterator outputPorts=actor.outputPortList().iterator();
    while (outputPorts.hasNext()) {
      IOPort outputPort=(IOPort)outputPorts.next();
      for (int j=0; j < outputPort.getWidth(); j++) {
        if (!outputPort.isKnown(j))         outputPort.sendAbsent(j);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Call the sendAbsent() method of each of the output ports of the specified actor if the actor is strict.
 */
private void _sendAbsentToAllUnknownOutputsOf(Actor actor) throws IllegalActionException {
  if ((!_isNonStrict(actor)) && (!_isFinishedFiring(actor))) {
    _debug("String_Node_Str","String_Node_Str",_getNameOf(actor));
    Iterator outputPorts=actor.outputPortList().iterator();
    while (outputPorts.hasNext()) {
      IOPort outputPort=(IOPort)outputPorts.next();
      for (int j=0; j < outputPort.getWidth(); j++) {
        if (!outputPort.isKnown(j))         outputPort.sendAbsent(j);
      }
    }
  }
}
Program: 75813
Project: 75813
Buggy source:
/** 
 * Create an HDFFSMActor in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.
 * @param container The container.
 * @param name The name of this actor within the container.
 * @exception IllegalActionException If the entity cannot be containedby the proposed container (see the setContainer() method).
 * @exception NameDuplicationException If the name coincides withan entity already in the container.
 */
public HDFFSMActor(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
}

Fixed version (ground truth):
/** 
 * Create an HDFFSMActor in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.
 * @param container The container.
 * @param name The name of this actor within the container.
 * @exception IllegalActionException If the entity cannot be containedby the proposed container (see the setContainer() method).
 * @exception NameDuplicationException If the name coincides withan entity already in the container.
 */
public HDFFSMActor(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  _init();
}
Program: 75816
Project: 75816
Buggy source:
/** 
 * Notify this that an attribute has changed.  If either parameter is changed, then this actor updates the configuration of the visible plot.
 * @exception IllegalActionException If the expression of theattribute cannot be parsed or cannot be evaluated.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == width && plot != null) {
    double xUnitValue=((DoubleToken)xInit.getToken()).doubleValue();
    int widthValue=((IntToken)width.getToken()).intValue();
    plot.setXRange(0.0,xUnitValue * widthValue);
  }
 else   if (attribute == persistence && plot != null) {
    int persValue=((IntToken)persistence.getToken()).intValue();
    plot.setPointsPersistence(persValue);
  }
 else {
    super.attributeChanged(attribute);
  }
}

Fixed version (ground truth):
/** 
 * Notify this that an attribute has changed.  If either parameter is changed, then this actor updates the configuration of the visible plot.
 * @exception IllegalActionException If the expression of theattribute cannot be parsed or cannot be evaluated.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if ((attribute == width || attribute == xUnit || attribute == xInit) && plot != null) {
    super.attributeChanged(attribute);
    int widthValue=((IntToken)width.getToken()).intValue();
    plot.setXRange(_xInit,_xUnit * widthValue + _xInit);
  }
 else   if (attribute == persistence && plot != null) {
    int persValue=((IntToken)persistence.getToken()).intValue();
    plot.setPointsPersistence(persValue);
  }
 else {
    super.attributeChanged(attribute);
  }
}
Program: 75817
Project: 75817
Buggy source:
/** 
 * Initialize this actor.  This method configures the visible plot using the current parameter values.
 * @exception IllegalActionException If the parent class throws it.
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  double xUnitValue=((DoubleToken)xUnit.getToken()).doubleValue();
  int widthValue=((IntToken)width.getToken()).intValue();
  plot.setXRange(0.0,xUnitValue * widthValue);
  plot.setWrap(true);
  int persValue=((IntToken)persistence.getToken()).intValue();
  plot.setPointsPersistence(persValue);
  if (plot.getMarksStyle().equals("String_Node_Str")) {
    plot.setMarksStyle("String_Node_Str");
  }
  plot.repaint();
}

Fixed version (ground truth):
/** 
 * Initialize this actor.  This method configures the visible plot using the current parameter values.
 * @exception IllegalActionException If the parent class throws it.
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  int widthValue=((IntToken)width.getToken()).intValue();
  plot.setXRange(_xInit,_xUnit * widthValue + _xInit);
  plot.setWrap(true);
  int persValue=((IntToken)persistence.getToken()).intValue();
  plot.setPointsPersistence(persValue);
  if (plot.getMarksStyle().equals("String_Node_Str")) {
    plot.setMarksStyle("String_Node_Str");
  }
  plot.repaint();
}
Program: 75818
Project: 75818
Buggy source:
/** 
 * Return the text string that represents the current configuration of this object.  Note that any configuration that was previously specified using the source attribute need not be returned here.
 */
public String getText(){
  if (plot == null) {
    return "String_Node_Str";
  }
 else {
    String header="String_Node_Str" + "String_Node_Str";
    StringBuffer buffer=new StringBuffer();
    buffer.append(header);
    buffer.append("String_Node_Str");
    PrintWriter print=new PrintWriter(new StringWriter());
    plot.writeFormat(print);
    buffer.append(print.toString());
    return buffer.toString();
  }
}

Fixed version (ground truth):
/** 
 * Return the text string that represents the current configuration of this object.  Note that any configuration that was previously specified using the source attribute need not be returned here.
 */
public String getText(){
  if (plot == null) {
    return "String_Node_Str";
  }
 else {
    String header="String_Node_Str" + "String_Node_Str";
    StringWriter writer=new StringWriter();
    PrintWriter print=new PrintWriter(writer);
    print.write("String_Node_Str");
    plot.writeFormat(print);
    print.write("String_Node_Str");
    return writer.toString();
  }
}