nus-yam/ex-repair huggingface dataset:
Program: 73923
Project: 73923
Buggy source:
public void setEquals(Object object,Property property){
  super.setEquals(object,property);
  if (property != null) {
    getSolver().putToken(object,(PropertyToken)property);
  }
}

Fixed version (ground truth):
/** 
 * Set the property of specified object equal to the specified property.
 * @param object The specified object.
 * @param property The specified property.
 */
public void setEquals(Object object,Property property){
  super.setEquals(object,property);
  if (property != null && property instanceof PropertyToken) {
    getSolver().putToken(object,(PropertyToken)property);
  }
}
Program: 73924
Project: 73924
Buggy source:
public PropertyCombineHelper(PropertyCombineSolver solver,Object component){
  setComponent(component);
  _solver=solver;
}

Fixed version (ground truth):
/** 
 * Construct a PropertyCombinedHelper
 * @param solver The solver.
 * @param component The associated components.
 */
public PropertyCombineHelper(PropertyCombineSolver solver,Object component){
  setComponent(component);
  _solver=solver;
}
Program: 73925
Project: 73925
Buggy source:
public PropertyCombineSolver getSolver(){
  return (PropertyCombineSolver)_solver;
}

Fixed version (ground truth):
/** 
 * Return The PropertySolver that uses this helper.
 * @return The PropertySolver that uses this helper.
 */
public PropertyCombineSolver getSolver(){
  return (PropertyCombineSolver)_solver;
}
Program: 73926
Project: 73926
Buggy source:
protected List<PropertyHelper> _getSubHelpers() throws IllegalActionException {
  return new ArrayList<PropertyHelper>();
}

Fixed version (ground truth):
/** 
 * Return the list of sub-helpers.
 * @return The list of sub-helpers.
 * @exception IllegalActionException Not thrown in this class.
 */
protected List<PropertyHelper> _getSubHelpers() throws IllegalActionException {
  return new ArrayList<PropertyHelper>();
}
Program: 73927
Project: 73927
Buggy source:
public void determineProperty() throws IllegalActionException, NameDuplicationException {
  Iterator portIterator=getPropertyables().iterator();
  while (portIterator.hasNext()) {
    IOPort port=(IOPort)portIterator.next();
    PtParser parser=PropertySolverBase.getParser();
    ASTPtRootNode parseTree=parser.generateParseTree(getSolver().getPropertyExpression());
    PropertyCombineParseTreeEvaluator evaluator=new PropertyCombineParseTreeEvaluator(port,_solver);
    Token token=evaluator.evaluateParseTree(parseTree);
    PropertyToken property=new PropertyToken(token);
    if (!((getSolver().getUnconnectedPorts()) && port.connectedPortList().isEmpty())) {
      setEquals(port,property);
    }
  }
  Iterator helpers=_getSubHelpers().iterator();
  while (helpers.hasNext()) {
    PropertyCombineHelper helper=(PropertyCombineHelper)helpers.next();
    helper.determineProperty();
  }
}

Fixed version (ground truth):
/** 
 * Determine the property.
 * @exception IllegalActionException If thrown while generating  a parse tree for the solver, evaluating the parse tree or getting subhelpers.
 */
public void determineProperty() throws IllegalActionException {
  Iterator portIterator=getPropertyables().iterator();
  while (portIterator.hasNext()) {
    IOPort port=(IOPort)portIterator.next();
    PtParser parser=PropertySolverBase.getParser();
    ASTPtRootNode parseTree=parser.generateParseTree(getSolver().getPropertyExpression());
    PropertyCombineParseTreeEvaluator evaluator=new PropertyCombineParseTreeEvaluator(port,_solver);
    Token token=evaluator.evaluateParseTree(parseTree);
    PropertyToken property=new PropertyToken(token);
    if (!((getSolver().getUnconnectedPorts()) && port.connectedPortList().isEmpty())) {
      setEquals(port,property);
    }
  }
  Iterator helpers=_getSubHelpers().iterator();
  while (helpers.hasNext()) {
    PropertyCombineHelper helper=(PropertyCombineHelper)helpers.next();
    helper.determineProperty();
  }
}
Program: 73928
Project: 73928
Buggy source:
/** 
 * Return a MoML request string that creates or updates the _showInfo attribute of the given property-able object, according to the given property value. If the given property is null, this would issue delete request to remove the _showInfo attribute, if there exists any.
 * @param propertyable The given property-able object.
 * @param property The given property.
 */
private String _getMoMLShowInfoString(NamedObj propertyable,Property property){
  String request;
  String propertyString;
  if (property != null) {
    propertyString=property.toString();
  }
 else {
    propertyString="String_Node_Str";
  }
  StringParameter showAttribute=(StringParameter)propertyable.getAttribute("String_Node_Str");
  request="String_Node_Str" + propertyString + "String_Node_Str";
  request=_completeHierarchyInMoML(propertyable,request);
  return request;
}

Fixed version (ground truth):
/** 
 * Return a MoML request string that creates or updates the _showInfo attribute of the given property-able object, according to the given property value. If the given property is null, this would issue delete request to remove the _showInfo attribute, if there exists any.
 * @param propertyable The given property-able object.
 * @param property The given property.
 */
private String _getMoMLShowInfoString(NamedObj propertyable,Property property){
  String request;
  String propertyString;
  if (property != null) {
    propertyString=property.toString();
  }
 else {
    propertyString="String_Node_Str";
  }
  request="String_Node_Str" + propertyString + "String_Node_Str";
  request=_completeHierarchyInMoML(propertyable,request);
  return request;
}
Program: 73930
Project: 73930
Buggy source:
/** 
 * Reset every solver in the model.
 */
public void resetAll(){
  _parser=null;
  for (  PropertySolver solver : getAllSolvers(sharedUtilitiesWrapper)) {
    solver.reset();
  }
  getSharedUtilities().resetAll();
}

Fixed version (ground truth):
/** 
 * Reset every solver in the model.
 */
public void resetAll(){
  _resetParser();
  for (  PropertySolver solver : getAllSolvers(sharedUtilitiesWrapper)) {
    solver.reset();
  }
  getSharedUtilities().resetAll();
}
Program: 73931
Project: 73931
Buggy source:
private void _regressionTestConstraints(PropertyConstraintHelper helper) throws IllegalActionException {
  Object object=helper.getComponent();
  if (!(object instanceof NamedObj)) {
    return;
  }
  NamedObj namedObj=(NamedObj)object;
  String errorMessage=_eol + "String_Node_Str" + getUseCaseName()+ "String_Node_Str"+ namedObj.getFullName()+ "String_Node_Str"+ _eol;
  List<Inequality>[] constraintSet=new List[2];
  constraintSet[0]=helper._ownConstraints;
  constraintSet[1]=helper._subHelperConstraints;
  boolean hasError=false;
  for (int i=0; i < 2; i++) {
    String whichSet=i == 0 ? "String_Node_Str" : "String_Node_Str";
    for (    Inequality constraint : constraintSet[i]) {
      Iterator logConstraints=_getConstraintAsLogFileString(constraint,"String_Node_Str").iterator();
      while (logConstraints.hasNext()) {
        String constraintString=(String)logConstraints.next();
        if (!_trainedConstraints.remove(constraintString)) {
          errorMessage+="String_Node_Str" + whichSet + "String_Node_Str"+ constraintString+ "String_Node_Str"+ _eol;
          hasError=true;
        }
 else {
          errorMessage+="String_Node_Str";
        }
      }
    }
  }
  if (hasError) {
    getSharedUtilities().addErrors(errorMessage);
  }
}

Fixed version (ground truth):
private void _regressionTestConstraints(PropertyConstraintHelper helper) throws IllegalActionException {
  Object object=helper.getComponent();
  if (!(object instanceof NamedObj)) {
    return;
  }
  NamedObj namedObj=(NamedObj)object;
  StringBuffer errorMessage=new StringBuffer(_eol + "String_Node_Str" + getUseCaseName()+ "String_Node_Str"+ namedObj.getFullName()+ "String_Node_Str"+ _eol);
  List<Inequality>[] constraintSet=new List[2];
  constraintSet[0]=helper._ownConstraints;
  constraintSet[1]=helper._subHelperConstraints;
  boolean hasError=false;
  for (int i=0; i < 2; i++) {
    String whichSet=i == 0 ? "String_Node_Str" : "String_Node_Str";
    for (    Inequality constraint : constraintSet[i]) {
      Iterator logConstraints=_getConstraintAsLogFileString(constraint,"String_Node_Str").iterator();
      while (logConstraints.hasNext()) {
        String constraintString=(String)logConstraints.next();
        if (!_trainedConstraints.remove(constraintString)) {
          errorMessage.append("String_Node_Str" + whichSet + "String_Node_Str"+ constraintString+ "String_Node_Str"+ _eol);
          hasError=true;
        }
      }
    }
  }
  if (hasError) {
    getSharedUtilities().addErrors(errorMessage.toString());
  }
}
Program: 73932
Project: 73932
Buggy source:
private void _readConstraintFile(String filename) throws PropertyFailedRegressionTestException {
  File file=new File(filename);
  try {
    BufferedReader reader=null;
    try {
      reader=new BufferedReader(new FileReader(file));
      String line=reader.readLine();
      while (line != null) {
        _trainedConstraints.add(line);
        line=reader.readLine();
      }
      getStats().put("String_Node_Str",_trainedConstraints.size());
    }
  finally {
      if (reader != null) {
        reader.close();
      }
    }
  }
 catch (  Exception ex) {
    throw new PropertyFailedRegressionTestException(this,"String_Node_Str" + filename + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void _readConstraintFile(String filename) throws PropertyFailedRegressionTestException {
  File file=new File(filename);
  try {
    BufferedReader reader=null;
    try {
      reader=new BufferedReader(new FileReader(file));
      String line=reader.readLine();
      while (line != null) {
        _trainedConstraints.add(line);
        line=reader.readLine();
      }
      getStats().put("String_Node_Str",_trainedConstraints.size());
    }
  finally {
      if (reader != null) {
        reader.close();
      }
    }
  }
 catch (  IOException ex) {
    throw new PropertyFailedRegressionTestException(this,"String_Node_Str" + filename + "String_Node_Str");
  }
}
Program: 73933
Project: 73933
Buggy source:
private String _getConstraintsAsLogFileString(List<Inequality> constraintList,String annotation) throws IllegalActionException {
  String output="String_Node_Str";
  for (  Inequality inequality : constraintList) {
    output+=_getConstraintAsLogFileString(inequality,annotation) + _eol;
  }
  return output;
}

Fixed version (ground truth):
private String _getConstraintsAsLogFileString(List<Inequality> constraintList,String annotation) throws IllegalActionException {
  StringBuffer output=new StringBuffer();
  for (  Inequality inequality : constraintList) {
    output.append(_getConstraintAsLogFileString(inequality,annotation) + _eol);
  }
  return output.toString();
}
Program: 73934
Project: 73934
Buggy source:
public Token getMinValue();

Fixed version (ground truth):
/** 
 * Minimum value of a this type.
 * @return The minimum value of this type.
 */
public Token getMinValue();
Program: 73935
Project: 73935
Buggy source:
public boolean hasMinMaxValue();

Fixed version (ground truth):
/** 
 * Return true if this element has minimum and maximum values.
 * @return Return true if this element has minimum and maximum values.
 */
public boolean hasMinMaxValue();
Program: 73936
Project: 73936
Buggy source:
public Token getMaxValue();

Fixed version (ground truth):
/** 
 * Maximum value of a this type.
 * @return The minimum value of this type.
 */
public Token getMaxValue();
Program: 73937
Project: 73937
Buggy source:
public Token getMinValue(){
  return new DoubleToken(2.2250738585072016E-308);
}

Fixed version (ground truth):
/** 
 * Minimum value of a double in System C. Note that this may or may not have the value equal to that of java.lang.Double.MIN_VALUE.
 * @return The minimum value of a double in System C.   
 */
public Token getMinValue(){
  return new DoubleToken(2.2250738585072016E-308);
}
Program: 73938
Project: 73938
Buggy source:
public Token getMaxValue(){
  return new DoubleToken(1.7976931348623157E308);
}

Fixed version (ground truth):
/** 
 * Maximum value of a double in System C. Note that this may or may not have the value equal to that of java.lang.Double.MAX_VALUE.
 * @return The maximum value of a double in System C.   
 */
public Token getMaxValue(){
  return new DoubleToken(1.7976931348623157E308);
}
Program: 73939
Project: 73939
Buggy source:
public boolean hasMinMaxValue(){
  return true;
}

Fixed version (ground truth):
/** 
 * Return true if this element has minimum and maximum values.
 * @return Always return true.
 */
public boolean hasMinMaxValue(){
  return true;
}
Program: 73940
Project: 73940
Buggy source:
public Double(PropertyLattice lattice){
  super(lattice,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Construct a node named "Double" in the lattice.
 * @param lattice The lattice in which the node is to be constructed.   
 */
public Double(PropertyLattice lattice){
  super(lattice,"String_Node_Str");
}
Program: 73941
Project: 73941
Buggy source:
/** 
 * Assign any internal parameters in the order they were set.
 * @exception PtalonRuntimeException If there is any troubleassigning parameter values.
 */
public void assignInternalParameters() throws PtalonRuntimeException {
  try {
    while (!_unassignedParameters.isEmpty()) {
      PtalonParameter parameter=_unassignedParameters.remove(0);
      String expression=_unassignedParameterValues.remove(0);
      String oldExpression=parameter.getExpression();
      if (expression.equals(oldExpression)) {
        parameter.setToken(expression);
      }
    }
  }
 catch (  Exception ex) {
    throw new PtalonRuntimeException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Assign any internal parameters in the order they were set.
 * @exception PtalonRuntimeException If there is any troubleassigning parameter values.
 */
public void assignInternalParameters() throws PtalonRuntimeException {
  try {
    while (!_unassignedParameters.isEmpty()) {
      PtalonParameter parameter=_unassignedParameters.remove(0);
      String expression=_unassignedParameterValues.remove(0);
      String oldExpression=parameter.getExpression();
      if (!expression.equals(oldExpression)) {
        parameter.setToken(expression);
      }
    }
  }
 catch (  Exception ex) {
    throw new PtalonRuntimeException("String_Node_Str",ex);
  }
}
Program: 73943
Project: 73943
Buggy source:
/** 
 * Return the constraints of this component. The constraints is a list of inequalities. This base class returns a empty list.
 * @return A list of Inequality.
 * @exception IllegalActionException Not thrown in this base class.
 */
public List<Inequality> constraintList() throws IllegalActionException {
  _setEffectiveTerms();
  _constraintAttributes();
  _addSubHelperConstraints();
  return _union(_ownConstraints,_subHelperConstraints);
}

Fixed version (ground truth):
/** 
 * Return the constraints of this component. The constraints is a list of inequalities. This base class returns the union of the constraints of this component and the constraints for the subcomponents
 * @return The constraints of this component.
 * @exception IllegalActionException Not thrown in this base class.
 */
public List<Inequality> constraintList() throws IllegalActionException {
  _setEffectiveTerms();
  _constraintAttributes();
  _addSubHelperConstraints();
  return _union(_ownConstraints,_subHelperConstraints);
}
Program: 73944
Project: 73944
Buggy source:
protected List<Attribute> _getPropertyableAttributes(){
  return new LinkedList<Attribute>();
}

Fixed version (ground truth):
/** 
 * Return the list of property-able Attributes. In this base class, an empty list is returned. Derived classes should add Attributes and Variables to list.  Commonly, actors add their parameters to this list.
 * @see ptolemy.data.properties.Propertyable
 * @return The list of property-able Attributes.
 */
protected List<Attribute> _getPropertyableAttributes(){
  return new LinkedList<Attribute>();
}
Program: 73945
Project: 73945
Buggy source:
public AtomicActor(PropertyConstraintSolver solver,ptolemy.actor.AtomicActor actor,boolean useDefaultConstraints) throws IllegalActionException {
  super(solver,actor,useDefaultConstraints);
}

Fixed version (ground truth):
/** 
 * Construct a helper for the given AtomicActor. This is the helper class for any ActomicActor that does not have a specific defined helper class.
 * @param solver The given solver.
 * @param actor The given ActomicActor.
 * @param useDefaultConstraints Indicate whether this helper uses thedefault actor constraints.
 * @exception IllegalActionException Thrown if the helper cannot beinitialized.
 */
public AtomicActor(PropertyConstraintSolver solver,ptolemy.actor.AtomicActor actor,boolean useDefaultConstraints) throws IllegalActionException {
  super(solver,actor,useDefaultConstraints);
}
Program: 73946
Project: 73946
Buggy source:
protected List<Attribute> _getPropertyableAttributes(){
  List<Attribute> result=super._getPropertyableAttributes();
  result.add(_actor.value);
  result.remove(_actor.trigger);
  return result;
}

Fixed version (ground truth):
/** 
 * Return the list of property-able Attributes. A property-able Attribute is a StringAttribute with the name "guardTransition", a StringAttribute in an Expression actor, a StringAttribute with the name "expression" or a Variable with full visibility.  However, Variables with certain names are excluded.  This method adds the value Parameter of the Const actor to the list that is returned.
 * @see ptolemy.data.properties.Propertyable
 * @return The list of property-able Attributes.
 */
protected List<Attribute> _getPropertyableAttributes(){
  List<Attribute> result=super._getPropertyableAttributes();
  result.add(_actor.value);
  return result;
}
Program: 73947
Project: 73947
Buggy source:
/** 
 * Construct a Const helper for the dimensionSystem lattice.
 * @param solver The given solver.
 * @param actor The given Const actor
 * @exception IllegalActionException
 */
public Const(PropertyConstraintSolver solver,ptolemy.actor.lib.Const actor) throws IllegalActionException {
  super(solver,actor);
  _actor=actor;
}

Fixed version (ground truth):
/** 
 * Construct a Const helper for the dimensionSystem lattice.
 * @param solver The given solver.
 * @param actor The given Const actor
 * @exception IllegalActionException Thrown if the helper cannot beinitialized.
 */
public Const(PropertyConstraintSolver solver,ptolemy.actor.lib.Const actor) throws IllegalActionException {
  super(solver,actor);
  _actor=actor;
}
Program: 73948
Project: 73948
Buggy source:
public List<Inequality> constraintList() throws IllegalActionException {
  setAtLeast(_actor.output,_actor.value);
  return super.constraintList();
}

Fixed version (ground truth):
/** 
 * Return the constraints of this component. The constraints is a list of inequalities.  This method sets the constraint of the output to at least that of the value Parameter of the actor.
 * @return The constraints of this component.
 * @exception IllegalActionException Not thrown in this base class.
 */
public List<Inequality> constraintList() throws IllegalActionException {
  setAtLeast(_actor.output,_actor.value);
  return super.constraintList();
}
Program: 73949
Project: 73949
Buggy source:
protected List<Attribute> _getPropertyableAttributes(){
  List<Attribute> result=super._getPropertyableAttributes();
  result.remove(_actor.trigger);
  return result;
}

Fixed version (ground truth):
/** 
 * Return the list of property-able Attributes. A property-able Attribute is a StringAttribute with the name "guardTransition", a StringAttribute in an Expression actor, a StringAttribute with the name "expression" or a Variable with full visibility.  However, Variables with certain names are excluded.
 * @see ptolemy.data.properties.Propertyable
 * @return The list of property-able Attributes.
 */
protected List<Attribute> _getPropertyableAttributes(){
  List<Attribute> result=super._getPropertyableAttributes();
  return result;
}
Program: 73950
Project: 73950
Buggy source:
public List<Inequality> constraintList() throws IllegalActionException {
  setAtLeast(_actor.output,_lattice.getElement("String_Node_Str"));
  return super.constraintList();
}

Fixed version (ground truth):
/** 
 * Return the constraints of this component. The constraints is a list of inequalities. This method sets the constraint of the output to at least the value of the "TIME" element in the   {@link ptolemy.data.properties.lattice#_lattice}
 * @return The constraints of this component.
 * @exception IllegalActionException If thrown while reading the lattice orif thrown by the superclass. 
 */
public List<Inequality> constraintList() throws IllegalActionException {
  setAtLeast(_actor.output,_lattice.getElement("String_Node_Str"));
  return super.constraintList();
}
Program: 73951
Project: 73951
Buggy source:
/** 
 * Construct a Expression helper for the flatUnitSystem lattice.
 * @param solver The given solver.
 * @param actor The given Expression actor
 * @exception IllegalActionException
 */
public CurrentTime(PropertyConstraintSolver solver,ptolemy.actor.lib.CurrentTime actor) throws IllegalActionException {
  super(solver,actor,false);
  _actor=actor;
}

Fixed version (ground truth):
/** 
 * Construct a CurrentTime helper for the dimensionSystem lattice.
 * @param solver The given solver.
 * @param actor The given Expression actor
 * @exception IllegalActionException Thrown if the helper cannot beinitialized.
 */
public CurrentTime(PropertyConstraintSolver solver,ptolemy.actor.lib.CurrentTime actor) throws IllegalActionException {
  super(solver,actor,false);
  _actor=actor;
}
Program: 73952
Project: 73952
Buggy source:
protected List<Attribute> _getPropertyableAttributes(){
  List<Attribute> result=super._getPropertyableAttributes();
  result.remove(_actor.trigger);
  result.remove(_actor.period);
  return result;
}

Fixed version (ground truth):
/** 
 * Return the list of property-able Attributes. A property-able Attribute is a StringAttribute with the name "guardTransition", a StringAttribute in an Expression actor, a StringAttribute with the name "expression" or a Variable with full visibility.  However, Variables with certain names are excluded.
 * @see ptolemy.data.properties.Propertyable
 * @return The list of property-able Attributes.
 */
protected List<Attribute> _getPropertyableAttributes(){
  List<Attribute> result=super._getPropertyableAttributes();
  return result;
}
Program: 73953
Project: 73953
Buggy source:
public List<Inequality> constraintList() throws IllegalActionException {
  setAtLeast(_actor.output,_lattice.getElement("String_Node_Str"));
  return super.constraintList();
}

Fixed version (ground truth):
/** 
 * Return the constraints of this component. The constraints is a list of inequalities. This method sets the constraint of the output to at least the value of the "UNITLESS" element in the   {@link ptolemy.data.properties.lattice#_lattice}
 * @return The constraints of this component.
 * @exception IllegalActionException Not thrown in this base class.
 */
public List<Inequality> constraintList() throws IllegalActionException {
  setAtLeast(_actor.output,_lattice.getElement("String_Node_Str"));
  return super.constraintList();
}
Program: 73954
Project: 73954
Buggy source:
/** 
 * Construct a Integrator helper for the flatUnitSystem lattice.
 * @param solver The given solver.
 * @param actor The given Integrator actor
 * @exception IllegalActionException
 */
public DiscreteClock(PropertyConstraintSolver solver,ptolemy.actor.lib.DiscreteClock actor) throws IllegalActionException {
  super(solver,actor,false);
  _actor=actor;
}

Fixed version (ground truth):
/** 
 * Construct a Integrator helper for the flatUnitSystem lattice.
 * @param solver The given solver.
 * @param actor The given Integrator actor
 * @exception IllegalActionException Thrown if the helper cannot beinitialized.
 */
public DiscreteClock(PropertyConstraintSolver solver,ptolemy.actor.lib.DiscreteClock actor) throws IllegalActionException {
  super(solver,actor,false);
  _actor=actor;
}
Program: 73955
Project: 73955
Buggy source:
/** 
 * Record as an error for the given property-able object and its resolved property. If the given property is null, it does nothing. If the given property is unacceptable, an error is recorded for the given property-able object and the property.
 */
private void _recordUnacceptableSolution(Object propertyable,Property property){
  if (property != null && !property.isAcceptableSolution()) {
    addErrors("String_Node_Str" + property + "String_Node_Str"+ propertyable+ "String_Node_Str"+ _eol);
    clearResolvedProperty(propertyable);
  }
}

Fixed version (ground truth):
/** 
 * Record as an error for the given property-able object and its resolved property. If the given property is null, it does nothing. If the given property is unacceptable, an error is recorded for the given property-able object and the property.
 */
private void _recordUnacceptableSolution(Object propertyable,Property property){
  if (property != null && !property.isAcceptableSolution()) {
    addErrors("String_Node_Str" + property + "String_Node_Str"+ propertyable+ "String_Node_Str"+ _eol);
  }
}
Program: 73956
Project: 73956
Buggy source:
/** 
 * @param constraints
 */
public void setConstraints(List<Inequality> constraints){
  _greaterTermMap.clear();
  _lesserTermMap.clear();
  for (  Inequality constraint : constraints) {
    if (constraint.isBase()) {
      InequalityTerm greaterTerm=constraint.getGreaterTerm();
      InequalityTerm lesserTerm=constraint.getLesserTerm();
      _greaterTermMap.put(greaterTerm,lesserTerm);
      _lesserTermMap.put(lesserTerm,greaterTerm);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param constraints
 */
public void setConstraints(List<Inequality> constraints){
  for (  Inequality constraint : constraints) {
    if (constraint.isBase()) {
      InequalityTerm greaterTerm=constraint.getGreaterTerm();
      InequalityTerm lesserTerm=constraint.getLesserTerm();
      _greaterTermMap.put(greaterTerm,lesserTerm);
      _lesserTermMap.put(lesserTerm,greaterTerm);
    }
  }
}
Program: 73958
Project: 73958
Buggy source:
/** 
 * Return a MoML request string that create or update the _showInfo attribute of the given property-able object, according to the given property value. If the given property is null, this would issue delete request to remove the _showInfo attribute, if there exists any.
 * @param propertyable The given property-able object.
 * @param property The given property.
 */
private String _getMoMLShowInfoString(NamedObj propertyable,Property property){
  String request;
  String propertyString;
  if (property != null) {
    propertyString=property.toString();
  }
 else   if (getContainer() instanceof PropertyTokenSolver) {
    propertyString="String_Node_Str";
  }
 else {
    propertyString="String_Node_Str";
  }
  StringParameter showAttribute=(StringParameter)propertyable.getAttribute("String_Node_Str");
  if (property == null && showAttribute != null) {
    request="String_Node_Str";
  }
 else {
    request="String_Node_Str" + propertyString + "String_Node_Str";
  }
  request=_completeHierarchyInMoML(propertyable,request);
  return request;
}

Fixed version (ground truth):
/** 
 * Return a MoML request string that create or update the _showInfo attribute of the given property-able object, according to the given property value. If the given property is null, this would issue delete request to remove the _showInfo attribute, if there exists any.
 * @param propertyable The given property-able object.
 * @param property The given property.
 */
private String _getMoMLShowInfoString(NamedObj propertyable,Property property){
  String request;
  String propertyString;
  if (property != null) {
    propertyString=property.toString();
  }
 else {
    propertyString="String_Node_Str";
  }
  StringParameter showAttribute=(StringParameter)propertyable.getAttribute("String_Node_Str");
  if (property == null && showAttribute != null) {
    request="String_Node_Str";
  }
 else {
    request="String_Node_Str" + propertyString + "String_Node_Str";
  }
  request=_completeHierarchyInMoML(propertyable,request);
  return request;
}
Program: 73959
Project: 73959
Buggy source:
public String toString(){
  String result="String_Node_Str";
  for (  PropertyTerm term : _terms) {
    if (term.isEffective()) {
      result+=term;
      break;
    }
  }
  for (  PropertyTerm term : _terms) {
    if (term.isEffective()) {
      result+="String_Node_Str" + term;
    }
  }
  return result + "String_Node_Str";
}

Fixed version (ground truth):
public String toString(){
  StringBuffer result=new StringBuffer("String_Node_Str");
  for (  PropertyTerm term : _terms) {
    if (term.isEffective()) {
      result.append(term);
      break;
    }
  }
  for (  PropertyTerm term : _terms) {
    if (term.isEffective()) {
      result.append("String_Node_Str" + term);
    }
  }
  result.append("String_Node_Str");
  return result.toString();
}
Program: 73960
Project: 73960
Buggy source:
private void _checkMissingConstraints(){
  String errorMessage=_eol + "String_Node_Str" + getUseCaseName()+ "String_Node_Str"+ _eol;
  boolean hasError=false;
  for (  String trainedValue : _trainedConstraints) {
    errorMessage+="String_Node_Str" + trainedValue + "String_Node_Str"+ _eol;
    hasError=true;
  }
  if (hasError) {
    getSharedUtilities().addErrors(errorMessage);
  }
}

Fixed version (ground truth):
private void _checkMissingConstraints(){
  StringBuffer errorMessage=new StringBuffer(_eol + "String_Node_Str" + getUseCaseName()+ "String_Node_Str"+ _eol);
  boolean hasError=false;
  for (  String trainedValue : _trainedConstraints) {
    errorMessage.append("String_Node_Str" + trainedValue + "String_Node_Str"+ _eol);
    hasError=true;
  }
  if (hasError) {
    getSharedUtilities().addErrors(errorMessage.toString());
  }
}
Program: 73961
Project: 73961
Buggy source:
protected void _writeChacoInputFile(String code) throws IllegalActionException {
  BufferedWriter out=null;
  try {
    FileWriter fstream=new FileWriter(_codeFileName);
    out=new BufferedWriter(fstream);
    out.write(code);
  }
 catch (  Exception ex) {
    throw IllegalActionException(getContainer(),ex,"String_Node_Str" + _codeFileName);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
        throw IllegalActionException(getContainer(),ex,"String_Node_Str" + _codeFileName);
      }
    }
  }
}

Fixed version (ground truth):
protected void _writeChacoInputFile(String code) throws IllegalActionException {
  BufferedWriter out=null;
  try {
    FileWriter fstream=new FileWriter(_codeFileName);
    out=new BufferedWriter(fstream);
    out.write(code);
  }
 catch (  Exception ex) {
    throw new IllegalActionException(getContainer(),ex,"String_Node_Str" + _codeFileName);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
        throw new IllegalActionException(getContainer(),ex,"String_Node_Str" + _codeFileName);
      }
    }
  }
}
Program: 73963
Project: 73963
Buggy source:
public boolean checkForErrors() throws IllegalActionException {
  boolean ret=false;
  for (  Object propertyable : getAllPropertyables()) {
    Property property=getProperty(propertyable);
    if (property != null && !property.isAcceptableSolution()) {
      ret=true;
    }
    clearResolvedProperty(propertyable);
  }
  return ret;
}

Fixed version (ground truth):
public boolean checkForErrors() throws IllegalActionException {
  boolean ret=false;
  for (  Object propertyable : getAllPropertyables()) {
    Property property=getProperty(propertyable);
    if (property != null && !property.isAcceptableSolution()) {
      ret=true;
    }
  }
  return ret;
}
Program: 73964
Project: 73964
Buggy source:
/** 
 * Record as an error for the given property-able object and its resolved property. If the given property is null, it does nothing. If the given property is unacceptable, an error is recorded for the given property-able object and the property.
 */
private void _recordUnacceptableSolution(Object propertyable,Property property){
  if (property != null && !property.isAcceptableSolution()) {
    addErrors("String_Node_Str" + property + "String_Node_Str"+ propertyable+ "String_Node_Str"+ _eol);
  }
}

Fixed version (ground truth):
/** 
 * Record as an error for the given property-able object and its resolved property. If the given property is null, it does nothing. If the given property is unacceptable, an error is recorded for the given property-able object and the property.
 */
private void _recordUnacceptableSolution(Object propertyable,Property property){
  if (property != null && !property.isAcceptableSolution()) {
    addErrors("String_Node_Str" + property + "String_Node_Str"+ propertyable+ "String_Node_Str"+ _eol);
    clearResolvedProperty(propertyable);
  }
}
Program: 73966
Project: 73966
Buggy source:
/** 
 * @param constraints
 */
public void setConstraints(List<Inequality> constraints){
  for (  Inequality constraint : constraints) {
    if (constraint.isBase()) {
      InequalityTerm greaterTerm=constraint.getGreaterTerm();
      InequalityTerm lesserTerm=constraint.getLesserTerm();
      _greaterTermMap.put(greaterTerm,lesserTerm);
      _lesserTermMap.put(lesserTerm,greaterTerm);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param constraints
 */
public void setConstraints(List<Inequality> constraints){
  _greaterTermMap.clear();
  _lesserTermMap.clear();
  for (  Inequality constraint : constraints) {
    if (constraint.isBase()) {
      InequalityTerm greaterTerm=constraint.getGreaterTerm();
      InequalityTerm lesserTerm=constraint.getLesserTerm();
      _greaterTermMap.put(greaterTerm,lesserTerm);
      _lesserTermMap.put(lesserTerm,greaterTerm);
    }
  }
}
Program: 73968
Project: 73968
Buggy source:
/** 
 * Parse the given expression for an arbitrary Property.
 * @param lattice The lattice.
 * @param expression The expression
 * @return The LatticeProperty that corresponds with the lattice andexpression.
 * @exception IllegalActionException If thrown by{@link #_parseElementExpression(PropertyLattice,String)}
 */
private static LatticeProperty _parsePropertyExpression(PropertyLattice lattice,String expression) throws IllegalActionException {
  if (expression.startsWith("String_Node_Str") && expression.endsWith("String_Node_Str")) {
    List<String> fieldExpressions=_parseList(expression.substring(1,expression.length() - 1));
    int size=fieldExpressions.size();
    String[] labels=new String[size];
    LatticeProperty[] fieldProperties=new LatticeProperty[size];
    for (int i=0; i < size; i++) {
      String fieldExpression=fieldExpressions.get(i);
      String[] labelAndProperty=fieldExpression.split("String_Node_Str",2);
      labels[i]=labelAndProperty[0];
      fieldProperties[i]=_parsePropertyExpression(lattice,labelAndProperty[1]);
    }
    return new RecordProperty(lattice,labels,fieldProperties);
  }
  return _parseElementExpression(lattice,expression);
}

Fixed version (ground truth):
/** 
 * Parse the given expression for an arbitrary Property.
 * @param lattice The lattice.
 * @param expression The expression
 * @return The LatticeProperty that corresponds with the lattice andexpression.
 * @exception IllegalActionException If thrown by{@link #_parseElementExpression(PropertyLattice,String)}
 */
private static LatticeProperty _parsePropertyExpression(PropertyLattice lattice,String expression) throws IllegalActionException {
  if (expression.startsWith("String_Node_Str") && expression.endsWith("String_Node_Str")) {
    List<String> fieldExpressions=_parseList(expression.substring(1,expression.length() - 1));
    int size=fieldExpressions.size();
    String[] labels=new String[size];
    LatticeProperty[] fieldProperties=new LatticeProperty[size];
    for (int i=0; i < size; i++) {
      String fieldExpression=fieldExpressions.get(i);
      String[] labelAndProperty=fieldExpression.split("String_Node_Str",2);
      labels[i]=labelAndProperty[0].trim();
      fieldProperties[i]=_parsePropertyExpression(lattice,labelAndProperty[1].trim());
    }
    return new RecordProperty(lattice,labels,fieldProperties);
  }
  return _parseElementExpression(lattice,expression);
}
Program: 73972
Project: 73972
Buggy source:
/** 
 * Send the input token to the client program and send the output from the client program to the output port.
 * @exception IllegalActionException If the simulation time between Ptolemy and the client program is not synchronized.
 */
public void fire() throws IllegalActionException {
  super.fire();
  if (input.hasToken(0)) {
    if (!firstFire && server.getClientFlag() == 0) {
      _writeToServer();
      _readFromServer();
      if (server.getClientFlag() == 0) {
        final double simTimRea=server.getSimulationTimeReadFromClient();
        final double simTim=getDirector().getModelTime().getDoubleValue();
        if (Math.abs(simTim - simTimRea) > 0.0001) {
          final String em="String_Node_Str" + this.getFullName() + "String_Node_Str"+ LS+ "String_Node_Str"+ simTim+ LS+ "String_Node_Str"+ simTimRea;
          throw new IllegalActionException(this,em);
        }
        double[] dblRea=server.getDoubleArray();
        outTok=new DoubleMatrixToken(dblRea,dblRea.length,1);
      }
    }
 else {
      input.get(0);
      firstFire=false;
    }
  }
  output.send(0,outTok);
}

Fixed version (ground truth):
/** 
 * Send the input token to the client program and send the output from the client program to the output port.
 * @exception IllegalActionException If the simulation time between Ptolemy and the client program is not synchronized.
 */
public void fire() throws IllegalActionException {
  super.fire();
  if (input.hasToken(0)) {
    if (server.getClientFlag() == 0) {
      _writeToServer();
      _readFromServer();
      if (server.getClientFlag() == 0) {
        double[] dblRea=server.getDoubleArray();
        outTok=new DoubleMatrixToken(dblRea,dblRea.length,1);
        final double simTimRea=server.getSimulationTimeReadFromClient();
        final double simTim=getDirector().getModelTime().getDoubleValue();
        if (firstFire)         firstFire=false;
 else {
          if (Math.abs((simTimRea - simTimReaPre) - (simTim - simTimPre)) > 0.0001) {
            final String em="String_Node_Str" + this.getFullName() + "String_Node_Str"+ LS+ "String_Node_Str"+ (simTim - simTimPre)+ LS+ "String_Node_Str"+ (simTimRea - simTimReaPre)+ LS+ "String_Node_Str"+ simTimRea;
            throw new IllegalActionException(this,em);
          }
        }
        simTimReaPre=simTimRea;
        simTimPre=simTim;
      }
    }
 else {
      if (clientTerminated) {
        if (warWin == null) {
          warWin=new Thread(new WarningWindow(terminationMessage));
          warWin.start();
          System.err.println("String_Node_Str" + terminationMessage);
        }
      }
      input.get(0);
      final double simTimRea=server.getSimulationTimeReadFromClient();
      final double simTim=getDirector().getModelTime().getDoubleValue();
      simTimReaPre=simTimRea;
      simTimPre=simTim;
    }
  }
  output.send(0,outTok);
}
Program: 73973
Project: 73973
Buggy source:
/** 
 * Initialize state variables.
 * @exception IllegalActionException If the parent class throws it orif the server socket cannot be opened
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  tokTim=getDirector().getModelTime().getDoubleValue();
  firstFire=true;
  _startSimulation();
  _readFromServer();
  double[] dblRea=server.getDoubleArray();
  outTok=new DoubleMatrixToken(dblRea,dblRea.length,1);
  output.send(0,outTok);
}

Fixed version (ground truth):
/** 
 * Initialize state variables.
 * @exception IllegalActionException If the parent class throws it orif the server socket cannot be opened
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  tokTim=getDirector().getModelTime().getDoubleValue();
  firstFire=true;
  _readFromServer();
  double[] dblRea=server.getDoubleArray();
  outTok=new DoubleMatrixToken(dblRea,dblRea.length,1);
  output.send(0,outTok);
}
Program: 73976
Project: 73976
Buggy source:
/** 
 * Set the process arguments.
 * @param cmdarray array containing the command to call and its arguments.
 * @param dir the working directory of the subprocess.
 * @exception IllegalActionException if the canonical path name of the program filecannot be obtained.
 */
public void setProcessArguments(List<String> cmdarray,String dir) throws IllegalActionException {
  cmdArr=new ArrayList<String>();
  for (int i=0; i < cmdarray.size(); i++) {
    if (i == 0) {
      String s=cmdarray.get(i);
      File f=new File(s);
      if (f.exists()) {
        try {
          s=f.getCanonicalPath();
        }
 catch (        java.io.IOException exc) {
          String em="String_Node_Str" + s + "String_Node_Str";
          throw new IllegalActionException(em);
        }
      }
      cmdArr.add(s);
    }
 else {
      cmdArr.add(cmdarray.get(i));
    }
  }
  if (dir.equalsIgnoreCase("String_Node_Str")) {
    worDir=new File(System.getProperty("String_Node_Str"));
  }
 else   if (dir.startsWith("String_Node_Str")) {
    worDir=new File(System.getProperty("String_Node_Str") + dir.substring(1));
  }
 else {
    worDir=new File(dir);
    if (!worDir.isAbsolute()) {
      worDir=new File(System.getProperty("String_Node_Str") + File.separator + dir);
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the process arguments.
 * @param cmdarray array containing the command to call and its arguments.
 * @param dir the working directory of the subprocess.
 * @exception IllegalActionException if the canonical path name of the program filecannot be obtained.
 */
public void setProcessArguments(List<String> cmdarray,String dir) throws IllegalActionException {
  cmdArr=new ArrayList<String>();
  for (int i=0; i < cmdarray.size(); i++)   cmdArr.add(cmdarray.get(i));
  if (dir.equalsIgnoreCase("String_Node_Str")) {
    worDir=new File(System.getProperty("String_Node_Str"));
  }
 else   if (dir.startsWith("String_Node_Str")) {
    worDir=new File(System.getProperty("String_Node_Str") + dir.substring(1));
  }
 else {
    worDir=new File(dir);
    if (!worDir.isAbsolute()) {
      worDir=new File(System.getProperty("String_Node_Str") + File.separator + dir);
    }
  }
}
Program: 73977
Project: 73977
Buggy source:
/** 
 * Resolve the command string. This method replaces $CLASSPATH, relative file names and adds .exe to the command (under Windows)
 * @param prgramName Name of program that starts the simulation.
 * @exception IllegalActionException If the simulation process argumentsare invalid.
 */
public static String resolveCommandName(final File programName) throws IllegalActionException {
  File commandFile=programName;
  if (System.getProperty("String_Node_Str").startsWith("String_Node_Str")) {
    File winComFil=new File(commandFile.toString() + "String_Node_Str");
    if (winComFil.exists()) {
      commandFile=winComFil;
    }
  }
  if (commandFile.isDirectory())   return commandFile.getName();
  String comArg=commandFile.toString();
  commandFile=new File(comArg);
  if (commandFile.exists() && !commandFile.isDirectory()) {
    try {
      comArg=commandFile.getCanonicalPath();
    }
 catch (    java.io.IOException exc) {
      String em="String_Node_Str" + comArg + "String_Node_Str";
      throw new IllegalActionException(em);
    }
  }
 else   comArg=commandFile.getName();
  return comArg;
}

Fixed version (ground truth):
/** 
 * Resolve the command string. This method replaces $CLASSPATH, relative file names and adds .exe to the command (under Windows)
 * @param prgramName Name of program that starts the simulation.
 * @exception IllegalActionException If the simulation process argumentsare invalid.
 */
public static String resolveCommandName(final File programName) throws IllegalActionException {
  File commandFile=programName;
  if (System.getProperty("String_Node_Str").startsWith("String_Node_Str")) {
    File winComFil=new File(commandFile.toString() + "String_Node_Str");
    if (winComFil.exists())     commandFile=winComFil;
  }
  if (commandFile.isDirectory())   return commandFile.getName();
  String comArg=commandFile.toString();
  commandFile=new File(comArg);
  if (commandFile.exists() && !commandFile.isDirectory()) {
    try {
      comArg=commandFile.getCanonicalPath();
    }
 catch (    java.io.IOException exc) {
      String em="String_Node_Str" + comArg + "String_Node_Str";
      throw new IllegalActionException(em);
    }
  }
 else   comArg=commandFile.getName();
  return comArg;
}
Program: 73978
Project: 73978
Buggy source:
/** 
 * Set the values of input variables. Choose the enabled transition among the outgoing transitions of the current state. Throw an exception if there is more than one transition enabled. Otherwise, execute the output actions contained by the chosen transition.
 * @exception IllegalActionException If there is more than onetransition enabled.
 */
public void fire() throws IllegalActionException {
  readInputs();
  List transitionList=_currentState.outgoingPort.linkedRelationList();
  chooseTransition(transitionList);
}

Fixed version (ground truth):
/** 
 * Set the values of input variables. Choose the enabled transition among the outgoing transitions of the current state. Throw an exception if there is more than one transition enabled. Otherwise, execute the output actions contained by the chosen transition.
 * @exception IllegalActionException If there is more than onetransition enabled.
 */
public void fire() throws IllegalActionException {
  readInputs();
  List transitionList=_currentState.outgoingPort.linkedRelationList();
  Transition chosenTransition=chooseTransition(transitionList);
  if (chosenTransition == null && !foundUnknown() && _currentState.getRefinement() == null) {
    List<IOPort> outputs=outputPortList();
    for (    IOPort port : outputs) {
      for (int channel=0; channel < port.getWidth(); channel++) {
        if (!port.isKnown(channel)) {
          port.sendClear(channel);
        }
      }
    }
  }
}
Program: 73983
Project: 73983
Buggy source:
/** 
 * Calculates the absolute deadline for the pure event. This uses information stored earlier. The exact calculation is done as follows: <p> If the new event(e') is produced due to the processing of a trigger event(e), then the absolute deadline of the new event AD(e') = AD(e) + (\tau(e') - \tau(e) - \delta). Here, \tau(e') and \tau(e) are the timestamps of e' and e, while \delta is the minimum dependency between the destination port of the trigger event and any of the output ports. </p><p> If the new event (e') is produced due to the processing of a earlier pure event, then the formula is the same, only \delta == 0;
 * @see #_saveEventInformation(List)
 */
private Time _absoluteDeadlineForPureEvent(Time nextTimestamp){
  Time timeDiff=(nextTimestamp.subtract(_lastTimestamp)).subtract(_lastDependency.timeValue());
  if (timeDiff.compareTo(_zero) < 0) {
    return _lastAbsoluteDeadline;
  }
  return _lastAbsoluteDeadline.add(timeDiff);
}

Fixed version (ground truth):
/** 
 * Calculates the absolute deadline for the pure event. This uses information stored earlier. The exact calculation is done as follows: <p> If the new event(e') is produced due to the processing of a trigger event(e), then the absolute deadline of the new event AD(e') = AD(e) + (\tau(e') - \tau(e) - \delta). Here, \tau(e') and \tau(e) are the timestamps of e' and e, while \delta is the minimum dependency between the destination port of the trigger event and any of the output ports. </p><p> If the new event (e') is produced due to the processing of a earlier pure event, then the formula is the same, only \delta == 0;
 * @see #_saveEventInformation(List)
 */
private Time _absoluteDeadlineForPureEvent(Time nextTimestamp){
  if (_lastTimestamp == null || _lastDependency == null) {
    return Time.NEGATIVE_INFINITY;
  }
  Time timeDiff=(nextTimestamp.subtract(_lastTimestamp)).subtract(_lastDependency.timeValue());
  if (timeDiff.compareTo(_zero) < 0) {
    return _lastAbsoluteDeadline;
  }
  return _lastAbsoluteDeadline.add(timeDiff);
}