Program: 56096
Project: 56096
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.plan.Visitor#preVisit(eu.stratosphere.pact.common.plan.Visitable)
 */
@Override public boolean preVisit(OptimizerNode node){
  if (vertices.containsKey(node)) {
    return false;
  }
  AbstractJobVertex vertex=null;
  try {
switch (node.getPactType()) {
case Map:
      vertex=generateMapVertex(node);
    break;
case Reduce:
  if (node instanceof ReduceNode) {
    vertex=generateReduceVertex((ReduceNode)node);
  }
 else   if (node instanceof CombinerNode) {
    vertex=generateCombineVertex((CombinerNode)node);
  }
 else {
    throw new CompilerException("String_Node_Str" + node.getClass().getName());
  }
break;
case Match:
vertex=generateMatchVertex(node);
break;
case Cross:
vertex=generateCrossVertex(node);
break;
case Cogroup:
vertex=generateCoGroupVertex(node);
break;
case DataSource:
vertex=generateDataSourceVertex(node);
break;
case DataSink:
vertex=generateDataSinkVertex(node);
break;
default :
throw new Exception("String_Node_Str" + node.getPactType());
}
}
 catch (NotEnoughMemoryException nemex) {
throw new CompilerException("String_Node_Str" + node.getMemoryPerTask() + "String_Node_Str"+ node.toString()+ "String_Node_Str");
}
catch (Exception e) {
throw new CompilerException("String_Node_Str" + e.getMessage(),e);
}
int pd=node.getDegreeOfParallelism();
vertex.setNumberOfSubtasks(pd);
if (maxDegreeVertex == null || maxDegreeVertex.getNumberOfSubtasks() < pd) {
maxDegreeVertex=vertex;
}
if (node.getInstancesPerMachine() >= 1) {
vertex.setNumberOfSubtasksPerInstance(node.getInstancesPerMachine());
}
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.plan.Visitor#preVisit(eu.stratosphere.pact.common.plan.Visitable)
 */
@Override public boolean preVisit(OptimizerNode node){
  if (vertices.containsKey(node)) {
    return false;
  }
  AbstractJobVertex vertex=null;
  try {
switch (node.getPactType()) {
case Map:
      vertex=generateMapVertex(node);
    break;
case Reduce:
  if (node instanceof ReduceNode) {
    vertex=generateReduceVertex((ReduceNode)node);
  }
 else   if (node instanceof CombinerNode) {
    vertex=generateCombineVertex((CombinerNode)node);
  }
 else {
    throw new CompilerException("String_Node_Str" + node.getClass().getName());
  }
break;
case Match:
vertex=generateMatchVertex(node);
break;
case Cross:
vertex=generateCrossVertex(node);
break;
case Cogroup:
vertex=generateCoGroupVertex(node);
break;
case DataSource:
vertex=generateDataSourceVertex(node);
break;
case DataSink:
vertex=generateDataSinkVertex(node);
break;
default :
throw new Exception("String_Node_Str" + node.getPactType());
}
}
 catch (Exception e) {
throw new CompilerException("String_Node_Str" + e.getMessage(),e);
}
int pd=node.getDegreeOfParallelism();
vertex.setNumberOfSubtasks(pd);
if (maxDegreeVertex == null || maxDegreeVertex.getNumberOfSubtasks() < pd) {
maxDegreeVertex=vertex;
}
if (node.getInstancesPerMachine() >= 1) {
vertex.setNumberOfSubtasksPerInstance(node.getInstancesPerMachine());
}
this.vertices.put(node,vertex);
return true;
}