Program: 87561
Project: 87561
Buggy source:
/** 
 * Gets the global properties of the source's output after it crossed a pact connection with the given shipping strategy. Global properties are maintained on <tt>FORWARD</tt> connections. If a partitioning happens, then a partitioning property exists afterwards. A <tt>BROADCAST</tt> connection destroys the key uniqueness. <p> If the shipping strategy has not yet been determined, the properties of the connections source are returned.
 * @return The properties of the data after this channel.
 */
public static GlobalProperties getGlobalPropertiesAfterConnection(OptimizerNode source,OptimizerNode target,ShipStrategy shipMode){
  GlobalProperties gp=source.getGlobalProperties().createCopy();
  FieldList keyFields=null;
  int inputNum=0;
  for (  PactConnection conn : target.getIncomingConnections()) {
    if (conn.getSourcePact().getId() == source.getId()) {
      if (conn.getScramblePartitionedFields() != null) {
        throw new CompilerException("String_Node_Str");
      }
 else       if (target.getPactContract() instanceof AbstractPact<?>) {
        keyFields=new FieldList(((AbstractPact<?>)target.getPactContract()).getKeyColumnNumbers(inputNum));
      }
      break;
    }
    inputNum++;
  }
switch (shipMode) {
case BROADCAST:
    gp.reset();
  break;
case PARTITION_RANGE:
gp.setPartitioning(PartitionProperty.RANGE_PARTITIONED,keyFields);
break;
case PARTITION_HASH:
gp.setPartitioning(PartitionProperty.HASH_PARTITIONED,keyFields);
gp.setOrdering(null);
break;
case FORWARD:
if (source.getDegreeOfParallelism() > target.getDegreeOfParallelism()) {
gp.setOrdering(null);
}
break;
case NONE:
throw new CompilerException("String_Node_Str");
case SFR:
default :
throw new CompilerException("String_Node_Str" + shipMode.name());
}
return gp;
}

Fixed version (ground truth):
/** 
 * Gets the global properties of the source's output after it crossed a pact connection with the given shipping strategy. Global properties are maintained on <tt>FORWARD</tt> connections. If a partitioning happens, then a partitioning property exists afterwards. A <tt>BROADCAST</tt> connection destroys the key uniqueness. <p> If the shipping strategy has not yet been determined, the properties of the connections source are returned.
 * @return The properties of the data after this channel.
 */
public static GlobalProperties getGlobalPropertiesAfterConnection(OptimizerNode source,OptimizerNode target,int targetInputNum,ShipStrategy shipMode){
  GlobalProperties gp=source.getGlobalProperties().createCopy();
  FieldList keyFields=null;
  PactConnection conn=target.getIncomingConnections().get(targetInputNum);
  if (conn.getScramblePartitionedFields() != null) {
    throw new CompilerException("String_Node_Str");
  }
 else   if (target.getPactContract() instanceof AbstractPact<?>) {
    keyFields=new FieldList(((AbstractPact<?>)target.getPactContract()).getKeyColumnNumbers(targetInputNum));
  }
switch (shipMode) {
case BROADCAST:
    gp.reset();
  break;
case PARTITION_RANGE:
gp.setPartitioning(PartitionProperty.RANGE_PARTITIONED,keyFields);
break;
case PARTITION_HASH:
gp.setPartitioning(PartitionProperty.HASH_PARTITIONED,keyFields);
gp.setOrdering(null);
break;
case FORWARD:
if (source.getDegreeOfParallelism() > target.getDegreeOfParallelism()) {
gp.setOrdering(null);
}
break;
case NONE:
throw new CompilerException("String_Node_Str");
case SFR:
default :
throw new CompilerException("String_Node_Str" + shipMode.name());
}
return gp;
}