Program: 87856
Project: 87856
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();
  int inputNum=0;
  FieldSet keyFields=null;
  for (  List<PactConnection> connections : target.getIncomingConnections()) {
    boolean isThisConnection=false;
    for (    PactConnection connection : connections) {
      if (connection.getSourcePact().equals(source)) {
        if (target.getPactContract() instanceof AbstractPact<?>) {
          keyFields=new FieldSet(((AbstractPact<?>)target.getPactContract()).getKeyColumnNumbers(inputNum));
        }
        break;
      }
    }
    if (isThisConnection) {
      break;
    }
 else {
      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,ShipStrategy shipMode){
  GlobalProperties gp=source.getGlobalProperties().createCopy();
  int inputNum=0;
  FieldSet keyFields=null;
  for (  List<PactConnection> connections : target.getIncomingConnections()) {
    boolean isThisConnection=false;
    for (    PactConnection connection : connections) {
      if (connection.getSourcePact().getId() == source.getId()) {
        if (target.getPactContract() instanceof AbstractPact<?>) {
          keyFields=new FieldSet(((AbstractPact<?>)target.getPactContract()).getKeyColumnNumbers(inputNum));
        }
        break;
      }
    }
    if (isThisConnection) {
      break;
    }
 else {
      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;
}