Program: 55165
Project: 55165
Buggy source:
/** 
 * This methods implements the pre-visiting during a depth-first traversal. It create the job vertex and sets local strategy.
 * @param node The node that is currently processed.
 * @return True, if the visitor should descend to the node's children, false if not.
 * @see eu.stratosphere.pact.common.util.Visitor#preVisit(eu.stratosphere.pact.common.plan.Visitable)
 */
@Override public boolean preVisit(PlanNode node){
  if (this.vertices.containsKey(node) || this.chainedTasks.containsKey(node)) {
    return false;
  }
  final AbstractJobVertex vertex;
  try {
    if (node instanceof SinkPlanNode) {
      vertex=createDataSinkVertex((SinkPlanNode)node);
    }
 else     if (node instanceof SourcePlanNode) {
      vertex=createDataSourceVertex((SourcePlanNode)node);
    }
 else     if (node instanceof BulkIterationPlanNode) {
      BulkIterationPlanNode iterationNode=(BulkIterationPlanNode)node;
      PlanNode root=iterationNode.getRootOfStepFunction();
      if (root.getDegreeOfParallelism() != node.getDegreeOfParallelism() || root.getSubtasksPerInstance() != node.getSubtasksPerInstance()) {
        throw new CompilerException("String_Node_Str" + "String_Node_Str");
      }
      IterationDescriptor descr=new IterationDescriptor(iterationNode,this.iterationIdEnumerator++);
      this.iterations.put(iterationNode,descr);
      vertex=null;
    }
 else     if (node instanceof WorksetIterationPlanNode) {
      WorksetIterationPlanNode iterationNode=(WorksetIterationPlanNode)node;
      PlanNode nextWorkSet=iterationNode.getNextWorkSetPlanNode();
      PlanNode solutionSetDelta=iterationNode.getSolutionSetDeltaPlanNode();
      if (nextWorkSet.getDegreeOfParallelism() != node.getDegreeOfParallelism() || nextWorkSet.getSubtasksPerInstance() != node.getSubtasksPerInstance()) {
        throw new CompilerException("String_Node_Str" + "String_Node_Str");
      }
      if (solutionSetDelta.getDegreeOfParallelism() != node.getDegreeOfParallelism() || solutionSetDelta.getSubtasksPerInstance() != node.getSubtasksPerInstance()) {
        throw new CompilerException("String_Node_Str" + "String_Node_Str");
      }
      IterationDescriptor descr=new IterationDescriptor(iterationNode,this.iterationIdEnumerator++);
      this.iterations.put(iterationNode,descr);
      vertex=null;
    }
 else     if (node instanceof SingleInputPlanNode) {
      vertex=createSingleInputVertex((SingleInputPlanNode)node);
    }
 else     if (node instanceof DualInputPlanNode) {
      vertex=createDualInputVertex((DualInputPlanNode)node);
    }
 else     if (node instanceof NAryUnionPlanNode) {
      vertex=null;
    }
 else     if (node instanceof BulkPartialSolutionPlanNode) {
      vertex=createBulkIterationHead((BulkPartialSolutionPlanNode)node);
    }
 else     if (node instanceof SolutionSetPlanNode) {
      vertex=null;
    }
 else     if (node instanceof WorksetPlanNode) {
      vertex=createWorksetIterationHead((WorksetPlanNode)node);
    }
 else {
      throw new CompilerException("String_Node_Str" + node.getClass().getName());
    }
  }
 catch (  Exception e) {
    throw new CompilerException("String_Node_Str" + node + "String_Node_Str"+ e.getMessage(),e);
  }
  if (vertex != null) {
    int pd=node.getDegreeOfParallelism();
    vertex.setNumberOfSubtasks(pd);
    if (this.maxDegreeVertex == null || this.maxDegreeVertex.getNumberOfSubtasks() < pd) {
      this.maxDegreeVertex=vertex;
    }
    if (node.getSubtasksPerInstance() >= 1) {
      vertex.setNumberOfSubtasksPerInstance(node.getSubtasksPerInstance());
    }
    if (this.currentIteration != null) {
      PlanNode iterationNode=(PlanNode)this.currentIteration;
      if (iterationNode.getDegreeOfParallelism() != pd) {
        throw new CompilerException("String_Node_Str");
      }
      if (iterationNode.getSubtasksPerInstance() != node.getSubtasksPerInstance()) {
        throw new CompilerException("String_Node_Str");
      }
      IterationDescriptor descr=this.iterations.get(this.currentIteration);
      new TaskConfig(vertex.getConfiguration()).setIterationId(descr.getId());
    }
    this.vertices.put(node,vertex);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * This methods implements the pre-visiting during a depth-first traversal. It create the job vertex and sets local strategy.
 * @param node The node that is currently processed.
 * @return True, if the visitor should descend to the node's children, false if not.
 * @see eu.stratosphere.pact.common.util.Visitor#preVisit(eu.stratosphere.pact.common.plan.Visitable)
 */
@Override public boolean preVisit(PlanNode node){
  if (this.vertices.containsKey(node) || this.chainedTasks.containsKey(node) || this.iterations.containsKey(node)) {
    return false;
  }
  final AbstractJobVertex vertex;
  try {
    if (node instanceof SinkPlanNode) {
      vertex=createDataSinkVertex((SinkPlanNode)node);
    }
 else     if (node instanceof SourcePlanNode) {
      vertex=createDataSourceVertex((SourcePlanNode)node);
    }
 else     if (node instanceof BulkIterationPlanNode) {
      BulkIterationPlanNode iterationNode=(BulkIterationPlanNode)node;
      PlanNode root=iterationNode.getRootOfStepFunction();
      if (root.getDegreeOfParallelism() != node.getDegreeOfParallelism() || root.getSubtasksPerInstance() != node.getSubtasksPerInstance()) {
        throw new CompilerException("String_Node_Str" + "String_Node_Str");
      }
      IterationDescriptor descr=new IterationDescriptor(iterationNode,this.iterationIdEnumerator++);
      this.iterations.put(iterationNode,descr);
      vertex=null;
    }
 else     if (node instanceof WorksetIterationPlanNode) {
      WorksetIterationPlanNode iterationNode=(WorksetIterationPlanNode)node;
      PlanNode nextWorkSet=iterationNode.getNextWorkSetPlanNode();
      PlanNode solutionSetDelta=iterationNode.getSolutionSetDeltaPlanNode();
      if (nextWorkSet.getDegreeOfParallelism() != node.getDegreeOfParallelism() || nextWorkSet.getSubtasksPerInstance() != node.getSubtasksPerInstance()) {
        throw new CompilerException("String_Node_Str" + "String_Node_Str");
      }
      if (solutionSetDelta.getDegreeOfParallelism() != node.getDegreeOfParallelism() || solutionSetDelta.getSubtasksPerInstance() != node.getSubtasksPerInstance()) {
        throw new CompilerException("String_Node_Str" + "String_Node_Str");
      }
      IterationDescriptor descr=new IterationDescriptor(iterationNode,this.iterationIdEnumerator++);
      this.iterations.put(iterationNode,descr);
      vertex=null;
    }
 else     if (node instanceof SingleInputPlanNode) {
      vertex=createSingleInputVertex((SingleInputPlanNode)node);
    }
 else     if (node instanceof DualInputPlanNode) {
      vertex=createDualInputVertex((DualInputPlanNode)node);
    }
 else     if (node instanceof NAryUnionPlanNode) {
      vertex=null;
    }
 else     if (node instanceof BulkPartialSolutionPlanNode) {
      vertex=createBulkIterationHead((BulkPartialSolutionPlanNode)node);
    }
 else     if (node instanceof SolutionSetPlanNode) {
      vertex=null;
    }
 else     if (node instanceof WorksetPlanNode) {
      vertex=createWorksetIterationHead((WorksetPlanNode)node);
    }
 else {
      throw new CompilerException("String_Node_Str" + node.getClass().getName());
    }
  }
 catch (  Exception e) {
    throw new CompilerException("String_Node_Str" + node + "String_Node_Str"+ e.getMessage(),e);
  }
  if (vertex != null) {
    int pd=node.getDegreeOfParallelism();
    vertex.setNumberOfSubtasks(pd);
    if (this.maxDegreeVertex == null || this.maxDegreeVertex.getNumberOfSubtasks() < pd) {
      this.maxDegreeVertex=vertex;
    }
    if (node.getSubtasksPerInstance() >= 1) {
      vertex.setNumberOfSubtasksPerInstance(node.getSubtasksPerInstance());
    }
    if (this.currentIteration != null) {
      PlanNode iterationNode=(PlanNode)this.currentIteration;
      if (iterationNode.getDegreeOfParallelism() != pd) {
        throw new CompilerException("String_Node_Str");
      }
      if (iterationNode.getSubtasksPerInstance() != node.getSubtasksPerInstance()) {
        throw new CompilerException("String_Node_Str");
      }
      IterationDescriptor descr=this.iterations.get(this.currentIteration);
      new TaskConfig(vertex.getConfiguration()).setIterationId(descr.getId());
    }
    this.vertices.put(node,vertex);
  }
  return true;
}