nus-yam/ex-repair huggingface dataset:
Program: 39157
Project: 39157
Buggy source:
/** 
 * Takes in a WAV file represented as a double array and uses an input generated CPPN to "remix" the sound or manipulate it according to the specifications of the network. Loops through the inputs and manipulates  them according to the length, frequency, and whether the input multipliers have been turned on or not. Outputs a double array that represents the audio of the newly remixed audio. 
 * @param CPPN network used to generate amplitude
 * @param inputWAV double array representing WAV file being remixed
 * @param length length of sample
 * @param frequency Frequency of note being manipulated
 * @param sampleRate specified rate of input wav file 
 * @param inputMultipliers double array determining whether checkboxes have been turned on or off in Breedesizer
 * @return
 */
public static double[] amplitudeRemixer(Network CPPN,double[] inputWAV,int length,double sampleRate,double[] inputMultipliers){
  double[] result=new double[length];
  for (double time=0; time < length; time++) {
    double[] inputs=new double[]{time / sampleRate,Math.sin(2 * Math.PI * time / sampleRate),inputWAV[(int)time],HyperNEATCPPNGenotype.BIAS};
    for (int i=0; i < inputs.length; i++) {
      inputs[i]=inputs[i] * inputMultipliers[i];
    }
    double[] outputs=CPPN.process(inputs);
    result[(int)time]=outputs[0];
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Takes in a WAV file represented as a double array and uses an input generated CPPN to "remix" the sound or manipulate it according to the specifications of the network. Loops through the inputs and manipulates  them according to the length, frequency, and whether the input multipliers have been turned on or not. Outputs a double array that represents the audio of the newly remixed audio. 
 * @param CPPN network used to generate amplitude
 * @param inputWAV double array representing WAV file being remixed
 * @param length length of sample
 * @param frequency Frequency of note being manipulated
 * @param sampleRate specified rate of input wav file 
 * @param inputMultipliers double array determining whether checkboxes have been turned on or off in Breedesizer
 * @return
 */
public static double[] amplitudeRemixer(Network CPPN,double[] inputWAV,int length,double frequency,double[] inputMultipliers){
  double[] result=new double[length];
  for (double time=0; time < length; time++) {
    double[] inputs=new double[]{time / PlayDoubleArray.SAMPLE_RATE,Math.sin(2 * Math.PI * frequency* time / PlayDoubleArray.SAMPLE_RATE),inputWAV[(int)time],HyperNEATCPPNGenotype.BIAS};
    for (int i=0; i < inputs.length; i++) {
      inputs[i]=inputs[i] * inputMultipliers[i];
    }
    double[] outputs=CPPN.process(inputs);
    result[(int)time]=outputs[0];
  }
  return result;
}
Program: 39158
Project: 39158
Buggy source:
/** 
 * HyperNEAT Method that returns a list of information about the substrate layers contained in the network.
 * @return List of Substrates in order from inputs to hidden to outputlayers
 */
public static List<Substrate> getSubstrateInformation(PhysicalGameState pgs){
}

Fixed version (ground truth):
/** 
 * HyperNEAT Method that returns a list of information about the substrate layers contained in the network.
 * @return List of Substrates in order from inputs to hidden to outputlayers
 */
public static List<Substrate> getSubstrateInformation(PhysicalGameState pgs){
  List<Triple<String,Integer,Integer>> output=null;
  return HyperNEATUtil.getSubstrateInformation(pgs.getWidth(),pgs.getHeight(),getNumInputSubstrates(),processingWidth,processingDepth,output);
}
Program: 39159
Project: 39159
Buggy source:
/** 
 * HyperNEAT method that connects substrates to eachother
 * @param pgs physical game state in use
 * @return
 */
public static List<Triple<String,String,Boolean>> getSubstrateConnectivity(PhysicalGameState pgs){
  return HyperNEATUtil.getSubstrateConnectivity(numInputSubstrates,processingWidth,processingDepth,outputNames);
}

Fixed version (ground truth):
/** 
 * HyperNEAT method that connects substrates to eachother
 * @param pgs physical game state in use
 * @return
 */
public static List<Triple<String,String,Boolean>> getSubstrateConnectivity(PhysicalGameState pgs){
  List<String> outputNames=null;
  return HyperNEATUtil.getSubstrateConnectivity(getNumInputSubstrates(),outputNames);
}
Program: 39161
Project: 39161
Buggy source:
public static void multipleCPPNMIDIPlayback(){
  HyperNEATCPPNGenotype test=new HyperNEATCPPNGenotype(3,1,0);
  Network[] cppns=new Network[30];
  for (int i=0; i < 30; i++) {
    test.mutate();
    cppns[i]=test.getCPPN();
  }
  MIDIUtil.playMIDIWithCPPNsFromString(SOLO_PIANO_MID,cppns,1);
}

Fixed version (ground truth):
public static void multipleCPPNMIDIPlayback(){
  HyperNEATCPPNGenotype test=new HyperNEATCPPNGenotype(3,1,0);
  Network[] cppns=new Network[30];
  for (int i=0; i < 30; i++) {
    test.mutate();
    cppns[i]=test.getCPPN();
  }
  MIDIUtil.playMIDIWithCPPNsFromString(CHRISTMAS_MID,cppns,1);
}
Program: 39164
Project: 39164
Buggy source:
public static void newMIDIUtilPlay(Network cppn) throws InvalidMidiDataException, IOException {
  File midiFile=new File(CLASSICAL_MID);
  Sequence sequence=MidiSystem.getSequence(midiFile);
  Track[] tracks=sequence.getTracks();
  ArrayList<Triple<ArrayList<Double>,ArrayList<Long>,ArrayList<Long>>> midiLists=MIDIUtil.soundLines(tracks);
  double[] amplitudes=MIDIUtil.lineToAmplitudeArray(CLASSICAL_MID,midiLists,cppn,1);
  PlayDoubleArray.playDoubleArray(amplitudes);
}

Fixed version (ground truth):
public static void newMIDIUtilPlay(Network cppn) throws InvalidMidiDataException, IOException {
  File midiFile=new File(SOLO_PIANO_MID);
  Sequence sequence=MidiSystem.getSequence(midiFile);
  Track[] tracks=sequence.getTracks();
  ArrayList<Triple<ArrayList<Double>,ArrayList<Long>,ArrayList<Long>>> midiLists=MIDIUtil.soundLines(tracks);
  double[] amplitudes=MIDIUtil.lineToAmplitudeArray(SOLO_PIANO_MID,midiLists,cppn,1);
  PlayDoubleArray.playDoubleArray(amplitudes);
}
Program: 39165
Project: 39165
Buggy source:
public static void main(String[] args) throws UnsupportedAudioFileException, IOException, LineUnavailableException, InterruptedException, JavaLayerException, InvalidMidiDataException {
  Parameters.initializeParameterCollections(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  MMNEAT.loadClasses();
  EvolutionaryHistory.initArchetype(0);
  HyperNEATCPPNGenotype test=new HyperNEATCPPNGenotype(3,1,0);
  for (int i=0; i < 30; i++) {
    test.mutate();
  }
  Network cppn=test.getCPPN();
  newMIDIUtilPrint();
}

Fixed version (ground truth):
public static void main(String[] args) throws UnsupportedAudioFileException, IOException, LineUnavailableException, InterruptedException, JavaLayerException, InvalidMidiDataException {
  Parameters.initializeParameterCollections(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  MMNEAT.loadClasses();
  EvolutionaryHistory.initArchetype(0);
  HyperNEATCPPNGenotype test=new HyperNEATCPPNGenotype(3,1,0);
  for (int i=0; i < 30; i++) {
    test.mutate();
  }
  Network cppn=test.getCPPN();
  newMIDIUtilPlay(cppn);
}
Program: 39166
Project: 39166
Buggy source:
public static void viewMIDIChannel(){
  File furElise=new File(FUR_ELISE_MID);
  MIDIUtil.MIDIData(furElise);
}

Fixed version (ground truth):
public static void viewMIDIChannel(){
  File file=new File(PIRATES_MID);
  MIDIUtil.MIDIData(file);
}
Program: 39167
Project: 39167
Buggy source:
public static void newMIDIUtilPrint() throws InvalidMidiDataException, IOException {
  File midiFile=new File(SOLO_PIANO_MID);
  Sequence sequence=MidiSystem.getSequence(midiFile);
  Track[] tracks=sequence.getTracks();
  ArrayList<Triple<ArrayList<Double>,ArrayList<Long>,ArrayList<Long>>> midiLists=MIDIUtil.soundLines(tracks);
  for (int i=0; i < midiLists.size(); i++) {
    System.out.println("String_Node_Str" + midiLists.get(i).t1);
    System.out.println("String_Node_Str" + midiLists.get(i).t2);
    System.out.println("String_Node_Str" + midiLists.get(i).t3);
    System.out.println();
  }
}

Fixed version (ground truth):
public static void newMIDIUtilPrint() throws InvalidMidiDataException, IOException {
  File midiFile=new File(PIRATES_MID);
  Sequence sequence=MidiSystem.getSequence(midiFile);
  Track[] tracks=sequence.getTracks();
  ArrayList<Triple<ArrayList<Double>,ArrayList<Long>,ArrayList<Long>>> midiLists=MIDIUtil.soundLines(tracks);
  for (int i=0; i < midiLists.size(); i++) {
    System.out.println("String_Node_Str" + midiLists.get(i).t1);
    System.out.println("String_Node_Str" + midiLists.get(i).t2);
    System.out.println("String_Node_Str" + midiLists.get(i).t3);
    System.out.println();
  }
}
Program: 39168
Project: 39168
Buggy source:
/** 
 * all actions performed in a single evaluation of a genotype loop taken from GameVisualSimulationTest, the rest based on MsPacManTask.oneEval()
 * @param individual genotype to be evaluated
 * @param num which evaluation is currently being performed
 * @return Combination of fitness scores (multiobjective possible), andother scores (for tracking non-fitness data)
 */
@Override public Pair<double[],double[]> oneEval(Genotype<T> individual,int num){
  reset();
  gs=new GameState(pgs,utt);
  if (!AiInitialized)   initializeAI();
 else {
    ef.givePhysicalGameState(initialPgs);
    if (ef2 != null)     ef2.givePhysicalGameState(initialPgs);
  }
  if (Parameters.parameters.classParameter("String_Node_Str") != null) {
    enemySet=enemies.getAppropriateEnemy(MMNEAT.ea.currentGeneration());
  }
 else {
    enemySet=new ArrayList<>(1);
    enemySet.add(ai2);
  }
  ef.setNetwork(individual);
  if (CommonConstants.watch) {
    w=PhysicalGameStatePanel.newVisualizer(gs,MicroRTSUtility.WINDOW_LENGTH,MicroRTSUtility.WINDOW_LENGTH,false,PhysicalGameStatePanel.COLORSCHEME_BLACK);
  }
  double[][] fitnesses=new double[enemySet.size()][numObjectives()];
  double[][] others=new double[enemySet.size()][numOtherScores()];
  for (int i=0; i < enemySet.size(); i++) {
    reset();
    ai2=enemySet.get(i);
    if (CommonConstants.watch) {
      System.out.println("String_Node_Str" + ai2.getClass().getName());
    }
    ArrayList<Pair<double[],double[]>> currentEval=MicroRTSUtility.oneEval((AI)ai1,ai2,this,ff,w);
    ff.setNumEvals(ef.getNumEvals());
    fitnesses[i]=currentEval.get(0).t1;
    others[i]=currentEval.get(0).t2;
  }
  Pair<double[],double[]> averageResults;
  averageResults=NoisyLonerTask.averageResults(fitnesses,others);
  return averageResults;
}

Fixed version (ground truth):
/** 
 * all actions performed in a single evaluation of a genotype loop taken from GameVisualSimulationTest, the rest based on MsPacManTask.oneEval()
 * @param individual genotype to be evaluated
 * @param num which evaluation is currently being performed
 * @return Combination of fitness scores (multiobjective possible), andother scores (for tracking non-fitness data)
 */
@Override public Pair<double[],double[]> oneEval(Genotype<T> individual,int num){
}
Program: 39169
Project: 39169
Buggy source:
/** 
 * called before each evaluation. If a MapSequence is used, then the new map is loaded here. This order of events is required in order to make sure networks are displayed properly, because an agent's network is displayed before the oneEval method below is called. Therefore, the map gets set here, then the neural network is drawn in LonerTask, then the oneEval method below executes.
 */
public void preEval(){
  if (enemies == null) {
    try {
      enemies=(EnemySequence)ClassCreation.createObject(Parameters.parameters.classParameter("String_Node_Str"));
    }
 catch (    NoSuchMethodException e1) {
      e1.printStackTrace();
      System.exit(1);
    }
  }
  if (maps != null) {
    String newMapName=maps.getAppropriateMap(MMNEAT.ea.currentGeneration());
    if (!newMapName.equals(mapName)) {
      System.out.println("String_Node_Str" + newMapName);
      try {
        initialPgs=PhysicalGameState.load("String_Node_Str" + newMapName,utt);
        mapName=newMapName;
      }
 catch (      JDOMException|IOException e) {
        e.printStackTrace();
        System.exit(1);
      }
      ff.informOfMapSwitch();
    }
  }
}

Fixed version (ground truth):
/** 
 * called before each evaluation. If a MapSequence is used, then the new map is loaded here. This order of events is required in order to make sure networks are displayed properly, because an agent's network is displayed before the oneEval method below is called. Therefore, the map gets set here, then the neural network is drawn in LonerTask, then the oneEval method below executes.
 */
public void preEval(){
}
Program: 39171
Project: 39171
Buggy source:
@Override public ArrayList<AI> getAppropriateEnemy(int generation){
  if (growingSet) {
    if (generationOfLastUpdate != generation && generation % gensPerEnemy == 0 && appropriateEnemies.size() < enemies.length) {
      generationOfLastUpdate=generation;
      if (CommonConstants.watch)       System.out.println("String_Node_Str" + generation + "String_Node_Str"+ enemies[generation * gensPerEnemy]);
      appropriateEnemies.add(enemies[generation * gensPerEnemy]);
    }
    return appropriateEnemies;
  }
 else {
    appropriateEnemies=new ArrayList<>(1);
    appropriateEnemies.add(enemies[Math.min(generation / gensPerEnemy,enemies.length - 1)]);
  }
  return appropriateEnemies;
}

Fixed version (ground truth):
@Override public ArrayList<AI> getAppropriateEnemy(int generation){
  if (growingSet) {
    if (generationOfLastUpdate != generation && generation % gensPerEnemy == 0 && appropriateEnemies.size() < enemies.length) {
      generationOfLastUpdate=generation;
      if (CommonConstants.watch)       System.out.println("String_Node_Str" + generation + "String_Node_Str"+ enemies[generation / gensPerEnemy]);
      appropriateEnemies.add(enemies[generation / gensPerEnemy]);
    }
    return appropriateEnemies;
  }
 else {
    appropriateEnemies=new ArrayList<>(1);
    appropriateEnemies.add(enemies[Math.min(generation / gensPerEnemy,enemies.length - 1)]);
  }
  return appropriateEnemies;
}
Program: 39172
Project: 39172
Buggy source:
@Before public void setUp() throws Exception {
  hncg=new HyperNEATCPPNGenotype();
  ohg=new OffsetHybrIDGenotype(hncg.links,hncg.nodes,hncg.neuronsPerModule);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  Parameters.initializeParameterCollections(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  MMNEAT.loadClasses();
  hncg=new HyperNEATCPPNGenotype();
  ohg=new OffsetHybrIDGenotype(hncg.links,hncg.nodes,hncg.neuronsPerModule);
}
Program: 39173
Project: 39173
Buggy source:
@Test public void testAllOffsetsZero(){
  RealValuedGenotype rvg=new RealValuedGenotype(HyperNEATUtil.totalPossibleLinks(HyperNEATUtil.getHyperNEATTask()));
  for (int i=0; i < HyperNEATUtil.totalPossibleLinks(HyperNEATUtil.getHyperNEATTask()); i++) {
    rvg.setValue(i,0.0);
  }
  assertEquals(hncg.getPhenotype(),ohg.getPhenotype());
}

Fixed version (ground truth):
@Test public void testAllOffsetsZero(){
  for (int i=0; i < HyperNEATUtil.totalPossibleLinks(HyperNEATUtil.getHyperNEATTask()); i++) {
    ohg.rvg.setValue(i,0.0);
  }
  assertEquals(hncg.getPhenotype(),ohg.getPhenotype());
}
Program: 39174
Project: 39174
Buggy source:
/** 
 * Private Constructor solely used for Testing
 * @param newBoard
 * @param player
 * @param win3
 */
CheckersState(int[][] newBoard,int player,List<Integer> win){
  super(newBoard,2,player,win);
}

Fixed version (ground truth):
/** 
 * Private Constructor solely used for Testing
 * @param newBoard
 * @param player
 * @param win
 */
CheckersState(int[][] newBoard,int player,List<Integer> win){
  super(newBoard,2,player,win);
}
Program: 39175
Project: 39175
Buggy source:
/** 
 * Checks if a Player Check that just Jumped is able to Jump again
 * @param check Point on the Board of the Player Check
 * @return True if the Check is able to Jump again, else returns false
 */
private boolean checkDoubleJump(Point check){
  int checkX=(int)check.getX();
  int checkY=(int)check.getY();
  int thisCheck=boardState[checkX][checkY];
  for (int dX=-1; dX <= 1; dX++) {
    for (int dY=-1; dY <= 1; dY++) {
      if (dX != 0 && dY != 0) {
        Point moveTo=new Point(checkX + dX,checkY + dY);
        if (isPointInBounds(moveTo)) {
          if (thisCheck == BLACK_CHECK && dX > 0 && ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
 else           if (thisCheck == RED_CHECK && dX < 0 && ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
        }
 else {
          if (ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
        }
      }
    }
  }
  doubleJumpCheck=null;
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if a Player Check that just Jumped is able to Jump again
 * @param check Point on the Board of the Player Check
 * @return True if the Check is able to Jump again, else returns false
 */
private boolean checkDoubleJump(Point check){
  int checkX=(int)check.getX();
  int checkY=(int)check.getY();
  int thisCheck=boardState[checkX][checkY];
  for (int dX=-1; dX <= 1; dX++) {
    for (int dY=-1; dY <= 1; dY++) {
      if (dX != 0 && dY != 0) {
        Point moveTo=new Point(checkX + dX,checkY + dY);
        if (isPointInBounds(moveTo)) {
          if ((thisCheck == BLACK_CHECK_KING || thisCheck == RED_CHECK_KING) && ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
 else           if (thisCheck == BLACK_CHECK && dX > 0 && ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
 else           if (thisCheck == RED_CHECK && dX < 0 && ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
        }
      }
    }
  }
  doubleJumpCheck=null;
  return false;
}
Program: 39177
Project: 39177
Buggy source:
/** 
 * Returns true if the Game is over, else returns false
 * @return True if one Player has no more Checks, else returns false
 */
@Override public boolean endState(){
  int blackChecksLeft=0;
  int redChecksLeft=0;
  for (int i=0; i < BOARD_WIDTH; i++) {
    for (int j=0; j < BOARD_WIDTH; j++) {
      int space=boardState[i][j];
      if (space == BLACK_CHECK || space == BLACK_CHECK_KING) {
        blackChecksLeft++;
      }
 else       if (space == RED_CHECK || space == RED_CHECK_KING) {
        redChecksLeft++;
      }
    }
  }
  if (blackChecksLeft == 0 || redChecksLeft == 0) {
    return true;
  }
 else   if (possibleBoardGameStates(this).size() == 0) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true if the Game is over, else returns false
 * @return True if one Player has no more Checks, else returns false
 */
@Override public boolean endState(){
  int blackChecksLeft=0;
  int redChecksLeft=0;
  for (int i=0; i < BOARD_WIDTH; i++) {
    for (int j=0; j < BOARD_WIDTH; j++) {
      int space=boardState[i][j];
      if (space == BLACK_CHECK || space == BLACK_CHECK_KING) {
        blackChecksLeft++;
      }
 else       if (space == RED_CHECK || space == RED_CHECK_KING) {
        redChecksLeft++;
      }
    }
  }
  if (blackChecksLeft == 0 || redChecksLeft == 0) {
    return true;
  }
 else   if (possibleBoardGameStates(this).size() == 0) {
    winners.add((nextPlayer + 1) % 2);
    return true;
  }
 else   if (movesSinceLastJump > 50 && movesSinceNon_King > 50) {
    return true;
  }
  return false;
}
Program: 39178
Project: 39178
Buggy source:
@Override public void setupStartingBoard(){
  boardState=newCheckBoard();
  doubleJumpCheck=null;
}

Fixed version (ground truth):
@Override public void setupStartingBoard(){
  boardState=newCheckBoard();
  movesSinceLastJump=0;
  movesSinceNon_King=0;
  doubleJumpCheck=null;
}
Program: 39179
Project: 39179
Buggy source:
/** 
 * Makes and returns a BoardGameState that is a duplicate of this BoardGameState
 * @return BoardGameState that is a duplicate of this BoardGameState
 */
@SuppressWarnings("String_Node_Str") @Override public CheckersState copy(){
  return new CheckersState(this);
}

Fixed version (ground truth):
/** 
 * Makes and returns a BoardGameState that is a duplicate of this BoardGameState
 * @return BoardGameState that is a duplicate of this BoardGameState
 */
@SuppressWarnings("String_Node_Str") @Override public CheckersState copy(){
  CheckersState temp=new CheckersState(this);
  temp.movesSinceLastJump=this.movesSinceLastJump;
  temp.movesSinceNon_King=this.movesSinceNon_King;
  return temp;
}
Program: 39180
Project: 39180
Buggy source:
/** 
 * Returns the Index of the winner of the Game
 * @return -1 if not at an endState, 0 if there's a Tie, 1 if Player 1 wins, or 2 if Player 2 wins
 */
public List<Integer> getWinners(){
  if (endState()) {
    int blackChecksLeft=0;
    int redChecksLeft=0;
    for (int i=0; i < BOARD_WIDTH; i++) {
      for (int j=0; j < BOARD_WIDTH; j++) {
        int space=boardState[i][j];
        if (space == BLACK_CHECK || space == BLACK_CHECK_KING) {
          blackChecksLeft++;
        }
 else         if (space == RED_CHECK || space == RED_CHECK_KING) {
          redChecksLeft++;
        }
      }
    }
    if (blackChecksLeft > redChecksLeft) {
      winners.add(BLACK_CHECK);
    }
 else     if (redChecksLeft > blackChecksLeft) {
      winners.add(RED_CHECK);
    }
 else {
      winners.add(BLACK_CHECK);
      winners.add(RED_CHECK);
    }
  }
  return winners;
}

Fixed version (ground truth):
/** 
 * Returns the Index of the winner of the Game
 * @return -1 if not at an endState, 0 if there's a Tie, 1 if Player 1 wins, or 2 if Player 2 wins
 */
public List<Integer> getWinners(){
  if (endState() && winners.size() == 0) {
    int blackChecksLeft=0;
    int redChecksLeft=0;
    for (int i=0; i < BOARD_WIDTH; i++) {
      for (int j=0; j < BOARD_WIDTH; j++) {
        int space=boardState[i][j];
        if (space == BLACK_CHECK || space == BLACK_CHECK_KING) {
          blackChecksLeft++;
        }
 else         if (space == RED_CHECK || space == RED_CHECK_KING) {
          redChecksLeft++;
        }
      }
    }
    if (blackChecksLeft > redChecksLeft) {
      winners.add(BLACK_CHECK);
    }
 else     if (redChecksLeft > blackChecksLeft) {
      winners.add(RED_CHECK);
    }
 else {
      winners.add(BLACK_CHECK);
      winners.add(RED_CHECK);
    }
  }
  return winners;
}
Program: 39181
Project: 39181
Buggy source:
@Override public T takeAction(T current){
  Set<T> poss=current.possibleBoardGameStates(current);
  T move=null;
  do {
    move=getInput(current);
    if (!poss.contains(move))     System.out.println("String_Node_Str");
  }
 while (!poss.contains(move));
  boardView.reset(move);
  try {
    Thread.sleep(350);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  return move;
}

Fixed version (ground truth):
@Override public T takeAction(T current){
  Set<T> poss=current.possibleBoardGameStates(current);
  T move=null;
  do {
    move=getInput(current);
    if (!poss.contains(move))     System.out.println("String_Node_Str");
  }
 while (!poss.contains(move));
  boardView.reset(move);
  try {
    Thread.sleep(75);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  return move;
}
Program: 39182
Project: 39182
Buggy source:
private void waitForClick(){
  ready=false;
  while (!ready) {
    try {
      Thread.sleep(300);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void waitForClick(){
  ready=false;
  while (!ready) {
    try {
      Thread.sleep(75);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}
Program: 39183
Project: 39183
Buggy source:
/** 
 * Checks if a Player Check that just Jumped is able to Jump again
 * @param check Point on the Board of the Player Check
 * @return True if the Check is able to Jump again, else returns false
 */
private boolean checkDoubleJump(Point check){
  int checkX=(int)check.getX();
  int checkY=(int)check.getY();
  int thisCheck=boardState[checkX][checkY];
  for (int dX=-1; dX <= 1; dX++) {
    for (int dY=-1; dY <= 1; dY++) {
      if (dX != 0 && dY != 0) {
        Point moveTo=new Point((int)check.getX() + dX,(int)check.getY() + dY);
        if (isPointInBounds(moveTo)) {
          if (thisCheck == BLACK_CHECK && dX > 0) {
            if (ableToJump(check,moveTo))             return true;
          }
 else           if (thisCheck == RED_CHECK && dX < 0) {
            if (ableToJump(check,moveTo))             return true;
          }
 else {
            if (ableToJump(check,moveTo))             return true;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if a Player Check that just Jumped is able to Jump again
 * @param check Point on the Board of the Player Check
 * @return True if the Check is able to Jump again, else returns false
 */
private boolean checkDoubleJump(Point check){
  int checkX=(int)check.getX();
  int checkY=(int)check.getY();
  int thisCheck=boardState[checkX][checkY];
  for (int dX=-1; dX <= 1; dX++) {
    for (int dY=-1; dY <= 1; dY++) {
      if (dX != 0 && dY != 0) {
        Point moveTo=new Point(checkX + dX,checkY + dY);
        if (isPointInBounds(moveTo)) {
          if (thisCheck == BLACK_CHECK && dX > 0 && ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
 else           if (thisCheck == RED_CHECK && dX < 0 && ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
        }
 else {
          if (ableToJump(check,moveTo)) {
            doubleJumpCheck=check;
            return true;
          }
        }
      }
    }
  }
  doubleJumpCheck=null;
  return false;
}
Program: 39184
Project: 39184
Buggy source:
/** 
 * Checks if a Move is valid
 * @param moveThis Point on the Board of the Check being Moved
 * @param moveTo Point on the Board being Moved to
 * @return True if the Move is valid, else returns false
 */
private boolean checkMovement(Point moveThis,Point moveTo){
  int dX=(int)(moveTo.getX() - moveThis.getX());
  int dY=(int)(moveTo.getY() - moveThis.getY());
  int thisCheck=boardState[(int)moveThis.getX()][(int)moveThis.getY()];
  if (thisCheck == EMPTY) {
    return false;
  }
 else   if (nextPlayer == BLACK_CHECK && (thisCheck == RED_CHECK || thisCheck == RED_CHECK_KING)) {
    return false;
  }
 else   if (nextPlayer == RED_CHECK && (thisCheck == BLACK_CHECK || thisCheck == BLACK_CHECK_KING)) {
    return false;
  }
  if (thisCheck == BLACK_CHECK && dX < 0) {
    return false;
  }
 else   if (thisCheck == RED_CHECK && dX > 0) {
    return false;
  }
  if (!((int)Math.abs(dX) == 1 && (int)Math.abs(dY) == 1)) {
    return false;
  }
  if (doubleJumpCheck != null) {
    if ((int)moveThis.getX() != (int)doubleJumpCheck.getX() || (int)moveThis.getY() != (int)doubleJumpCheck.getY())     return false;
  }
  if (checkDoubleJump(moveThis) && !ableToJump(moveThis,moveTo))   return false;
  if (boardState[(int)moveTo.getX()][(int)moveTo.getY()] == EMPTY) {
    return true;
  }
 else {
    return ableToJump(moveThis,moveTo);
  }
}

Fixed version (ground truth):
/** 
 * Checks if a Move is valid
 * @param moveThis Point on the Board of the Check being Moved
 * @param moveTo Point on the Board being Moved to
 * @return True if the Move is valid, else returns false
 */
private boolean checkMovement(Point moveThis,Point moveTo){
  int dX=(int)(moveTo.getX() - moveThis.getX());
  int dY=(int)(moveTo.getY() - moveThis.getY());
  int thisCheck=boardState[(int)moveThis.getX()][(int)moveThis.getY()];
  if (thisCheck == EMPTY) {
    return false;
  }
 else   if (nextPlayer == BLACK_CHECK && (thisCheck == RED_CHECK || thisCheck == RED_CHECK_KING)) {
    return false;
  }
 else   if (nextPlayer == RED_CHECK && (thisCheck == BLACK_CHECK || thisCheck == BLACK_CHECK_KING)) {
    return false;
  }
  if (thisCheck == BLACK_CHECK && dX < 0) {
    return false;
  }
 else   if (thisCheck == RED_CHECK && dX > 0) {
    return false;
  }
  if (!((int)Math.abs(dX) == 1 && (int)Math.abs(dY) == 1)) {
    return false;
  }
  if (checkForcedJump().size() > 0 && !checkForcedJump().contains(moveThis))   return false;
  if (doubleJumpCheck != null) {
    if ((int)moveThis.getX() != (int)doubleJumpCheck.getX() || (int)moveThis.getY() != (int)doubleJumpCheck.getY())     return false;
  }
  if (boardState[(int)moveTo.getX()][(int)moveTo.getY()] == EMPTY) {
    return true;
  }
 else {
    return ableToJump(moveThis,moveTo);
  }
}
Program: 39187
Project: 39187
Buggy source:
/** 
 * Calls action associated with clicking a certain button - in this case, the button plays a MIDI file with the most recently clicked CPPN as the "instrument"
 */
protected void respondToClick(int itemID){
  boolean justStopped=false;
  if (midiPlay.isPlaying()) {
    midiPlay.stopPlayback();
    justStopped=true;
  }
  super.respondToClick(itemID);
  if (itemID == (CHECKBOX_IDENTIFIER_START - inputMultipliers.length)) {
    System.out.println("String_Node_Str" + (CHECKBOX_IDENTIFIER_START - inputMultipliers.length));
    System.out.println("String_Node_Str" + FILE_LOADER_CHECKBOX_INDEX);
    if (!justStopped) {
      midiPlay=MIDIUtil.playMIDIWithCPPNFromString(Parameters.parameters.stringParameter("String_Node_Str"),currentCPPN);
    }
  }
  super.respondToClick(itemID);
  if (itemID == FILE_LOADER_CHECKBOX_INDEX) {
    JFileChooser chooser=new JFileChooser();
    chooser.setApproveButtonText("String_Node_Str");
    FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str");
    chooser.setFileFilter(filter);
    int returnVal=chooser.showOpenDialog(frame);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      Parameters.parameters.setString("String_Node_Str",chooser.getCurrentDirectory() + "String_Node_Str" + chooser.getSelectedFile().getName());
    }
    resetButtons();
  }
}

Fixed version (ground truth):
/** 
 * Calls action associated with clicking a certain button - in this case, the button plays a MIDI file with the most recently clicked CPPN as the "instrument"
 */
protected void respondToClick(int itemID){
  boolean justStopped=false;
  if (midiPlay.isPlaying()) {
    midiPlay.stopPlayback();
    justStopped=true;
  }
  super.respondToClick(itemID);
  if (itemID == (CHECKBOX_IDENTIFIER_START - inputMultipliers.length)) {
    if (!justStopped) {
      midiPlay=MIDIUtil.playMIDIWithCPPNFromString(Parameters.parameters.stringParameter("String_Node_Str"),currentCPPN);
    }
  }
  if (itemID == FILE_LOADER_CHECKBOX_INDEX) {
    JFileChooser chooser=new JFileChooser();
    chooser.setApproveButtonText("String_Node_Str");
    FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str");
    chooser.setFileFilter(filter);
    int returnVal=chooser.showOpenDialog(frame);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      Parameters.parameters.setString("String_Node_Str",chooser.getCurrentDirectory() + "String_Node_Str" + chooser.getSelectedFile().getName());
    }
    resetButtons();
  }
}
Program: 39188
Project: 39188
Buggy source:
protected void respondToClick(int itemID){
  super.respondToClick(itemID);
  if (arrayPlayer != null && arrayPlayer.isPlaying()) {
    arrayPlayer.stopPlayback();
  }
 else   if (itemID == (CHECKBOX_IDENTIFIER_START - inputMultipliers.length - 1)) {
    arrayPlayer=PlayDoubleArray.playDoubleArray(format,WAVDoubleArray);
  }
}

Fixed version (ground truth):
protected void respondToClick(int itemID){
  super.respondToClick(itemID);
  if (arrayPlayer != null && arrayPlayer.isPlaying()) {
    arrayPlayer.stopPlayback();
  }
 else   if (itemID == (CHECKBOX_IDENTIFIER_START - inputMultipliers.length - 1)) {
    arrayPlayer=PlayDoubleArray.playDoubleArray(format,WAVDoubleArray);
  }
  if (itemID == FILE_LOADER_CHECKBOX_INDEX) {
    JFileChooser chooser=new JFileChooser();
    chooser.setApproveButtonText("String_Node_Str");
    FileNameExtensionFilter filter=new FileNameExtensionFilter("String_Node_Str","String_Node_Str");
    chooser.setFileFilter(filter);
    int returnVal=chooser.showOpenDialog(frame);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      Parameters.parameters.setString("String_Node_Str",chooser.getCurrentDirectory() + "String_Node_Str" + chooser.getSelectedFile().getName());
    }
    resetButtons();
  }
}
Program: 39189
Project: 39189
Buggy source:
/** 
 * represents all squares of the gameState in an array
 */
protected double[] gameStateToArray(GameState gs){
  pgs=gs.getPhysicalGameState();
  double[] board=new double[pgs.getHeight() * pgs.getWidth()];
  int boardIndex;
  Unit currentUnit;
  for (int i=0; i < pgs.getWidth(); i++) {
    for (int j=0; j < pgs.getHeight(); j++) {
      boardIndex=i * pgs.getWidth() + j;
      currentUnit=pgs.getUnitAt(i,j);
      if (currentUnit != null) {
switch (currentUnit.getType().name) {
case "String_Node_Str":
          board[boardIndex]=WORKER_WEIGHT + (WORKER_RESOURCE_WEIGHT * currentUnit.getResources());
        break;
case "String_Node_Str":
      board[boardIndex]=LIGHT_WEIGHT;
    break;
case "String_Node_Str":
  board[boardIndex]=HEAVY_WEIGHT;
break;
case "String_Node_Str":
board[boardIndex]=RANGED_WEIGHT;
break;
case "String_Node_Str":
board[boardIndex]=BASE_WEIGHT + (BASE_RESOURCE_WEIGHT * currentUnit.getResources());
break;
case "String_Node_Str":
board[boardIndex]=BARRACKS_WEIGHT;
break;
case "String_Node_Str":
board[boardIndex]=RAW_RESOURCE_WEIGHT;
break;
default :
break;
}
if (currentUnit.getPlayer() == 1) board[boardIndex]*=-1;
}
}
}
return board;
}

Fixed version (ground truth):
/** 
 * represents all squares of the gameState in an array
 */
protected double[] gameStateToArray(GameState gs){
  pgs=gs.getPhysicalGameState();
  double[] board=new double[pgs.getHeight() * pgs.getWidth()];
  int boardIndex;
  Unit currentUnit;
  for (int j=0; j < pgs.getHeight(); j++) {
    for (int i=0; i < pgs.getWidth(); i++) {
      boardIndex=i + j * pgs.getHeight();
      currentUnit=pgs.getUnitAt(i,j);
      if (currentUnit != null) {
switch (currentUnit.getType().name) {
case "String_Node_Str":
          board[boardIndex]=WORKER_WEIGHT + (WORKER_RESOURCE_WEIGHT * currentUnit.getResources());
        break;
case "String_Node_Str":
      board[boardIndex]=LIGHT_WEIGHT;
    break;
case "String_Node_Str":
  board[boardIndex]=HEAVY_WEIGHT;
break;
case "String_Node_Str":
board[boardIndex]=RANGED_WEIGHT;
break;
case "String_Node_Str":
board[boardIndex]=BASE_WEIGHT + (BASE_RESOURCE_WEIGHT * currentUnit.getResources());
break;
case "String_Node_Str":
board[boardIndex]=BARRACKS_WEIGHT;
break;
case "String_Node_Str":
board[boardIndex]=RAW_RESOURCE_WEIGHT;
break;
default :
break;
}
if (currentUnit.getPlayer() == 1) board[boardIndex]*=-1;
}
}
}
return board;
}
Program: 39190
Project: 39190
Buggy source:
@Override public String[] getOtherScores(){
  return null;
}

Fixed version (ground truth):
@Override public String[] getOtherScores(){
  return new String[0];
}
Program: 39193
Project: 39193
Buggy source:
/** 
 * uses information collected over time in MicroRTSUtility.oneEval
 */
@Override public ArrayList<Pair<double[],double[]>> getFitness(GameState gs){
  ArrayList<Pair<double[],double[]>> result=new ArrayList<>();
  double[] fitness=new double[]{normalize(task.getHarvestingEfficiency(1),maxCycles * task.getResourceGainValue()),normalize(task.getBaseUpTime(1),maxCycles),normalize(task.getAverageUnitDifference(),pgs.getHeight() * pgs.getWidth()) + 1};
  double[] opponentFitness=new double[fitness.length];
  if (coevolution) {
    opponentFitness[0]=normalize(task.getHarvestingEfficiency(2),maxCycles * task.getResourceGainValue());
    opponentFitness[1]=normalize(task.getBaseUpTime(2),maxCycles);
    opponentFitness[2]=fitness[2] * -1;
  }
  int winner=gs.winner();
  double[] other=new double[]{winner + 1 % 2,gs.getTime(),mapSwitches};
  Pair<double[],double[]> data1=new Pair<double[],double[]>(fitness,other);
  Pair<double[],double[]> data2=new Pair<double[],double[]>(fitness,other);
  result.add(data1);
  result.add(data2);
  return result;
}

Fixed version (ground truth):
/** 
 * uses information collected over time in MicroRTSUtility.oneEval
 */
@Override public ArrayList<Pair<double[],double[]>> getFitness(GameState gs){
  ArrayList<Pair<double[],double[]>> result=new ArrayList<>();
  double[] fitness=new double[]{normalize(task.getHarvestingEfficiency(1),maxCycles * task.getResourceGainValue()),normalize(task.getBaseUpTime(1),maxCycles),normalize(task.getAverageUnitDifference(),pgs.getHeight() * pgs.getWidth()) + 1};
  double[] opponentFitness=new double[fitness.length];
  if (coevolution) {
    opponentFitness[0]=normalize(task.getHarvestingEfficiency(2),maxCycles * task.getResourceGainValue());
    opponentFitness[1]=normalize(task.getBaseUpTime(2),maxCycles);
    opponentFitness[2]=fitness[2] * -1;
  }
  int winner=gs.winner();
  double[] other=new double[]{(winner == 1 ? -1 : winner + 1),gs.getTime(),mapSwitches};
  Pair<double[],double[]> data1=new Pair<double[],double[]>(fitness,other);
  Pair<double[],double[]> data2=new Pair<double[],double[]>(fitness,other);
  result.add(data1);
  result.add(data2);
  return result;
}
Program: 39194
Project: 39194
Buggy source:
public static void newMIDIUtilPlay(Network cppn) throws InvalidMidiDataException, IOException {
  File midiFile=new File(FUR_ELISE_MID);
  Sequence sequence=MidiSystem.getSequence(midiFile);
  Track[] tracks=sequence.getTracks();
  Track track=tracks[1];
  ArrayList<Triple<ArrayList<Double>,ArrayList<Long>,ArrayList<Long>>> midiLists=MIDIUtil.soundLines2(track);
  for (int i=0; i < midiLists.size(); i++) {
    double[] test=MIDIUtil.lineToAmplitudeArray(FUR_ELISE_MID,midiLists.get(i).t1,midiLists.get(i).t2,midiLists.get(i).t3,cppn);
    System.out.println(test.length);
    ArrayUtil.printArrayRange(test,800,1200);
    PlayDoubleArray.playDoubleArray(test);
    MiscUtil.waitForReadStringAndEnterKeyPress();
  }
}

Fixed version (ground truth):
public static void newMIDIUtilPlay(Network cppn) throws InvalidMidiDataException, IOException {
  File midiFile=new File(FUR_ELISE_MID);
  Sequence sequence=MidiSystem.getSequence(midiFile);
  Track[] tracks=sequence.getTracks();
  Track track=tracks[1];
  ArrayList<Triple<ArrayList<Double>,ArrayList<Long>,ArrayList<Long>>> midiLists=MIDIUtil.soundLines2(track);
  for (int i=0; i < midiLists.size(); i++) {
    double[] test=MIDIUtil.lineToAmplitudeArray(FUR_ELISE_MID,midiLists.get(i).t1,midiLists.get(i).t2,midiLists.get(i).t3,cppn);
    System.out.println(test.length);
    ArrayUtil.printArrayRange(test,800,1200);
    PlayDoubleArray.playDoubleArray(test);
  }
}
Program: 39195
Project: 39195
Buggy source:
/** 
 * Returns true if the Game is over, else returns false
 * @return True if one Player has no more Checks, else returns false
 */
@Override public boolean endState(){
  int blackChecksLeft=0;
  int redChecksLeft=0;
  for (int i=0; i < BOARD_WIDTH; i++) {
    for (int j=0; j < BOARD_WIDTH; j++) {
      int space=boardState[i][j];
      if (space == BLACK_CHECK || space == BLACK_CHECK_KING) {
        blackChecksLeft++;
      }
 else       if (space == RED_CHECK || space == RED_CHECK_KING) {
        redChecksLeft++;
      }
    }
  }
  return blackChecksLeft == 0 || redChecksLeft == 0;
}

Fixed version (ground truth):
/** 
 * Returns true if the Game is over, else returns false
 * @return True if one Player has no more Checks, else returns false
 */
@Override public boolean endState(){
  int blackChecksLeft=0;
  int redChecksLeft=0;
  for (int i=0; i < BOARD_WIDTH; i++) {
    for (int j=0; j < BOARD_WIDTH; j++) {
      int space=boardState[i][j];
      if (space == BLACK_CHECK || space == BLACK_CHECK_KING) {
        blackChecksLeft++;
      }
 else       if (space == RED_CHECK || space == RED_CHECK_KING) {
        redChecksLeft++;
      }
    }
  }
  if (blackChecksLeft == 0 || redChecksLeft == 0)   return true;
  return (possibleBoardGameStates(this).size() == 0);
}
Program: 39196
Project: 39196
Buggy source:
private static void updateHarvestingEfficiency(Unit u,boolean coevolution,MicroRTSInformation task){
  int id=(int)u.getID();
  int player=u.getPlayer() + 1;
  if ((u.getPlayer() == 0 || coevolution) && u.getResources() >= 1 && !workerWithResourceID.contains(id))   workerWithResourceID.add(id);
 else   if (u.getResources() <= 0 && workerWithResourceID.contains(id)) {
    workerWithResourceID.remove(id);
    task.setHarvestingEfficiency(task.getHarvestingEfficiency(player) + 1,player);
  }
}

Fixed version (ground truth):
private static void updateHarvestingEfficiency(Unit u,boolean coevolution,MicroRTSInformation task){
  int id=(int)u.getID();
  int player=u.getPlayer() + 1;
  if ((u.getPlayer() == 0 || coevolution) && u.getResources() >= 1 && !workerWithResourceID.contains(id))   workerWithResourceID.add(id);
 else   if (u.getResources() <= 0 && workerWithResourceID.contains(id)) {
    workerWithResourceID.remove(workerWithResourceID.indexOf(id));
    task.setHarvestingEfficiency(task.getHarvestingEfficiency(player) + 1,player);
  }
}
Program: 39198
Project: 39198
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public ArrayList<Pair<double[],double[]>> evaluateGroup(ArrayList<Genotype<T>> group){
  HeuristicBoardGamePlayer[] players=new HeuristicBoardGamePlayer[group.size()];
  int index=0;
  for (  Genotype<T> gene : group) {
    HeuristicBoardGamePlayer evolved=players[index];
    evolved.setHeuristic((new NNBoardGameHeuristic(gene.getPhenotype())));
    players[index++]=evolved;
  }
  return BoardGameUtil.playGame(MMNEAT.boardGame,players);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public ArrayList<Pair<double[],double[]>> evaluateGroup(ArrayList<Genotype<T>> group){
  HeuristicBoardGamePlayer[] players=new HeuristicBoardGamePlayer[group.size()];
  int index=0;
  for (  Genotype<T> gene : group) {
    HeuristicBoardGamePlayer evolved=players[index];
    evolved.setHeuristic((new NNBoardGameHeuristic(gene.getPhenotype(),featExtract)));
    players[index++]=evolved;
  }
  return BoardGameUtil.playGame(MMNEAT.boardGame,players);
}
Program: 39199
Project: 39199
Buggy source:
/** 
 * Evaluates a given individual network's Fitness; If the CommonConstants Watch variable is set to "True," runs a visual evaluation, Else runs a non-visual evaluation
 * @param individual Genotype<T> specifying a Network to be evaluated
 * @param num Integer value
 * @return Pair of Double Arrays that show the Fitness of an individual network
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Pair<double[],double[]> oneEval(Genotype<T> individual,int num){
  player.setHeuristic((new NNBoardGameHeuristic(individual.getPhenotype())));
  BoardGamePlayer[] players=new BoardGamePlayer[]{player,opponent};
  return BoardGameUtil.playGame(MMNEAT.boardGame,players).get(0);
}

Fixed version (ground truth):
/** 
 * Evaluates a given individual network's Fitness; If the CommonConstants Watch variable is set to "True," runs a visual evaluation, Else runs a non-visual evaluation
 * @param individual Genotype<T> specifying a Network to be evaluated
 * @param num Integer value
 * @return Pair of Double Arrays that show the Fitness of an individual network
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Pair<double[],double[]> oneEval(Genotype<T> individual,int num){
  player.setHeuristic((new NNBoardGameHeuristic(individual.getPhenotype(),featExtract)));
  BoardGamePlayer[] players=new BoardGamePlayer[]{player,opponent};
  return BoardGameUtil.playGame(MMNEAT.boardGame,players).get(0);
}
Program: 39200
Project: 39200
Buggy source:
public static List<Pair<String,String>> getSubstrateConnectivity(PhysicalGameState pgs){
  ArrayList<Pair<String,String>> conn=new ArrayList<Pair<String,String>>();
  if (Parameters.parameters.booleanParameter("String_Node_Str")) {
    conn.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
  }
 else {
  }
  conn.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
  if (Parameters.parameters.booleanParameter("String_Node_Str")) {
    if (Parameters.parameters.booleanParameter("String_Node_Str")) {
    }
 else {
      conn.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
    }
  }
  return conn;
}

Fixed version (ground truth):
public static List<Pair<String,String>> getSubstrateConnectivity(PhysicalGameState pgs){
  ArrayList<Pair<String,String>> conn=new ArrayList<Pair<String,String>>();
  if (Parameters.parameters.booleanParameter("String_Node_Str")) {
  }
 else {
    conn.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
  }
  conn.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
  if (Parameters.parameters.booleanParameter("String_Node_Str")) {
    if (Parameters.parameters.booleanParameter("String_Node_Str")) {
    }
 else {
      conn.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
    }
  }
  return conn;
}
Program: 39201
Project: 39201
Buggy source:
/** 
 * Takes in block information to erase the mobile piece from the observation tetris state, so that no collisions occur
 * @param ts TetrisState
 */
public static void blotMobilePiece(TetrisState ts){
  Vector<TetrisPiece> possibleBlocks=ts.possibleBlocks;
  int[][] mobilePiece=possibleBlocks.get(ts.currentBlockId).getShape(ts.currentRotation);
  for (int x=0; x < mobilePiece.length; x++) {
    for (int y=0; y < mobilePiece[x].length; y++) {
      if (mobilePiece[x][y] != 0) {
        int linearIndex=(ts.currentY + y) * TetrisState.worldWidth + (ts.currentX + x);
        if (linearIndex < 0) {
          System.err.printf("String_Node_Str",linearIndex,ts.currentX,x,ts.currentY,y);
          Thread.dumpStack();
          System.exit(1);
        }
        ts.worldState[linearIndex]=0;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Takes in block information to erase the mobile piece from the observation tetris state, so that no collisions occur
 * @param ts TetrisState
 */
public static void blotMobilePiece(TetrisState ts){
  Vector<TetrisPiece> possibleBlocks=TetrisState.POSSIBLE_BLOCKS;
  int[][] mobilePiece=possibleBlocks.get(ts.currentBlockId).getShape(ts.currentRotation);
  for (int x=0; x < mobilePiece.length; x++) {
    for (int y=0; y < mobilePiece[x].length; y++) {
      if (mobilePiece[x][y] != 0) {
        int linearIndex=(ts.currentY + y) * TetrisState.worldWidth + (ts.currentX + x);
        if (linearIndex < 0) {
          System.err.printf("String_Node_Str",linearIndex,ts.currentX,x,ts.currentY,y);
          Thread.dumpStack();
          System.exit(1);
        }
        ts.worldState[linearIndex]=0;
      }
    }
  }
}