Program: 73203
Project: 73203
Buggy source:
/** 
 * Check the configuration for common style problems.
 * @return HTML describing the problems
 * @exception Exception If there is a problem cloning the configuration.
 */
public String check() throws Exception {
  StringBuffer results=new StringBuffer();
  Configuration cloneConfiguration=(Configuration)clone();
  Iterator containedObjects=containedObjectsIterator();
  while (containedObjects.hasNext()) {
    NamedObj containedObject=(NamedObj)containedObjects.next();
    if (containedObject instanceof TypedAtomicActor || containedObject instanceof Attribute) {
      try {
        results.append(_checkCloneFields(containedObject));
      }
 catch (      Throwable throwable) {
        throw new InternalErrorException(containedObject,null,throwable,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
    }
  }
  List entityList=allAtomicEntityList();
  Iterator entities=entityList.iterator();
  while (entities.hasNext()) {
    Object entity=entities.next();
    if (entity instanceof TypedAtomicActor) {
      try {
        results.append(_checkCloneFields((TypedAtomicActor)entity));
      }
 catch (      Throwable throwable) {
        throw new InternalErrorException((TypedAtomicActor)entity,null,throwable,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
      TypedAtomicActor actor=(TypedAtomicActor)entity;
      String fullName=actor.getName(this);
      TypedAtomicActor clone=(TypedAtomicActor)cloneConfiguration.getEntity(fullName);
      if (clone == null) {
        results.append("String_Node_Str" + fullName + "String_Node_Str");
      }
 else {
        Set<Inequality> constraints=actor.typeConstraints();
        Set<Inequality> cloneConstraints=clone.typeConstraints();
        if (constraints.size() != cloneConstraints.size()) {
          results.append(actor.getFullName() + "String_Node_Str" + constraints.size()+ "String_Node_Str"+ "String_Node_Str"+ cloneConstraints.size()+ "String_Node_Str"+ "String_Node_Str");
          Iterator constraintIterator=constraints.iterator();
          while (constraintIterator.hasNext()) {
            Inequality constraint=(Inequality)constraintIterator.next();
            results.append(constraint.toString() + "String_Node_Str");
          }
          results.append("String_Node_Str");
          Iterator cloneConstraintIterator=cloneConstraints.iterator();
          while (cloneConstraintIterator.hasNext()) {
            Inequality constraint=(Inequality)cloneConstraintIterator.next();
            results.append(constraint.toString() + "String_Node_Str");
          }
        }
        HashSet<String> constraintsDescription=new HashSet<String>();
        try {
          Iterator constraintIterator=constraints.iterator();
          while (constraintIterator.hasNext()) {
            Inequality constraint=(Inequality)constraintIterator.next();
            constraintsDescription.add(constraint.toString());
          }
        }
 catch (        Throwable throwable) {
          throw new IllegalActionException(actor,throwable,"String_Node_Str");
        }
        Iterator cloneConstraintIterator=cloneConstraints.iterator();
        while (cloneConstraintIterator.hasNext()) {
          Inequality constraint=(Inequality)cloneConstraintIterator.next();
          if (!constraintsDescription.contains(constraint.toString())) {
            results.append("String_Node_Str" + actor.getFullName() + "String_Node_Str"+ constraint.toString()+ "String_Node_Str");
          }
        }
        HashSet<String> cloneConstraintsDescription=new HashSet<String>();
        try {
          Iterator constraintIterator=cloneConstraints.iterator();
          while (constraintIterator.hasNext()) {
            Inequality constraint=(Inequality)constraintIterator.next();
            cloneConstraintsDescription.add(constraint.toString());
          }
        }
 catch (        Throwable throwable) {
          throw new IllegalActionException(actor,throwable,"String_Node_Str");
        }
        Iterator constraintIterator=constraints.iterator();
        while (constraintIterator.hasNext()) {
          Inequality constraint=(Inequality)constraintIterator.next();
          if (!cloneConstraintsDescription.contains(constraint.toString())) {
            results.append("String_Node_Str" + actor.getFullName() + "String_Node_Str"+ constraint.toString()+ "String_Node_Str");
          }
        }
        cloneConstraintIterator=cloneConstraints.iterator();
        while (cloneConstraintIterator.hasNext()) {
          Inequality constraint=(Inequality)cloneConstraintIterator.next();
          InequalityTerm greaterTerm=constraint.getGreaterTerm();
          InequalityTerm lesserTerm=constraint.getLesserTerm();
          Object greaterAssociatedObject=greaterTerm.getAssociatedObject();
          Object lesserAssociatedObject=lesserTerm.getAssociatedObject();
          if (greaterAssociatedObject instanceof NamedObj && lesserAssociatedObject instanceof NamedObj) {
            NamedObj greaterNamedObj=(NamedObj)greaterAssociatedObject;
            NamedObj lesserNamedObj=(NamedObj)lesserAssociatedObject;
            if (greaterNamedObj != null && lesserNamedObj != null && (greaterNamedObj.getContainer() != lesserNamedObj.getContainer())) {
              results.append(clone.getFullName() + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ greaterNamedObj.getFullName()+ "String_Node_Str"+ greaterNamedObj.getContainer()+ "String_Node_Str"+ lesserNamedObj.getFullName()+ "String_Node_Str"+ lesserNamedObj.getContainer()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
            }
          }
        }
      }
    }
  }
  return results.toString();
}

Fixed version (ground truth):
/** 
 * Check the configuration for common style problems.
 * @return HTML describing the problems
 * @exception Exception If there is a problem cloning the configuration.
 */
public String check() throws Exception {
  StringBuffer results=new StringBuffer();
  Configuration cloneConfiguration=(Configuration)clone();
  Iterator containedObjects=deepNamedObjList().iterator();
  while (containedObjects.hasNext()) {
    NamedObj containedObject=(NamedObj)containedObjects.next();
    if (containedObject instanceof TypedAtomicActor || containedObject instanceof Attribute) {
      try {
        results.append(checkCloneFields(containedObject));
      }
 catch (      Throwable throwable) {
        throw new InternalErrorException(containedObject,null,throwable,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
    }
  }
  containedObjects=deepCompositeEntityList().iterator();
  for (  CompositeEntity composite : deepCompositeEntityList()) {
    Iterator attributes=composite.attributeList().iterator();
    while (attributes.hasNext()) {
      Attribute attribute=(Attribute)attributes.next();
      try {
        results.append(checkCloneFields(attribute));
      }
 catch (      Throwable throwable) {
        throw new InternalErrorException(attribute,null,throwable,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
    }
  }
  List entityList=allAtomicEntityList();
  Iterator entities=entityList.iterator();
  while (entities.hasNext()) {
    Object entity=entities.next();
    if (entity instanceof TypedAtomicActor) {
      try {
        results.append(checkCloneFields((TypedAtomicActor)entity));
      }
 catch (      Throwable throwable) {
        throw new InternalErrorException((TypedAtomicActor)entity,null,throwable,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
      TypedAtomicActor actor=(TypedAtomicActor)entity;
      String fullName=actor.getName(this);
      TypedAtomicActor clone=(TypedAtomicActor)cloneConfiguration.getEntity(fullName);
      if (clone == null) {
        results.append("String_Node_Str" + fullName + "String_Node_Str");
      }
 else {
        Set<Inequality> constraints=actor.typeConstraints();
        Set<Inequality> cloneConstraints=clone.typeConstraints();
        if (constraints.size() != cloneConstraints.size()) {
          results.append(actor.getFullName() + "String_Node_Str" + constraints.size()+ "String_Node_Str"+ "String_Node_Str"+ cloneConstraints.size()+ "String_Node_Str"+ "String_Node_Str");
          Iterator constraintIterator=constraints.iterator();
          while (constraintIterator.hasNext()) {
            Inequality constraint=(Inequality)constraintIterator.next();
            results.append(constraint.toString() + "String_Node_Str");
          }
          results.append("String_Node_Str");
          Iterator cloneConstraintIterator=cloneConstraints.iterator();
          while (cloneConstraintIterator.hasNext()) {
            Inequality constraint=(Inequality)cloneConstraintIterator.next();
            results.append(constraint.toString() + "String_Node_Str");
          }
        }
        HashSet<String> constraintsDescription=new HashSet<String>();
        try {
          Iterator constraintIterator=constraints.iterator();
          while (constraintIterator.hasNext()) {
            Inequality constraint=(Inequality)constraintIterator.next();
            constraintsDescription.add(constraint.toString());
          }
        }
 catch (        Throwable throwable) {
          throw new IllegalActionException(actor,throwable,"String_Node_Str");
        }
        Iterator cloneConstraintIterator=cloneConstraints.iterator();
        while (cloneConstraintIterator.hasNext()) {
          Inequality constraint=(Inequality)cloneConstraintIterator.next();
          if (!constraintsDescription.contains(constraint.toString())) {
            results.append("String_Node_Str" + actor.getFullName() + "String_Node_Str"+ constraint.toString()+ "String_Node_Str");
          }
        }
        HashSet<String> cloneConstraintsDescription=new HashSet<String>();
        try {
          Iterator constraintIterator=cloneConstraints.iterator();
          while (constraintIterator.hasNext()) {
            Inequality constraint=(Inequality)constraintIterator.next();
            cloneConstraintsDescription.add(constraint.toString());
          }
        }
 catch (        Throwable throwable) {
          throw new IllegalActionException(actor,throwable,"String_Node_Str");
        }
        Iterator constraintIterator=constraints.iterator();
        while (constraintIterator.hasNext()) {
          Inequality constraint=(Inequality)constraintIterator.next();
          if (!cloneConstraintsDescription.contains(constraint.toString())) {
            results.append("String_Node_Str" + actor.getFullName() + "String_Node_Str"+ constraint.toString()+ "String_Node_Str");
          }
        }
        cloneConstraintIterator=cloneConstraints.iterator();
        while (cloneConstraintIterator.hasNext()) {
          Inequality constraint=(Inequality)cloneConstraintIterator.next();
          InequalityTerm greaterTerm=constraint.getGreaterTerm();
          InequalityTerm lesserTerm=constraint.getLesserTerm();
          Object greaterAssociatedObject=greaterTerm.getAssociatedObject();
          Object lesserAssociatedObject=lesserTerm.getAssociatedObject();
          if (greaterAssociatedObject instanceof NamedObj && lesserAssociatedObject instanceof NamedObj) {
            NamedObj greaterNamedObj=(NamedObj)greaterAssociatedObject;
            NamedObj lesserNamedObj=(NamedObj)lesserAssociatedObject;
            if (greaterNamedObj != null && lesserNamedObj != null && (greaterNamedObj.getContainer() != lesserNamedObj.getContainer())) {
              results.append(clone.getFullName() + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ greaterNamedObj.getFullName()+ "String_Node_Str"+ greaterNamedObj.getContainer()+ "String_Node_Str"+ lesserNamedObj.getFullName()+ "String_Node_Str"+ lesserNamedObj.getContainer()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
            }
          }
        }
      }
    }
  }
  return results.toString();
}