Program: 88170
Project: 88170
Buggy source:
/** 
 * This method implements the post-visit during the depth-first traversal. When the post visit happens, all of the descendants have been processed, so this method connects all of the current node's predecessors to the current node.
 * @param node The node currently processed during the post-visit.
 * @see eu.stratosphere.pact.common.plan.Visitor#postVisit(eu.stratosphere.pact.common.plan.Visitable)
 */
@Override public void postVisit(OptimizerNode node){
  try {
    AbstractJobVertex inputVertex=this.vertices.get(node);
    List<PactConnection> incomingConns=node.getIncomingConnections();
    if (incomingConns == null) {
      return;
    }
    for (    PactConnection connection : node.getIncomingConnections()) {
      AbstractJobVertex outputVertex=this.vertices.get(connection.getSourcePact());
      if (outputVertex == null) {
        throw new Exception("String_Node_Str");
      }
switch (connection.getShipStrategy()) {
case FORWARD:
        connectWithForwardStrategy(connection,outputVertex,inputVertex);
      break;
case PARTITION_HASH:
    connectWithPartitionStrategy(connection,outputVertex,inputVertex);
  break;
case BROADCAST:
connectWithBroadcastStrategy(connection,outputVertex,inputVertex);
break;
case PARTITION_RANGE:
if (isDistributionGiven(connection)) {
connectWithGivenDistributionPartitionRangeStrategy(connection,outputVertex,inputVertex);
}
 else {
connectWithSamplingPartitionRangeStrategy(connection,outputVertex,inputVertex);
}
break;
case SFR:
connectWithSFRStrategy(connection,outputVertex,inputVertex);
default :
throw new Exception("String_Node_Str" + connection.getShipStrategy());
}
}
}
 catch (Exception e) {
throw new CompilerException("String_Node_Str" + e.getMessage(),e);
}
}

Fixed version (ground truth):
/** 
 * This method implements the post-visit during the depth-first traversal. When the post visit happens, all of the descendants have been processed, so this method connects all of the current node's predecessors to the current node.
 * @param node The node currently processed during the post-visit.
 * @see eu.stratosphere.pact.common.plan.Visitor#postVisit(eu.stratosphere.pact.common.plan.Visitable)
 */
@Override public void postVisit(OptimizerNode node){
  try {
    AbstractJobVertex inputVertex=this.vertices.get(node);
    List<PactConnection> incomingConns=node.getIncomingConnections();
    if (incomingConns == null) {
      return;
    }
    for (    PactConnection connection : node.getIncomingConnections()) {
      AbstractJobVertex outputVertex=this.vertices.get(connection.getSourcePact());
      if (outputVertex == null) {
        throw new Exception("String_Node_Str");
      }
switch (connection.getShipStrategy()) {
case FORWARD:
        connectWithForwardStrategy(connection,outputVertex,inputVertex);
      break;
case PARTITION_LOCAL_HASH:
case PARTITION_HASH:
    connectWithPartitionStrategy(connection,outputVertex,inputVertex);
  break;
case BROADCAST:
connectWithBroadcastStrategy(connection,outputVertex,inputVertex);
break;
case PARTITION_RANGE:
if (isDistributionGiven(connection)) {
connectWithGivenDistributionPartitionRangeStrategy(connection,outputVertex,inputVertex);
}
 else {
connectWithSamplingPartitionRangeStrategy(connection,outputVertex,inputVertex);
}
break;
case SFR:
connectWithSFRStrategy(connection,outputVertex,inputVertex);
default :
throw new Exception("String_Node_Str" + connection.getShipStrategy());
}
}
}
 catch (Exception e) {
throw new CompilerException("String_Node_Str" + e.getMessage(),e);
}
}