nus-yam/ex-repair huggingface dataset:
Program: 3202
Project: 3202
Buggy source:
@Test public void testCreateNodeAndOCM() throws Exception {
  try {
    Node root=session.getRootNode();
    Node hello=root.addNode("String_Node_Str","String_Node_Str");
    hello.setProperty("String_Node_Str","String_Node_Str");
    Node hello2=root.getNode("String_Node_Str");
    BasicNode bn=nodeConverter.nodeToObject(hello2,BasicNode.class);
    Assert.assertEquals("String_Node_Str",bn.getValue());
    Node hello3=root.addNode("String_Node_Str","String_Node_Str");
    session.save();
    BasicNode bn3=new BasicNode();
    bn3.setValue("String_Node_Str");
    Node hello3b=root.getNode("String_Node_Str");
    nodeConverter.objectToNode(bn3,hello3b);
    Assert.assertEquals(hello3b.getProperty("String_Node_Str").getString(),bn3.getValue());
  }
  finally {
    session.logout();
  }
}

Fixed version (ground truth):
@Test public void testCreateNodeAndOCM() throws Exception {
  try {
    Node root=session.getRootNode();
    Node hello=root.addNode("String_Node_Str","String_Node_Str");
    hello.setProperty("String_Node_Str","String_Node_Str");
    hello.setProperty("String_Node_Str","String_Node_Str");
    Node hello2=root.getNode("String_Node_Str");
    BasicNode bn=nodeConverter.nodeToObject(hello2,BasicNode.class);
    Assert.assertEquals("String_Node_Str",bn.getValue());
    Assert.assertEquals("String_Node_Str",bn.getLordy());
    Node hello3=root.addNode("String_Node_Str","String_Node_Str");
    session.save();
    BasicNode bn3=new BasicNode();
    bn3.setValue("String_Node_Str");
    Node hello3b=root.getNode("String_Node_Str");
    nodeConverter.objectToNode(bn3,hello3b);
    Assert.assertEquals(hello3b.getProperty("String_Node_Str").getString(),bn3.getValue());
  }
  finally {
    session.logout();
  }
}
Program: 3203
Project: 3203
Buggy source:
@Test public void testRun(){
  OCMMappingStore ocmMappingStore=extension.getOCMMappingStore();
  OCMMapping mapping=ocmMappingStore.findMapping(BasicNode.class);
  Assert.assertNotNull(mapping);
  Assert.assertEquals(2,mapping.getFieldsToProperties().size());
  String result=mapping.getFieldsToProperties().get("String_Node_Str");
  Assert.assertEquals("String_Node_Str",result);
  String uuid=mapping.getFieldsToProperties().get("String_Node_Str");
  Assert.assertEquals("String_Node_Str",uuid);
}

Fixed version (ground truth):
@Test public void testRun(){
  OCMMappingStore ocmMappingStore=extension.getOCMMappingStore();
  OCMMapping mapping=ocmMappingStore.findMapping(BasicNode.class);
  Assert.assertNotNull(mapping);
  Assert.assertEquals(3,mapping.getFieldsToProperties().size());
  String result=mapping.getFieldsToProperties().get("String_Node_Str");
  Assert.assertEquals("String_Node_Str",result);
  String uuid=mapping.getFieldsToProperties().get("String_Node_Str");
  Assert.assertEquals("String_Node_Str",uuid);
  String notaproperty=mapping.getFieldsToProperties().get("String_Node_Str");
  Assert.assertEquals("String_Node_Str",notaproperty);
}
Program: 3204
Project: 3204
Buggy source:
public static void run(InputStream is,boolean isZip) throws Exception {
  init(is,isZip);
  instCount=0;
  maxInstructions=Long.parseLong(Settings.get(Settings.CORE_MAX_INSTRUCTIONS));
  if (Settings.isSet(Settings.SAVE_PATH)) {
    InputStream saveStream=Util.getStreamFromUrl(Settings.get(Settings.SAVE_PATH));
    if (saveStream != null) {
      mem.loadSram(saveStream);
    }
  }
  if (Settings.get(Settings.SAVE_PATH) != null) {
    File save=new File(Settings.get(Settings.SAVE_PATH));
    if (save != null) {
      mem.loadSram(new FileInputStream(save));
    }
  }
  if (Log.instruction.enabled() && Settings.get(Settings.CPU_ALT_DEBUG) == "String_Node_Str") {
    Log.instruction("String_Node_Str");
    Log.instruction("String_Node_Str");
    Log.instruction("String_Node_Str");
  }
  timeBegin=new Date().getTime();
  cycle(maxInstructions);
  timeEnd=new Date().getTime();
  running=false;
  System.out.println("String_Node_Str" + ((timeEnd - timeBegin) / 1000) + "String_Node_Str");
  System.out.println("String_Node_Str" + instCount);
  System.out.println("String_Node_Str" + Timing.getCycles());
  System.out.println("String_Node_Str" + (((Timing.getCycles() + 0f) / ((timeEnd - timeBegin + 0f) / 1000f)) / (1024f * 1024f)) + "String_Node_Str");
  System.out.println("String_Node_Str" + (((Timing.getCycles() + 0f) / ((timeEnd - timeBegin + 0f) / 1000f))) + "String_Node_Str");
  printMMaps();
  PPU.dumpVRAM();
  mem.dumpWRAM();
  APUMemory.dump();
  renderScreen();
}

Fixed version (ground truth):
public static void run(InputStream is,boolean isZip) throws Exception {
  init(is,isZip);
  instCount=0;
  maxInstructions=Long.parseLong(Settings.get(Settings.CORE_MAX_INSTRUCTIONS));
  if (Settings.isSet(Settings.SAVE_PATH)) {
    InputStream saveStream=Util.getStreamFromUrl(Settings.get(Settings.SAVE_PATH));
    if (saveStream != null) {
      mem.loadSram(saveStream);
    }
  }
  if (Log.instruction.enabled() && Settings.get(Settings.CPU_ALT_DEBUG) == "String_Node_Str") {
    Log.instruction("String_Node_Str");
    Log.instruction("String_Node_Str");
    Log.instruction("String_Node_Str");
  }
  timeBegin=new Date().getTime();
  cycle(maxInstructions);
  timeEnd=new Date().getTime();
  running=false;
  System.out.println("String_Node_Str" + ((timeEnd - timeBegin) / 1000) + "String_Node_Str");
  System.out.println("String_Node_Str" + instCount);
  System.out.println("String_Node_Str" + Timing.getCycles());
  System.out.println("String_Node_Str" + (((Timing.getCycles() + 0f) / ((timeEnd - timeBegin + 0f) / 1000f)) / (1024f * 1024f)) + "String_Node_Str");
  System.out.println("String_Node_Str" + (((Timing.getCycles() + 0f) / ((timeEnd - timeBegin + 0f) / 1000f))) + "String_Node_Str");
  printMMaps();
  PPU.dumpVRAM();
  mem.dumpWRAM();
  APUMemory.dump();
  renderScreen();
}
Program: 3206
Project: 3206
Buggy source:
/** 
 * From anomie's doc
 * @param a
 * @return
 */
private int m7Clip(int a){
  if ((a & 0x2000) != 0) {
    return a | (~0x3ff);
  }
 else {
    return a & 0x3ff;
  }
}

Fixed version (ground truth):
/** 
 * 13 bit sign extend; ported from bsnes
 */
private int m7Clip(int a){
  if ((a & 0x2000) != 0) {
    return a | (~0x3ff);
  }
 else {
    return a & 0x3ff;
  }
}
Program: 3207
Project: 3207
Buggy source:
/** 
 * Calculates the address of the current tile using x and y and loads it into tile. Also processes some attributes of the current tile.
 */
public void loadTile(){
  xTilePos=x / tileWidth;
  yTilePos=y / tileHeight;
  tile=cacheTilemap[xTilePos][yTilePos];
  if (tile == 0)   tile=cacheTilemap[xTilePos][yTilePos]=PPU.vram[tileMapAddress] | (PPU.vram[tileMapAddress + 1] << 8);
  pixelY=y % tileHeight;
  if ((tile & 0x8000) != 0) {
    pixelY=tileHeight - pixelY - 1;
  }
  tilePaletteOffset=getPaletteOffset();
  curPriority=(((tile >> 13) & 1) != 0 ? priority1 : priority0);
}

Fixed version (ground truth):
/** 
 * Calculates the address of the current tile using x and y and loads it into tile. Also processes some attributes of the current tile.
 */
public void loadTile(){
  xTilePos=x / tileWidth;
  yTilePos=y / tileHeight;
  tile=cacheTilemap[xTilePos][yTilePos];
  pixelY=y % tileHeight;
  if ((tile & 0x8000) != 0) {
    pixelY=tileHeight - pixelY - 1;
  }
  tilePaletteOffset=getPaletteOffset();
  curPriority=(((tile >> 13) & 1) != 0 ? priority1 : priority0);
}
Program: 3208
Project: 3208
Buggy source:
void rebuildTilemap(int addr){
  if (addr >= tileMapAddress + 0x2000) {
    return;
  }
  int origAddr=addr;
  addr-=(addr % 2);
  int taddr=addr;
  int tileX=0;
  int tileY=0;
  addr-=tileMapAddress;
switch (size) {
case bg32x32:
    break;
case bg32x64:
  if (addr >= 0x800) {
    tileY+=32;
    addr-=0x0800;
  }
break;
case bg64x32:
if (addr >= 0x800) {
tileX+=32;
addr-=0x0800;
}
break;
case bg64x64:
if (addr >= 0x1800) {
tileX+=32;
tileY+=32;
addr-=0x1800;
}
 else if (addr >= 0x1000) {
tileY+=32;
addr-=0x1000;
}
 else if (addr >= 0x0800) {
tileX+=32;
addr-=0x0800;
}
break;
}
tileY+=addr / 64;
addr%=64;
tileX+=addr / 2;
cacheTilemap[tileX][tileY]=PPU.vram[taddr] | (PPU.vram[taddr + 1] << 8);
}

Fixed version (ground truth):
void rebuildTilemap(int addr){
  addr-=(addr % 2);
  int taddr=addr;
  int tileX=0;
  int tileY=0;
  addr-=tileMapAddress;
switch (size) {
case bg32x64:
case bg64x32:
    if (addr >= 0x800) {
      tileX+=32;
      addr-=0x0800;
    }
  break;
case bg64x64:
if (addr >= 0x1800) {
  tileX+=32;
  tileY+=32;
  addr-=0x1800;
}
 else if (addr >= 0x1000) {
  tileY+=32;
  addr-=0x1000;
}
 else if (addr >= 0x0800) {
  tileX+=32;
  addr-=0x0800;
}
break;
}
tileY+=addr / 64;
addr%=64;
tileX+=addr / 2;
cacheTilemap[tileX][tileY]=PPU.vram[taddr] | (PPU.vram[taddr + 1] << 8);
}
Program: 3210
Project: 3210
Buggy source:
/** 
 * Cycles through each active tile and checks if it has a pixel at the  current x/y position on the screen, and outputs if one is found. Called once per on-screen pixel by PPU
 */
public static void loadPixel(){
  SpriteTile curTile;
  for (int k=0; k < numTiles; k++) {
    curTile=curTiles[k];
    if (Util.inRange(PPU.x - 22,curTile.x,curTile.x + 7)) {
      int color=curTile.getPixel((PPU.x - 22) - curTile.x,PPU.y - 1 - curTile.y);
      if (color == 0 || !userEnabled)       continue;
      if (mainScreen && curTile.priority > PPU.priorityMain) {
        PPU.colorMain=color + curTile.paletteOffset;
        PPU.priorityMain=curTile.priority;
        PPU.sourceMain=PPU.SRC_OAM;
      }
      if (subScreen && curTile.priority > PPU.prioritySub) {
        PPU.colorSub=color + curTile.paletteOffset;
        PPU.prioritySub=curTile.priority;
        PPU.sourceSub=PPU.SRC_OAM;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Cycles through each active tile and checks if it has a pixel at the  current x/y position on the screen, and outputs if one is found. Called once per on-screen pixel by PPU
 */
public static void loadPixel(){
  SpriteTile curTile;
  for (int k=0; k < numTiles; k++) {
    curTile=curTiles[k];
    if (Util.inRange(PPU.x - 22,curTile.x,curTile.x + 7)) {
      int color=curTile.getPixel((PPU.x - 22) - curTile.x,PPU.y - 1 - curTile.y);
      if (color == 0 || !userEnabled)       continue;
      if (mainScreen && curTile.priority >= PPU.priorityMain) {
        PPU.colorMain=color + curTile.paletteOffset;
        PPU.priorityMain=curTile.priority;
        PPU.sourceMain=PPU.SRC_OAM;
      }
      if (subScreen && curTile.priority >= PPU.prioritySub) {
        PPU.colorSub=color + curTile.paletteOffset;
        PPU.prioritySub=curTile.priority;
        PPU.sourceSub=PPU.SRC_OAM;
      }
    }
  }
}
Program: 3212
Project: 3212
Buggy source:
/** 
 * Resets the x and y values to 0 (handling scrolling) and load the first tile of scanline 0
 */
public void vBlank(){
  x=getHScroll();
  y=getVScroll();
  loadTile();
}

Fixed version (ground truth):
/** 
 * Resets the x and y values to 0 (handling scrolling) and load the first tile of scanline 0
 */
public void vBlank(){
  x=getHScroll();
  baseY=0;
  y=baseY + getVScroll() % (size.height * tileHeight);
  loadTile();
}
Program: 3213
Project: 3213
Buggy source:
/** 
 * Resets x and y to the beginning of the next scanline and loads the first tile in the scanline
 */
public void nextScanline(){
  y=(y + 1) % (size.height * tileHeight);
  x=getHScroll();
  loadTile();
}

Fixed version (ground truth):
/** 
 * Resets x and y to the beginning of the next scanline and loads the first tile in the scanline
 */
public void nextScanline(){
  baseY=(baseY + 1);
  y=(baseY + getVScroll()) % (size.height * tileHeight);
  x=getHScroll();
  loadTile();
}
Program: 3215
Project: 3215
Buggy source:
public static void run(InputStream is,boolean isZip) throws Exception {
  init(is,isZip);
  instCount=0;
  maxInstructions=Long.parseLong(Settings.get(Settings.CORE_MAX_INSTRUCTIONS));
  if (Settings.isSet(Settings.SAVE_PATH)) {
    InputStream saveStream=Util.getStreamFromUrl(Settings.get(Settings.SAVE_PATH));
    if (saveStream != null) {
      mem.loadSram(saveStream);
    }
  }
  File save=new File(Settings.get(Settings.SAVE_PATH));
  if (save != null) {
    mem.loadSram(new FileInputStream(save));
  }
  if (Log.instruction.enabled() && Settings.get(Settings.CPU_ALT_DEBUG) == "String_Node_Str") {
    Log.instruction("String_Node_Str");
    Log.instruction("String_Node_Str");
    Log.instruction("String_Node_Str");
  }
  timeBegin=new Date().getTime();
  cycle(maxInstructions);
  timeEnd=new Date().getTime();
  running=false;
  System.out.println("String_Node_Str" + ((timeEnd - timeBegin) / 1000) + "String_Node_Str");
  System.out.println("String_Node_Str" + instCount);
  System.out.println("String_Node_Str" + Timing.getCycles());
  System.out.println("String_Node_Str" + (((Timing.getCycles() + 0f) / ((timeEnd - timeBegin + 0f) / 1000f)) / (1024f * 1024f)) + "String_Node_Str");
  System.out.println("String_Node_Str" + (((Timing.getCycles() + 0f) / ((timeEnd - timeBegin + 0f) / 1000f))) + "String_Node_Str");
  printMMaps();
  PPU.dumpVRAM();
  mem.dumpWRAM();
  APUMemory.dump();
  renderScreen();
}

Fixed version (ground truth):
public static void run(InputStream is,boolean isZip) throws Exception {
  init(is,isZip);
  instCount=0;
  maxInstructions=Long.parseLong(Settings.get(Settings.CORE_MAX_INSTRUCTIONS));
  if (Settings.isSet(Settings.SAVE_PATH)) {
    InputStream saveStream=Util.getStreamFromUrl(Settings.get(Settings.SAVE_PATH));
    if (saveStream != null) {
      mem.loadSram(saveStream);
    }
  }
  if (Settings.get(Settings.SAVE_PATH) != null) {
    File save=new File(Settings.get(Settings.SAVE_PATH));
    if (save != null) {
      mem.loadSram(new FileInputStream(save));
    }
  }
  if (Log.instruction.enabled() && Settings.get(Settings.CPU_ALT_DEBUG) == "String_Node_Str") {
    Log.instruction("String_Node_Str");
    Log.instruction("String_Node_Str");
    Log.instruction("String_Node_Str");
  }
  timeBegin=new Date().getTime();
  cycle(maxInstructions);
  timeEnd=new Date().getTime();
  running=false;
  System.out.println("String_Node_Str" + ((timeEnd - timeBegin) / 1000) + "String_Node_Str");
  System.out.println("String_Node_Str" + instCount);
  System.out.println("String_Node_Str" + Timing.getCycles());
  System.out.println("String_Node_Str" + (((Timing.getCycles() + 0f) / ((timeEnd - timeBegin + 0f) / 1000f)) / (1024f * 1024f)) + "String_Node_Str");
  System.out.println("String_Node_Str" + (((Timing.getCycles() + 0f) / ((timeEnd - timeBegin + 0f) / 1000f))) + "String_Node_Str");
  printMMaps();
  PPU.dumpVRAM();
  mem.dumpWRAM();
  APUMemory.dump();
  renderScreen();
}
Program: 3216
Project: 3216
Buggy source:
public void set(Size size,int bank,int addr,int val){
  if (Util.inRange(bank,0x0,0x3F)) {
    if (addr < 0x2000) {
      setInArray(size,wram,addr,val);
      return;
    }
 else     if (addr >= 0x2000 && addr < 0x6000) {
      writeHWReg(size,addr,val);
      return;
    }
 else     if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
 else   if (Util.inRange(bank,0x40,0x7C)) {
    if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
 else   if (bank == 0x7D) {
    if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
 else   if (bank == 0x7E) {
    setInArray(size,wram,addr,val);
    return;
  }
 else   if (bank == 0x7F) {
    setInArray(size,wram,(addr + 0x8000),val);
    return;
  }
 else   if (Util.inRange(bank,0x80,0xBF)) {
    if (addr < 0x2000) {
      setInArray(size,wram,addr,val);
      return;
    }
 else     if (addr >= 0x2000 && addr < 0x6000) {
      writeHWReg(size,addr,val);
      return;
    }
 else     if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
 else   if (Util.inRange(bank,0xC0,0xFF)) {
    if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
  if (Settings.get(Settings.MEM_THROW_INVALID_ADDR).equals("String_Node_Str"))   throw new RuntimeException(String.format("String_Node_Str",bank,addr));
}

Fixed version (ground truth):
public void set(Size size,int bank,int addr,int val){
  if (Util.inRange(bank,0x0,0x3F)) {
    if (addr < 0x2000) {
      setInArray(size,wram,addr,val);
      return;
    }
 else     if (addr >= 0x2000 && addr < 0x6000) {
      writeHWReg(size,addr,val);
      return;
    }
 else     if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
 else   if (Util.inRange(bank,0x40,0x7C)) {
    if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
 else   if (bank == 0x7D) {
    if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
 else   if (bank == 0x7E) {
    setInArray(size,wram,addr,val);
    return;
  }
 else   if (bank == 0x7F) {
    setInArray(size,wram,(addr + 0x10000),val);
    return;
  }
 else   if (Util.inRange(bank,0x80,0xBF)) {
    if (addr < 0x2000) {
      setInArray(size,wram,addr,val);
      return;
    }
 else     if (addr >= 0x2000 && addr < 0x6000) {
      writeHWReg(size,addr,val);
      return;
    }
 else     if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
 else   if (Util.inRange(bank,0xC0,0xFF)) {
    if (addr >= 0x8000) {
      invalidMemoryWrite("String_Node_Str",bank,addr);
    }
  }
  if (Settings.get(Settings.MEM_THROW_INVALID_ADDR).equals("String_Node_Str"))   throw new RuntimeException(String.format("String_Node_Str",bank,addr));
}
Program: 3217
Project: 3217
Buggy source:
public int get(Size size,int bank,int addr){
  if (Util.inRange(bank,0x0,0x3F)) {
    if (addr < 0x2000) {
      return getFromArray(size,wram,addr);
    }
 else     if (addr >= 0x2000 && addr < 0x6000) {
      return readHWReg(size,addr);
    }
 else     if (addr >= 0x8000) {
      return getFromArray(size,rom,(bank * 0x8000) + (addr - 0x8000));
    }
  }
 else   if (Util.inRange(bank,0x40,0x7C)) {
    if (addr >= 0x8000) {
      return getFromArray(size,rom,(bank * 0x8000) + (addr - 0x8000));
    }
  }
 else   if (bank == 0x7D) {
    if (addr < 0x8000) {
      return 0;
    }
 else {
      return getFromArray(size,rom,(bank * 0x8000) + (addr - 0x8000));
    }
  }
 else   if (bank == 0x7E) {
    return getFromArray(size,wram,addr);
  }
 else   if (bank == 0x7F) {
    return getFromArray(size,wram,(addr + 0x8000));
  }
 else   if (Util.inRange(bank,0x80,0xBF)) {
    if (addr < 0x2000) {
      return getFromArray(size,wram,addr);
    }
 else     if (addr >= 0x2000 && addr < 0x6000) {
      return readHWReg(size,addr);
    }
 else     if (addr >= 0x8000) {
      return getFromArray(size,rom,((bank - 0x80) * 0x8000) + (addr - 0x8000));
    }
  }
 else   if (Util.inRange(bank,0xC0,0xFF)) {
    if (addr >= 0x8000) {
      return getFromArray(size,rom,((bank - 0x80) * 0x8000) + (addr - 0x8000));
    }
  }
  if (Settings.get(Settings.MEM_THROW_INVALID_ADDR).equals("String_Node_Str"))   throw new RuntimeException(String.format("String_Node_Str",bank,addr));
  return 0;
}

Fixed version (ground truth):
public int get(Size size,int bank,int addr){
  if (Util.inRange(bank,0x0,0x3F)) {
    if (addr < 0x2000) {
      return getFromArray(size,wram,addr);
    }
 else     if (addr >= 0x2000 && addr < 0x6000) {
      return readHWReg(size,addr);
    }
 else     if (addr >= 0x8000) {
      return getFromArray(size,rom,(bank * 0x8000) + (addr - 0x8000));
    }
  }
 else   if (Util.inRange(bank,0x40,0x7C)) {
    if (addr >= 0x8000) {
      return getFromArray(size,rom,(bank * 0x8000) + (addr - 0x8000));
    }
  }
 else   if (bank == 0x7D) {
    if (addr < 0x8000) {
      return 0;
    }
 else {
      return getFromArray(size,rom,(bank * 0x8000) + (addr - 0x8000));
    }
  }
 else   if (bank == 0x7E) {
    return getFromArray(size,wram,addr);
  }
 else   if (bank == 0x7F) {
    return getFromArray(size,wram,(addr + 0x10000));
  }
 else   if (Util.inRange(bank,0x80,0xBF)) {
    if (addr < 0x2000) {
      return getFromArray(size,wram,addr);
    }
 else     if (addr >= 0x2000 && addr < 0x6000) {
      return readHWReg(size,addr);
    }
 else     if (addr >= 0x8000) {
      return getFromArray(size,rom,((bank - 0x80) * 0x8000) + (addr - 0x8000));
    }
  }
 else   if (Util.inRange(bank,0xC0,0xFF)) {
    if (addr >= 0x8000) {
      return getFromArray(size,rom,((bank - 0x80) * 0x8000) + (addr - 0x8000));
    }
  }
  if (Settings.get(Settings.MEM_THROW_INVALID_ADDR).equals("String_Node_Str"))   throw new RuntimeException(String.format("String_Node_Str",bank,addr));
  return 0;
}
Program: 3220
Project: 3220
Buggy source:
public void setDefaultSort(boolean defaultSort){
  this.defaultSort=defaultSort;
}

Fixed version (ground truth):
public void setDefaultSort(DiscoverySortFieldConfiguration defaultSort){
  this.defaultSort=defaultSort;
}
Program: 3222
Project: 3222
Buggy source:
protected String getParameterOrder(){
  String sortOrder=ObjectModelHelper.getRequest(objectModel).getParameter("String_Node_Str");
  if (sortOrder == null) {
    sortOrder=new DSpace().getConfigurationService().getProperty("String_Node_Str");
  }
  return sortOrder;
}

Fixed version (ground truth):
protected String getParameterOrder(){
  return ObjectModelHelper.getRequest(objectModel).getParameter("String_Node_Str");
}
Program: 3224
Project: 3224
Buggy source:
/** 
 * Generate a url to the simple search url.
 */
protected String generateURL(Map<String,String> parameters) throws UIException {
  String query=getQuery();
  if (!"String_Node_Str".equals(query)) {
    parameters.put("String_Node_Str",encodeForURL(query));
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",String.valueOf(getParameterPage()));
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",String.valueOf(getParameterRpp()));
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",String.valueOf(this.getParameterGroup()));
  }
  if (getParameterSortBy() != null) {
    parameters.put("String_Node_Str",String.valueOf(getParameterSortBy()));
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",getParameterOrder());
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",String.valueOf(getParameterEtAl()));
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",getParameterScope());
  }
  return AbstractDSpaceTransformer.generateURL("String_Node_Str",parameters);
}

Fixed version (ground truth):
/** 
 * Generate a url to the simple search url.
 */
protected String generateURL(Map<String,String> parameters) throws UIException {
  String query=getQuery();
  if (!"String_Node_Str".equals(query)) {
    parameters.put("String_Node_Str",encodeForURL(query));
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",String.valueOf(getParameterPage()));
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",String.valueOf(getParameterRpp()));
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",String.valueOf(this.getParameterGroup()));
  }
  if (parameters.get("String_Node_Str") == null && getParameterSortBy() != null) {
    parameters.put("String_Node_Str",String.valueOf(getParameterSortBy()));
  }
  if (parameters.get("String_Node_Str") == null && getParameterOrder() != null) {
    parameters.put("String_Node_Str",getParameterOrder());
  }
  if (parameters.get("String_Node_Str") == null) {
    parameters.put("String_Node_Str",String.valueOf(getParameterEtAl()));
  }
  if (parameters.get("String_Node_Str") == null && getParameterScope() != null) {
    parameters.put("String_Node_Str",getParameterScope());
  }
  return AbstractDSpaceTransformer.generateURL("String_Node_Str",parameters);
}
Program: 3225
Project: 3225
Buggy source:
@Override public ActionResult execute(Context c,XmlWorkflowItem wfi,Step step,HttpServletRequest request) throws SQLException, AuthorizeException, IOException {
  if (request.getParameter("String_Node_Str") != null) {
    WorkflowRequirementsManager.addClaimedUser(c,wfi,step,c.getCurrentUser());
    return new ActionResult(ActionResult.TYPE.TYPE_OUTCOME,ActionResult.OUTCOME_COMPLETE);
  }
 else {
    return new ActionResult(ActionResult.TYPE.TYPE_CANCEL);
  }
}

Fixed version (ground truth):
@Override public ActionResult execute(Context c,XmlWorkflowItem wfi,Step step,HttpServletRequest request) throws SQLException, AuthorizeException, IOException {
  if (request.getParameter("String_Node_Str") != null || request.getParameter("String_Node_Str") != null) {
    WorkflowRequirementsManager.addClaimedUser(c,wfi,step,c.getCurrentUser());
    return new ActionResult(ActionResult.TYPE.TYPE_OUTCOME,ActionResult.OUTCOME_COMPLETE);
  }
 else {
    return new ActionResult(ActionResult.TYPE.TYPE_CANCEL);
  }
}
Program: 3229
Project: 3229
Buggy source:
/** 
 * Create a <div> element with <mptr> which references a child object via its handle (and via a local file name, when recursively disseminating all child objects).
 * @param type - type attr value for the <div>
 * @param dso - object for which to create the div
 * @param params
 * @return
 */
protected Div makeChildDiv(String type,DSpaceObject dso,PackageParameters params){
  String handle=dso.getHandle();
  Div div=new Div();
  div.setID(gensym("String_Node_Str"));
  div.setTYPE(type);
  boolean emptyDiv=true;
  if (handle == null || handle.length() == 0) {
    log.warn("String_Node_Str" + type + "String_Node_Str"+ dso.toString());
  }
 else {
    Mptr mptr=new Mptr();
    mptr.setID(gensym("String_Node_Str"));
    mptr.setLOCTYPE(Loctype.HANDLE);
    mptr.setXlinkHref(handle);
    div.getContent().add(mptr);
    emptyDiv=false;
  }
  if (params.recursiveModeEnabled()) {
    String childFileExtension=(params.getBooleanProperty("String_Node_Str",false)) ? "String_Node_Str" : "String_Node_Str";
    Mptr mptr2=new Mptr();
    mptr2.setID(gensym("String_Node_Str"));
    mptr2.setLOCTYPE(Loctype.URL);
    mptr2.setXlinkHref(PackageUtils.getPackageName(dso,childFileExtension));
    div.getContent().add(mptr2);
    emptyDiv=false;
  }
  if (emptyDiv) {
    return null;
  }
 else {
    return div;
  }
}

Fixed version (ground truth):
/** 
 * Create a <div> element with <mptr> which references a child object via its handle (and via a local file name, when recursively disseminating all child objects).
 * @param type - type attr value for the <div>
 * @param dso - object for which to create the div
 * @param params
 * @return
 */
protected Div makeChildDiv(String type,DSpaceObject dso,PackageParameters params){
  String handle=dso.getHandle();
  Div div=new Div();
  div.setID(gensym("String_Node_Str"));
  div.setTYPE(type);
  if (handle == null || handle.length() == 0) {
    log.warn("String_Node_Str" + type + "String_Node_Str"+ dso.toString());
  }
 else {
    Mptr mptr=new Mptr();
    mptr.setID(gensym("String_Node_Str"));
    mptr.setLOCTYPE(Loctype.HANDLE);
    mptr.setXlinkHref(handle);
    div.getContent().add(mptr);
  }
  String childFileExtension=(params.getBooleanProperty("String_Node_Str",false)) ? "String_Node_Str" : "String_Node_Str";
  Mptr mptr2=new Mptr();
  mptr2.setID(gensym("String_Node_Str"));
  mptr2.setLOCTYPE(Loctype.URL);
  mptr2.setXlinkHref(PackageUtils.getPackageName(dso,childFileExtension));
  div.getContent().add(mptr2);
  return div;
}
Program: 3233
Project: 3233
Buggy source:
/** 
 * Add File to list of successfully disseminated package files
 * @param file File
 */
protected void addToPackageList(File f){
  packageFileList.add(f);
}

Fixed version (ground truth):
/** 
 * Add File to list of successfully disseminated package files
 * @param file File
 */
protected void addToPackageList(File f){
  if (!packageFileList.contains(f)) {
    packageFileList.add(f);
  }
}
Program: 3234
Project: 3234
Buggy source:
/** 
 * Gets all <code>file</code> elements which make up the item's content.
 * @return a List of <code>Element</code>s.
 */
public List<Element> getContentFiles() throws MetadataValidationException {
  if (contentFiles != null) {
    return contentFiles;
  }
  Element fileSec=mets.getChild("String_Node_Str",metsNS);
  if (fileSec == null) {
    throw new MetadataValidationException("String_Node_Str");
  }
  contentFiles=new ArrayList<Element>();
  Iterator fgi=fileSec.getChildren("String_Node_Str",metsNS).iterator();
  while (fgi.hasNext()) {
    Element fg=(Element)fgi.next();
    Iterator fi=fg.getChildren("String_Node_Str",metsNS).iterator();
    while (fi.hasNext()) {
      Element f=(Element)fi.next();
      contentFiles.add(f);
    }
  }
  return contentFiles;
}

Fixed version (ground truth):
/** 
 * Gets all <code>file</code> elements which make up the item's content.
 * @return a List of <code>Element</code>s.
 */
public List<Element> getContentFiles() throws MetadataValidationException {
  if (contentFiles != null) {
    return contentFiles;
  }
  contentFiles=new ArrayList<Element>();
  Element fileSec=mets.getChild("String_Node_Str",metsNS);
  if (fileSec != null) {
    Iterator fgi=fileSec.getChildren("String_Node_Str",metsNS).iterator();
    while (fgi.hasNext()) {
      Element fg=(Element)fgi.next();
      Iterator fi=fg.getChildren("String_Node_Str",metsNS).iterator();
      while (fi.hasNext()) {
        Element f=(Element)fi.next();
        contentFiles.add(f);
      }
    }
  }
  return contentFiles;
}
Program: 3235
Project: 3235
Buggy source:
/** 
 * Store original package on disk and companion file containing SWORD headers as found in the deposit object Also write companion file with header info from the deposit object.
 * @param deposit
 */
private void storePackageAsFile(Deposit deposit) throws IOException {
  String path=swordService.getSwordConfig().getFailedPackageDir();
  File dir=new File(path);
  if (!dir.exists() || !dir.isDirectory()) {
    throw new IOException("String_Node_Str");
  }
  String filenameBase="String_Node_Str" + deposit.getUsername() + "String_Node_Str"+ (new Date()).getTime();
  File packageFile=new File(path,filenameBase);
  File headersFile=new File(path,filenameBase + "String_Node_Str");
  InputStream is=deposit.getFile();
  FileOutputStream fos=new FileOutputStream(packageFile);
  Utils.copy(is,fos);
  fos.close();
  is.close();
  PrintWriter pw=new PrintWriter(new BufferedWriter(new FileWriter(headersFile)));
  pw.println("String_Node_Str" + deposit.getContentDisposition());
  pw.println("String_Node_Str" + deposit.getContentType());
  pw.println("String_Node_Str" + deposit.getPackaging());
  pw.println("String_Node_Str" + deposit.getLocation());
  pw.println("String_Node_Str" + deposit.getOnBehalfOf());
  pw.println("String_Node_Str" + deposit.getSlug());
  pw.println("String_Node_Str" + deposit.getUsername());
  pw.close();
}

Fixed version (ground truth):
/** 
 * Store original package on disk and companion file containing SWORD headers as found in the deposit object Also write companion file with header info from the deposit object.
 * @param deposit
 */
private void storePackageAsFile(Deposit deposit) throws IOException {
  String path=swordService.getSwordConfig().getFailedPackageDir();
  File dir=new File(path);
  if (!dir.exists() || !dir.isDirectory()) {
    throw new IOException("String_Node_Str");
  }
  String filenameBase="String_Node_Str" + deposit.getUsername() + "String_Node_Str"+ (new Date()).getTime();
  File packageFile=new File(path,filenameBase);
  File headersFile=new File(path,filenameBase + "String_Node_Str");
  InputStream is=new BufferedInputStream(new FileInputStream(deposit.getFile()));
  OutputStream fos=new BufferedOutputStream(new FileOutputStream(packageFile));
  Utils.copy(is,fos);
  fos.close();
  is.close();
  PrintWriter pw=new PrintWriter(new BufferedWriter(new FileWriter(headersFile)));
  pw.println("String_Node_Str" + deposit.getContentDisposition());
  pw.println("String_Node_Str" + deposit.getContentType());
  pw.println("String_Node_Str" + deposit.getPackaging());
  pw.println("String_Node_Str" + deposit.getLocation());
  pw.println("String_Node_Str" + deposit.getOnBehalfOf());
  pw.println("String_Node_Str" + deposit.getSlug());
  pw.println("String_Node_Str" + deposit.getUsername());
  pw.close();
}
Program: 3237
Project: 3237
Buggy source:
String getStringColumnCanonicalized(String column){
  if (!hasColumnCanonicalized(column)) {
    throw new IllegalArgumentException("String_Node_Str" + column);
  }
  if (isColumnNull(column)) {
    return null;
  }
  Object value=data.get(column);
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str" + column + "String_Node_Str");
  }
  if (!(value instanceof String)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return (String)value;
}

Fixed version (ground truth):
String getStringColumnCanonicalized(String column){
  if (!hasColumnCanonicalized(column)) {
    throw new IllegalArgumentException("String_Node_Str" + column);
  }
  if (isColumnNullCanonicalized(column)) {
    return null;
  }
  Object value=data.get(column);
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str" + column + "String_Node_Str");
  }
  if (!(value instanceof String)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return (String)value;
}
Program: 3239
Project: 3239
Buggy source:
/** 
 * Do nothing, to prevent wrapped stream from being closed prematurely.
 */
public void close(){
}

Fixed version (ground truth):
/** 
 * Do nothing, to prevent wrapped stream from being closed prematurely.
 */
@Override public void close(){
}
Program: 3242
Project: 3242
Buggy source:
public void run(){
  try {
    writeToStream(context,object,stream,emitPasswords);
    stream.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  PackageException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    writeToStream(context,object,stream,emitPasswords);
    stream.close();
  }
 catch (  IOException e) {
    log.error(e);
  }
catch (  PackageException e) {
    log.error(e);
  }
}
Program: 3244
Project: 3244
Buggy source:
private static void init(){
  if (hiddenElementSets == null) {
    hiddenElementSets=new HashMap<String,Set<String>>();
    hiddenElementMaps=new HashMap<String,Map<String,Set<String>>>();
    Enumeration pne=ConfigurationManager.propertyNames();
    while (pne.hasMoreElements()) {
      String key=(String)pne.nextElement();
      if (key.startsWith(CONFIG_PREFIX)) {
        String mdField=key.substring(CONFIG_PREFIX.length());
        String segment[]=mdField.split("String_Node_Str",3);
        if (segment.length == 3) {
          Map<String,Set<String>> eltMap=hiddenElementMaps.get(segment[0]);
          if (eltMap == null) {
            eltMap=new HashMap<String,Set<String>>();
            hiddenElementMaps.put(segment[0],eltMap);
          }
          if (!eltMap.containsKey(segment[1])) {
            eltMap.put(segment[1],new HashSet<String>());
          }
          eltMap.get(segment[1]).add(segment[2]);
        }
 else         if (segment.length == 2) {
          if (!hiddenElementSets.containsKey(segment[0])) {
            hiddenElementSets.put(segment[0],new HashSet<String>());
          }
          hiddenElementSets.get(segment[0]).add(segment[1]);
        }
 else {
          log.warn("String_Node_Str" + mdField + "String_Node_Str"+ key);
        }
      }
    }
  }
}

Fixed version (ground truth):
private static synchronized void init(){
  if (!isInitialized()) {
    hiddenElementSets=new HashMap<String,Set<String>>();
    hiddenElementMaps=new HashMap<String,Map<String,Set<String>>>();
    Enumeration pne=ConfigurationManager.propertyNames();
    while (pne.hasMoreElements()) {
      String key=(String)pne.nextElement();
      if (key.startsWith(CONFIG_PREFIX)) {
        String mdField=key.substring(CONFIG_PREFIX.length());
        String segment[]=mdField.split("String_Node_Str",3);
        if (segment.length == 3) {
          Map<String,Set<String>> eltMap=hiddenElementMaps.get(segment[0]);
          if (eltMap == null) {
            eltMap=new HashMap<String,Set<String>>();
            hiddenElementMaps.put(segment[0],eltMap);
          }
          if (!eltMap.containsKey(segment[1])) {
            eltMap.put(segment[1],new HashSet<String>());
          }
          eltMap.get(segment[1]).add(segment[2]);
        }
 else         if (segment.length == 2) {
          if (!hiddenElementSets.containsKey(segment[0])) {
            hiddenElementSets.put(segment[0],new HashSet<String>());
          }
          hiddenElementSets.get(segment[0]).add(segment[1]);
        }
 else {
          log.warn("String_Node_Str" + mdField + "String_Node_Str"+ key);
        }
      }
    }
  }
}
Program: 3245
Project: 3245
Buggy source:
public static boolean isHidden(Context context,String schema,String element,String qualifier) throws SQLException {
  if (context != null && AuthorizeManager.isAdmin(context))   return false;
  init();
  if (qualifier == null) {
    Set<String> elts=hiddenElementSets.get(schema);
    return elts == null ? false : elts.contains(element);
  }
 else {
    Map<String,Set<String>> elts=hiddenElementMaps.get(schema);
    if (elts == null)     return false;
    Set<String> quals=elts.get(element);
    return quals == null ? false : quals.contains(qualifier);
  }
}

Fixed version (ground truth):
public static boolean isHidden(Context context,String schema,String element,String qualifier) throws SQLException {
  if (context != null && AuthorizeManager.isAdmin(context))   return false;
  if (!isInitialized()) {
    init();
  }
  if (qualifier == null) {
    Set<String> elts=hiddenElementSets.get(schema);
    return elts == null ? false : elts.contains(element);
  }
 else {
    Map<String,Set<String>> elts=hiddenElementMaps.get(schema);
    if (elts == null)     return false;
    Set<String> quals=elts.get(element);
    return quals == null ? false : quals.contains(qualifier);
  }
}
Program: 3246
Project: 3246
Buggy source:
private static void initCache(Context context) throws SQLException {
  if (id2field != null)   return;
synchronized (MetadataField.class) {
    if (id2field == null) {
      HashMap new_id2field=new HashMap();
      log.info("String_Node_Str");
      TableRowIterator tri=DatabaseManager.queryTable(context,"String_Node_Str","String_Node_Str");
      try {
        while (tri.hasNext()) {
          TableRow row=tri.next();
          int fieldID=row.getIntColumn("String_Node_Str");
          new_id2field.put(new Integer(fieldID),new MetadataField(row));
        }
      }
  finally {
        if (tri != null)         tri.close();
      }
      id2field=new_id2field;
    }
  }
}

Fixed version (ground truth):
private static synchronized void initCache(Context context) throws SQLException {
  if (!isCacheInitialized()) {
    HashMap new_id2field=new HashMap();
    log.info("String_Node_Str");
    TableRowIterator tri=DatabaseManager.queryTable(context,"String_Node_Str","String_Node_Str");
    try {
      while (tri.hasNext()) {
        TableRow row=tri.next();
        int fieldID=row.getIntColumn("String_Node_Str");
        new_id2field.put(new Integer(fieldID),new MetadataField(row));
      }
    }
  finally {
      if (tri != null)       tri.close();
    }
    id2field=new_id2field;
  }
}
Program: 3247
Project: 3247
Buggy source:
/** 
 * Find the field corresponding to the given numeric ID.  The ID is a database key internal to DSpace.
 * @param context context, in case we need to read it in from DB
 * @param id the metadata field ID
 * @return the metadata field object
 * @throws SQLException
 */
public static MetadataField find(Context context,int id) throws SQLException {
  initCache(context);
  Integer iid=new Integer(id);
  if (!id2field.containsKey(iid))   return null;
  return (MetadataField)id2field.get(iid);
}

Fixed version (ground truth):
/** 
 * Find the field corresponding to the given numeric ID.  The ID is a database key internal to DSpace.
 * @param context context, in case we need to read it in from DB
 * @param id the metadata field ID
 * @return the metadata field object
 * @throws SQLException
 */
public static MetadataField find(Context context,int id) throws SQLException {
  if (!isCacheInitialized()) {
    initCache(context);
  }
  Integer iid=new Integer(id);
  if (!id2field.containsKey(iid))   return null;
  return (MetadataField)id2field.get(iid);
}
Program: 3248
Project: 3248
Buggy source:
private static void initCache(Context context) throws SQLException {
  if (id2schema != null && name2schema != null)   return;
synchronized (MetadataSchema.class) {
    if (id2schema == null && name2schema == null) {
      log.info("String_Node_Str");
      HashMap new_id2schema=new HashMap();
      HashMap new_name2schema=new HashMap();
      TableRowIterator tri=DatabaseManager.queryTable(context,"String_Node_Str","String_Node_Str");
      try {
        while (tri.hasNext()) {
          TableRow row=tri.next();
          MetadataSchema s=new MetadataSchema(row);
          new_id2schema.put(new Integer(s.schemaID),s);
          new_name2schema.put(s.name,s);
        }
      }
  finally {
        if (tri != null)         tri.close();
      }
      id2schema=new_id2schema;
      name2schema=new_name2schema;
    }
  }
}

Fixed version (ground truth):
private static synchronized void initCache(Context context) throws SQLException {
  if (!isCacheInitialized()) {
    log.info("String_Node_Str");
    HashMap new_id2schema=new HashMap();
    HashMap new_name2schema=new HashMap();
    TableRowIterator tri=DatabaseManager.queryTable(context,"String_Node_Str","String_Node_Str");
    try {
      while (tri.hasNext()) {
        TableRow row=tri.next();
        MetadataSchema s=new MetadataSchema(row);
        new_id2schema.put(new Integer(s.schemaID),s);
        new_name2schema.put(s.name,s);
      }
    }
  finally {
      if (tri != null)       tri.close();
    }
    id2schema=new_id2schema;
    name2schema=new_name2schema;
  }
}
Program: 3249
Project: 3249
Buggy source:
/** 
 * Get the schema corresponding with this short name.
 * @param context context, in case we need to read it in from DB
 * @param shortName the short name for the schema
 * @return the metadata schema object
 * @throws SQLException
 */
public static MetadataSchema find(Context context,String shortName) throws SQLException {
  if (shortName == null)   return null;
  initCache(context);
  if (!name2schema.containsKey(shortName))   return null;
  return (MetadataSchema)name2schema.get(shortName);
}

Fixed version (ground truth):
/** 
 * Get the schema corresponding with this short name.
 * @param context context, in case we need to read it in from DB
 * @param shortName the short name for the schema
 * @return the metadata schema object
 * @throws SQLException
 */
public static MetadataSchema find(Context context,String shortName) throws SQLException {
  if (shortName == null)   return null;
  if (!isCacheInitialized()) {
    initCache(context);
  }
  if (!name2schema.containsKey(shortName))   return null;
  return (MetadataSchema)name2schema.get(shortName);
}
Program: 3250
Project: 3250
Buggy source:
public static String[] getPluginNames(){
  if (pluginNames == null) {
    try {
      if (dci == null)       dci=new DCInputsReader();
    }
 catch (    DCInputsReaderException e) {
      log.error("String_Node_Str",e);
    }
    List<String> names=new ArrayList<String>();
    Iterator pi=dci.getPairsNameIterator();
    while (pi.hasNext())     names.add((String)pi.next());
    pluginNames=names.toArray(new String[names.size()]);
    log.debug("String_Node_Str" + Arrays.deepToString(pluginNames));
  }
  return pluginNames;
}

Fixed version (ground truth):
public static String[] getPluginNames(){
  if (pluginNames == null) {
    try {
      if (dci == null)       dci=new DCInputsReader();
    }
 catch (    DCInputsReaderException e) {
      log.error("String_Node_Str",e);
    }
    List<String> names=new ArrayList<String>();
    Iterator pi=dci.getPairsNameIterator();
    while (pi.hasNext()) {
      names.add((String)pi.next());
    }
    pluginNames=names.toArray(new String[names.size()]);
    log.debug("String_Node_Str" + Arrays.deepToString(pluginNames));
  }
  return pluginNames;
}
Program: 3251
Project: 3251
Buggy source:
/** 
 * Close any IndexSearcher that is currently open.
 */
public static void close(){
  if (searcher != null) {
    try {
      searcher.close();
      searcher=null;
    }
 catch (    IOException ioe) {
      log.error("String_Node_Str",ioe);
    }
  }
}

Fixed version (ground truth):
/** 
 * Close any IndexSearcher that is currently open.
 */
public static synchronized void close(){
  if (searcher != null) {
    try {
      searcher.close();
      searcher=null;
    }
 catch (    IOException ioe) {
      log.error("String_Node_Str",ioe);
    }
  }
}
Program: 3252
Project: 3252
Buggy source:
/** 
 * Return all the configured sort options
 * @return
 * @throws SortException
 */
public static Set<SortOption> getSortOptions() throws SortException {
  if (SortOption.sortOptionsSet != null)   return SortOption.sortOptionsSet;
synchronized (SortOption.class) {
    if (SortOption.sortOptionsSet == null) {
      Set<SortOption> newSortOptionsSet=new HashSet<SortOption>();
      int idx=1;
      String option;
      while (((option=ConfigurationManager.getProperty("String_Node_Str" + idx))) != null) {
        SortOption so=new SortOption(idx,option);
        newSortOptionsSet.add(so);
        idx++;
      }
      SortOption.sortOptionsSet=newSortOptionsSet;
    }
  }
  return SortOption.sortOptionsSet;
}

Fixed version (ground truth):
/** 
 * Return all the configured sort options
 * @return
 * @throws SortException
 */
public static Set<SortOption> getSortOptions() throws SortException {
  if (SortOption.sortOptionsSet == null) {
    throw new SortException("String_Node_Str");
  }
  return SortOption.sortOptionsSet;
}
Program: 3255
Project: 3255
Buggy source:
/** 
 * Initalise a new change holder for an existing item
 * @param i The Item to store
 */
public BulkEditChange(Item i){
  item=i;
  newItem=false;
  empty=true;
  adds=new ArrayList<DCValue>();
  removes=new ArrayList<DCValue>();
  constant=new ArrayList<DCValue>();
  complete=new ArrayList<DCValue>();
  oldMappedCollections=new ArrayList<Collection>();
  newMappedCollections=new ArrayList<Collection>();
}

Fixed version (ground truth):
/** 
 * Initialise a new change holder for an existing item
 * @param i The Item to store
 */
public BulkEditChange(Item i){
  item=i;
  newItem=false;
  empty=true;
  adds=new ArrayList<DCValue>();
  removes=new ArrayList<DCValue>();
  constant=new ArrayList<DCValue>();
  complete=new ArrayList<DCValue>();
  oldMappedCollections=new ArrayList<Collection>();
  newMappedCollections=new ArrayList<Collection>();
}
Program: 3256
Project: 3256
Buggy source:
/** 
 * Initalise this class with values from dspace.cfg
 */
private void init(){
  setValueSeparator();
  setFieldSeparator();
  headings=new ArrayList<String>();
  lines=new ArrayList<DSpaceCSVLine>();
  counter=0;
  ignore=new Hashtable<String,String>();
  String toIgnore=ConfigurationManager.getProperty("String_Node_Str");
  if ((toIgnore == null) || ("String_Node_Str".equals(toIgnore.trim()))) {
    toIgnore="String_Node_Str" + "String_Node_Str";
  }
  String[] toIgnoreArray=toIgnore.split("String_Node_Str");
  for (  String toIgnoreString : toIgnoreArray) {
    if (!"String_Node_Str".equals(toIgnoreString.trim())) {
      ignore.put(toIgnoreString.trim(),toIgnoreString.trim());
    }
  }
}

Fixed version (ground truth):
/** 
 * Initialise this class with values from dspace.cfg
 */
private void init(){
  setValueSeparator();
  setFieldSeparator();
  headings=new ArrayList<String>();
  lines=new ArrayList<DSpaceCSVLine>();
  counter=0;
  ignore=new Hashtable<String,String>();
  String toIgnore=ConfigurationManager.getProperty("String_Node_Str");
  if ((toIgnore == null) || ("String_Node_Str".equals(toIgnore.trim()))) {
    toIgnore="String_Node_Str" + "String_Node_Str";
  }
  String[] toIgnoreArray=toIgnore.split("String_Node_Str");
  for (  String toIgnoreString : toIgnoreArray) {
    if (!"String_Node_Str".equals(toIgnoreString.trim())) {
      ignore.put(toIgnoreString.trim(),toIgnoreString.trim());
    }
  }
}