Program: 56237
Project: 56237
Buggy source:
/** 
 * Applies the user defined settings to the execution graph.
 * @param temporaryGroupVertexMap mapping between job vertices and the corresponding group vertices.
 * @throws GraphConversionException thrown if an error occurs while applying the user settings.
 */
private void applyUserDefinedSettings(HashMap<AbstractJobVertex,ExecutionGroupVertex> temporaryGroupVertexMap) throws GraphConversionException {
  Iterator<AbstractJobVertex> it=temporaryGroupVertexMap.keySet().iterator();
  while (it.hasNext()) {
    final AbstractJobVertex jobVertex=it.next();
    if (jobVertex.getVertexToShareInstancesWith() != null) {
      final AbstractJobVertex vertexToShareInstancesWith=jobVertex.getVertexToShareInstancesWith();
      final ExecutionGroupVertex groupVertex=temporaryGroupVertexMap.get(jobVertex);
      final ExecutionGroupVertex groupVertexToShareInstancesWith=temporaryGroupVertexMap.get(vertexToShareInstancesWith);
      groupVertex.shareInstancesWith(groupVertexToShareInstancesWith);
    }
  }
  Iterator<ExecutionGroupVertex> it2=new ExecutionGroupVertexIterator(this,true,-1);
  while (it2.hasNext()) {
    final ExecutionGroupVertex groupVertex=it2.next();
    if (groupVertex.isNumberOfMembersUserDefined()) {
      groupVertex.changeNumberOfGroupMembers(groupVertex.getUserDefinedNumberOfMembers());
    }
  }
  repairInstanceAssignment();
  it2=new ExecutionGroupVertexIterator(this,true,-1);
  while (it2.hasNext()) {
    final ExecutionGroupVertex groupVertex=it2.next();
    for (int i=0; i < groupVertex.getNumberOfForwardLinks(); i++) {
      final ExecutionGroupEdge edge=groupVertex.getForwardEdge(i);
      if (edge.isChannelTypeUserDefined()) {
        edge.changeChannelType(edge.getChannelType());
      }
      if (edge.isCompressionLevelUserDefined()) {
        edge.changeCompressionLevel(edge.getCompressionLevel());
      }
    }
  }
  it2=new ExecutionGroupVertexIterator(this,true,-1);
  while (it2.hasNext()) {
    final ExecutionGroupVertex groupVertex=it2.next();
    if (groupVertex.getVertexToShareInstancesWith() == null) {
      groupVertex.reassignInstances();
      this.repairInstanceAssignment();
    }
  }
}

Fixed version (ground truth):
/** 
 * Applies the user defined settings to the execution graph.
 * @param temporaryGroupVertexMap mapping between job vertices and the corresponding group vertices.
 * @throws GraphConversionException thrown if an error occurs while applying the user settings.
 */
private void applyUserDefinedSettings(HashMap<AbstractJobVertex,ExecutionGroupVertex> temporaryGroupVertexMap) throws GraphConversionException {
  final Iterator<Map.Entry<AbstractJobVertex,ExecutionGroupVertex>> it=temporaryGroupVertexMap.entrySet().iterator();
  while (it.hasNext()) {
    final Map.Entry<AbstractJobVertex,ExecutionGroupVertex> entry=it.next();
    final AbstractJobVertex jobVertex=entry.getKey();
    if (jobVertex.getVertexToShareInstancesWith() != null) {
      final AbstractJobVertex vertexToShareInstancesWith=jobVertex.getVertexToShareInstancesWith();
      final ExecutionGroupVertex groupVertex=entry.getValue();
      final ExecutionGroupVertex groupVertexToShareInstancesWith=temporaryGroupVertexMap.get(vertexToShareInstancesWith);
      groupVertex.shareInstancesWith(groupVertexToShareInstancesWith);
    }
  }
  Iterator<ExecutionGroupVertex> it2=new ExecutionGroupVertexIterator(this,true,-1);
  while (it2.hasNext()) {
    final ExecutionGroupVertex groupVertex=it2.next();
    if (groupVertex.isNumberOfMembersUserDefined()) {
      groupVertex.changeNumberOfGroupMembers(groupVertex.getUserDefinedNumberOfMembers());
    }
  }
  repairInstanceAssignment();
  it2=new ExecutionGroupVertexIterator(this,true,-1);
  while (it2.hasNext()) {
    final ExecutionGroupVertex groupVertex=it2.next();
    for (int i=0; i < groupVertex.getNumberOfForwardLinks(); i++) {
      final ExecutionGroupEdge edge=groupVertex.getForwardEdge(i);
      if (edge.isChannelTypeUserDefined()) {
        edge.changeChannelType(edge.getChannelType());
      }
      if (edge.isCompressionLevelUserDefined()) {
        edge.changeCompressionLevel(edge.getCompressionLevel());
      }
    }
  }
  it2=new ExecutionGroupVertexIterator(this,true,-1);
  while (it2.hasNext()) {
    final ExecutionGroupVertex groupVertex=it2.next();
    if (groupVertex.getVertexToShareInstancesWith() == null) {
      groupVertex.reassignInstances();
      this.repairInstanceAssignment();
    }
  }
}