nus-yam/ex-repair huggingface dataset:
Program: 155285
Project: 155285
Buggy source:
static void writeDynamicRecord(DynamicRecord record,FileChannel fileChannel,ByteBuffer buffer) throws IOException {
  buffer.clear();
  byte inUse=record.inUse() ? Record.IN_USE.byteValue() : Record.NOT_IN_USE.byteValue();
  buffer.putInt(record.getId()).put(inUse).putInt(record.getPrevBlock()).putInt(record.getLength()).putInt(record.getNextBlock()).put(record.getData());
  buffer.flip();
  fileChannel.write(buffer);
}

Fixed version (ground truth):
static void writeDynamicRecord(DynamicRecord record,ByteBuffer buffer){
  if (record.inUse()) {
    byte inUse=Record.IN_USE.byteValue();
    buffer.putInt(record.getId()).put(inUse).putInt(record.getPrevBlock()).putInt(record.getLength()).putInt(record.getNextBlock()).put(record.getData());
  }
 else {
    byte inUse=Record.NOT_IN_USE.byteValue();
    buffer.putInt(record.getId()).put(inUse);
  }
}
Program: 155286
Project: 155286
Buggy source:
static DynamicRecord readDynamicRecord(FileChannel fileChannel,ByteBuffer buffer) throws IOException {
  buffer.clear();
  buffer.limit(17);
  if (fileChannel.read(buffer) != buffer.limit()) {
    return null;
  }
  buffer.flip();
  int id=buffer.getInt();
  byte inUseFlag=buffer.get();
  boolean inUse=false;
  if (inUseFlag == Record.IN_USE.byteValue()) {
    inUse=true;
  }
 else   if (inUseFlag != Record.NOT_IN_USE.byteValue()) {
    throw new IOException("String_Node_Str" + inUseFlag);
  }
  DynamicRecord record=new DynamicRecord(id);
  record.setInUse(inUse);
  record.setPrevBlock(buffer.getInt());
  int nrOfBytes=buffer.getInt();
  record.setNextBlock(buffer.getInt());
  buffer.clear();
  buffer.limit(nrOfBytes);
  if (fileChannel.read(buffer) != buffer.limit()) {
    return null;
  }
  buffer.flip();
  byte data[]=new byte[nrOfBytes];
  buffer.get(data);
  record.setData(data);
  return record;
}

Fixed version (ground truth):
static DynamicRecord readDynamicRecord(FileChannel fileChannel,ByteBuffer buffer) throws IOException {
  buffer.clear();
  buffer.limit(17);
  if (fileChannel.read(buffer) != buffer.limit()) {
    return null;
  }
  buffer.flip();
  int id=buffer.getInt();
  byte inUseFlag=buffer.get();
  boolean inUse=false;
  if (inUseFlag == Record.IN_USE.byteValue()) {
    inUse=true;
  }
 else   if (inUseFlag != Record.NOT_IN_USE.byteValue()) {
    throw new IOException("String_Node_Str" + inUseFlag);
  }
  DynamicRecord record=new DynamicRecord(id);
  record.setInUse(inUse);
  if (inUse) {
    record.setPrevBlock(buffer.getInt());
    int nrOfBytes=buffer.getInt();
    record.setNextBlock(buffer.getInt());
    buffer.clear();
    buffer.limit(nrOfBytes);
    if (fileChannel.read(buffer) != buffer.limit()) {
      return null;
    }
    buffer.flip();
    byte data[]=new byte[nrOfBytes];
    buffer.get(data);
    record.setData(data);
  }
  return record;
}
Program: 155287
Project: 155287
Buggy source:
private TxManager(){
  String txLogDir=System.getProperty("String_Node_Str");
  if (txLogDir == null) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  logSwitcherFileName=txLogDir + "String_Node_Str";
  txLog1FileName=txLogDir + "String_Node_Str";
  txLog2FileName=txLogDir + "String_Node_Str";
  try {
    if (new File(logSwitcherFileName).exists()) {
      FileChannel fc=new RandomAccessFile(logSwitcherFileName,"String_Node_Str").getChannel();
      byte fileName[]=new byte[256];
      ByteBuffer buf=ByteBuffer.wrap(fileName);
      fc.read(buf);
      String currentTxLog=new String(fileName).trim();
      if (!new File(currentTxLog).exists()) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + currentTxLog + "String_Node_Str");
      }
      txLog=new TxLog(currentTxLog);
    }
 else {
      if (new File(txLog1FileName).exists() || new File(txLog2FileName).exists()) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + txLog1FileName + "String_Node_Str"+ txLog2FileName+ "String_Node_Str"+ "String_Node_Str");
      }
      ByteBuffer buf=ByteBuffer.wrap(txLog1FileName.getBytes("String_Node_Str"));
      FileChannel fc=new RandomAccessFile(logSwitcherFileName,"String_Node_Str").getChannel();
      fc.write(buf);
      txLog=new TxLog(txLog1FileName);
      fc.force(true);
      fc.close();
    }
    Iterator<List<TxLog.Record>> danglingRecordList=txLog.getDanglingRecords();
    if (danglingRecordList.hasNext()) {
      log.warning("String_Node_Str" + "String_Node_Str");
      recover(danglingRecordList);
    }
    getTxLog().truncate();
    tmOk=true;
  }
 catch (  IOException e) {
    e.printStackTrace();
    log.severe("String_Node_Str");
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private TxManager(){
}
Program: 155288
Project: 155288
Buggy source:
public void start(){
  if (!startIsOk) {
    return;
  }
  if (dataSourceConfigFile != null) {
    new XaDataSourceConfigFileParser().parse(dataSourceConfigFile);
  }
  startIsOk=false;
}

Fixed version (ground truth):
public void start(){
  if (!startIsOk) {
    return;
  }
  if (dataSourceConfigFile != null) {
    new XaDataSourceConfigFileParser().parse(dataSourceConfigFile);
  }
  TxManager.getManager().init();
  startIsOk=false;
}
Program: 155289
Project: 155289
Buggy source:
void force() throws IOException {
  fileChannel.force(true);
}

Fixed version (ground truth):
void force() throws IOException {
  fileChannel.force(false);
}
Program: 155290
Project: 155290
Buggy source:
void open() throws IOException {
  fileChannel=new RandomAccessFile(fileName,"String_Node_Str").getChannel();
  buffer=ByteBuffer.allocateDirect(9 + Xid.MAXGTRIDSIZE + Xid.MAXBQUALSIZE);
  if (fileChannel.size() != 0) {
    doInternalRecovery();
  }
 else {
    scanIsComplete=true;
    logCreated=System.currentTimeMillis();
    buffer.clear();
    buffer.putLong(logCreated);
    buffer.flip();
    fileChannel.write(buffer);
  }
}

Fixed version (ground truth):
void open() throws IOException {
  fileChannel=new RandomAccessFile(fileName,"String_Node_Str").getChannel();
  buffer=ByteBuffer.allocateDirect(9 + Xid.MAXGTRIDSIZE + Xid.MAXBQUALSIZE * 10);
  if (fileChannel.size() != 0) {
    doInternalRecovery();
  }
 else {
    scanIsComplete=true;
    logCreated=System.currentTimeMillis();
    buffer.clear();
    buffer.putLong(logCreated);
    buffer.flip();
    fileChannel.write(buffer);
  }
}
Program: 155291
Project: 155291
Buggy source:
RelationshipType getRelationshipType(int id){
  return new RelationshipTypeImpl(relTranslation.get(id));
}

Fixed version (ground truth):
RelationshipType getRelationshipType(int id){
  String name=relTranslation.get(id);
  if (name != null) {
    return new RelationshipTypeImpl(name);
  }
  return null;
}
Program: 155293
Project: 155293
Buggy source:
private void autoCreatePath(String store) throws IOException {
  String dirs=store.substring(0,store.lastIndexOf('/'));
  File directories=new File(dirs);
  if (!directories.exists()) {
    if (!directories.mkdirs()) {
      throw new IOException("String_Node_Str" + dirs + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void autoCreatePath(String store) throws IOException {
  String fileSeparator=System.getProperty("String_Node_Str");
  int index=store.lastIndexOf(fileSeparator);
  String dirs=store.substring(0,index);
  File directories=new File(dirs);
  if (!directories.exists()) {
    if (!directories.mkdirs()) {
      throw new IOException("String_Node_Str" + dirs + "String_Node_Str");
    }
  }
}
Program: 155296
Project: 155296
Buggy source:
public InterBundleEvent(Object event){
  this.event=event;
}

Fixed version (ground truth):
public InterBundleEvent(Object event,Class<?> type){
  this.event=event;
  this.type=type;
}
Program: 155297
Project: 155297
Buggy source:
public boolean isTyped(Class<?> type){
  return event.getClass().equals(type);
}

Fixed version (ground truth):
public boolean isTyped(Class<?> type){
  if (this.type != null) {
    return this.type.equals(type);
  }
 else {
    return event.getClass().equals(type);
  }
}
Program: 155298
Project: 155298
Buggy source:
public Class<?> type(){
  return event.getClass();
}

Fixed version (ground truth):
public Class<?> type(){
  if (type != null) {
    return type;
  }
 else {
    return event.getClass();
  }
}
Program: 155299
Project: 155299
Buggy source:
private <T>T getProxy(Class<T> clazz,Annotation[] qualifiers,Bundle bundle){
  return clazz.cast(Proxy.newProxyInstance(clazz.getClassLoader(),new Class[]{clazz},new LazyService(clazz,qualifiers,bundle)));
}

Fixed version (ground truth):
private <T>T getProxy(Class<T> interf,Class<? extends T> clazz,Annotation[] qualifiers,Bundle bundle){
  return interf.cast(Proxy.newProxyInstance(clazz.getClassLoader(),new Class[]{interf},new LazyService(clazz,qualifiers,bundle)));
}
Program: 155301
Project: 155301
Buggy source:
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  while (!successfull && (endTime - System.currentTimeMillis()) > 0) {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  do {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
 while (!successfull && (endTime - System.currentTimeMillis()) > 0);
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}
Program: 155302
Project: 155302
Buggy source:
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  while (!successfull && (endTime - System.currentTimeMillis()) > 0) {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  do {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
 while (!successfull && (endTime - System.currentTimeMillis()) > 0);
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}
Program: 155303
Project: 155303
Buggy source:
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  while (!successfull && (endTime - System.currentTimeMillis()) > 0) {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  do {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
 while (!successfull && (endTime - System.currentTimeMillis()) > 0);
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}
Program: 155304
Project: 155304
Buggy source:
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  while (!successfull && (endTime - System.currentTimeMillis()) > 0) {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  do {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
 while (!successfull && (endTime - System.currentTimeMillis()) > 0);
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}
Program: 155305
Project: 155305
Buggy source:
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  while (!successfull && (endTime - System.currentTimeMillis()) > 0) {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void findOrFail(String xpath,String tag,String attribute,String value,String currentUrl,int waitAtMost) throws InterruptedException {
  boolean successfull=false;
  long endTime=System.currentTimeMillis() + waitAtMost;
  log("String_Node_Str" + tag + "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath);
  do {
    webClient.waitForBackgroundJavaScriptStartingBefore(100);
    successfull=find(xpath,tag,attribute,value);
    if (!successfull) {
      log("String_Node_Str" + tag + "String_Node_Str");
      logAllTags((List<DomNode>)page.getByXPath(xpath),tag);
    }
  }
 while (!successfull && (endTime - System.currentTimeMillis()) > 0);
  if (successfull)   log("String_Node_Str" + (System.currentTimeMillis() - endTime + waitAtMost) + "String_Node_Str");
  if (!successfull) {
    log(page.asXml());
    findClosestXpath(xpath);
    fail(step + "String_Node_Str" + tag+ "String_Node_Str"+ attribute+ "String_Node_Str"+ value+ "String_Node_Str"+ xpath+ "String_Node_Str"+ currentUrl+ "String_Node_Str");
  }
}
Program: 155306
Project: 155306
Buggy source:
public Window getWindow(String name){
  if (super.getWindow(name) == null && repository.contains(name)) {
    PDFDocument doc=repository.get(name);
    PDFViewerView pvv=new PDFViewerView(name);
    PDFViewerPresenter pvp=new PDFViewerPresenter(pvv,doc);
    Window pdfWindow=pvp.go(this);
    addWindow(pdfWindow);
    return pdfWindow;
  }
  return super.getWindow(name);
}

Fixed version (ground truth):
public Window getWindow(String name){
  if (super.getWindow(name) == null && repository.contains(name)) {
    PDFDocument doc=repository.get(name);
    PDFViewerView pvv=new PDFViewerView(name,this);
    PDFViewerPresenter pvp=new PDFViewerPresenter(pvv,doc);
    Window pdfWindow=pvp.go(this);
    addWindow(pdfWindow);
    return pdfWindow;
  }
  return super.getWindow(name);
}
Program: 155307
Project: 155307
Buggy source:
public PDFViewerPresenter(Display display,PDFDocument doc){
  this.display=display;
  pdfDoc=new Document();
  InputStream in=new ByteArrayInputStream(doc.getDocument());
  try {
    pdfDoc.setInputStream(in,"String_Node_Str");
  }
 catch (  PDFException e) {
    e.printStackTrace();
  }
catch (  PDFSecurityException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  bind();
  Image im=pdfDoc.getPageImage(2,GraphicsRenderingHints.SCREEN,Page.BOUNDARY_CROPBOX,0,1);
  display.setPage(im);
}

Fixed version (ground truth):
public PDFViewerPresenter(Display display,PDFDocument doc){
  this.display=display;
  pdfDoc=new Document();
  InputStream in=new ByteArrayInputStream(doc.getDocument());
  try {
    pdfDoc.setInputStream(in,"String_Node_Str");
  }
 catch (  PDFException e) {
    e.printStackTrace();
  }
catch (  PDFSecurityException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  bind();
  Image im=pdfDoc.getPageImage(pdfDoc.getNumberOfPages() - 1,GraphicsRenderingHints.SCREEN,Page.BOUNDARY_CROPBOX,0,1);
  display.setPage(im);
}
Program: 155308
Project: 155308
Buggy source:
public PDFViewerView(String name){
  super(name);
  setTheme("String_Node_Str");
  Label label=new Label("String_Node_Str");
  addComponent(label);
  setLayout(new HorizontalLayout());
  final Panel marginalRight=new Panel();
  marginalRight.setLayout(new VerticalLayout());
  addComponent(marginalRight);
}

Fixed version (ground truth):
public PDFViewerView(String name,Application app){
  super(name);
  setTheme("String_Node_Str");
  Label label=new Label("String_Node_Str");
  addComponent(label);
  HorizontalLayout hl=new HorizontalLayout();
  ground.setHeight("String_Node_Str");
  ground.setWidth("String_Node_Str");
  hl.addComponent(ground);
  final Panel marginalRight=new Panel();
  hl.addComponent(marginalRight);
  addComponent(hl);
  addComponent(marginalRight);
  this.app=app;
}
Program: 155309
Project: 155309
Buggy source:
private Resource createStreamResource(final Image im){
  StreamResource.StreamSource curIm=new StreamResource.StreamSource(){
    private ByteArrayOutputStream imagebuffer=null;
    public InputStream getStream(){
      imagebuffer=new ByteArrayOutputStream();
      try {
        ImageIO.write((RenderedImage)im,"String_Node_Str",imagebuffer);
      }
 catch (      IOException e) {
        return null;
      }
      return new ByteArrayInputStream(imagebuffer.toByteArray());
    }
  }
;
  return new StreamResource(curIm,"String_Node_Str",this.getApplication());
}

Fixed version (ground truth):
private Resource createStreamResource(final Image im){
  StreamResource.StreamSource curIm=new StreamResource.StreamSource(){
    private ByteArrayOutputStream imagebuffer=null;
    public InputStream getStream(){
      imagebuffer=new ByteArrayOutputStream();
      try {
        ImageIO.write((RenderedImage)im,"String_Node_Str",imagebuffer);
      }
 catch (      IOException e) {
        return null;
      }
      return new ByteArrayInputStream(imagebuffer.toByteArray());
    }
  }
;
  return new StreamResource(curIm,"String_Node_Str",app);
}
Program: 155310
Project: 155310
Buggy source:
public void setPage(Image currentPageIm){
  ground.setIcon(createStreamResource(currentPageIm));
}

Fixed version (ground truth):
public void setPage(Image currentPageIm){
  ground.setIcon(createStreamResource(currentPageIm));
  requestRepaint();
}
Program: 155311
Project: 155311
Buggy source:
private void addValidationConfigurationTo(Node rootNode){
  rootNode.getOrCreate("String_Node_Str").attribute("String_Node_Str","String_Node_Str").getOrCreate("String_Node_Str").getOrCreate("String_Node_Str").attribute("String_Node_Str","String_Node_Str").attribute("String_Node_Str","String_Node_Str").getOrCreate("String_Node_Str").getOrCreate("String_Node_Str").text("String_Node_Str").getOrCreate("String_Node_Str").attribute("String_Node_Str","String_Node_Str").attribute("String_Node_Str","String_Node_Str").getOrCreate("String_Node_Str").getOrCreate("String_Node_Str").attribute("String_Node_Str","String_Node_Str").attribute("String_Node_Str","String_Node_Str").getOrCreate("String_Node_Str").getOrCreate("String_Node_Str").text("String_Node_Str");
}

Fixed version (ground truth):
private void addValidationConfigurationTo(Node node){
  node.getOrCreate("String_Node_Str").attribute("String_Node_Str","String_Node_Str").attribute("String_Node_Str","String_Node_Str").getOrCreate("String_Node_Str").getOrCreate("String_Node_Str").attribute("String_Node_Str","String_Node_Str").attribute("String_Node_Str","String_Node_Str").getOrCreate("String_Node_Str").getOrCreate("String_Node_Str").text("String_Node_Str");
}
Program: 155312
Project: 155312
Buggy source:
@Override public void addValidationConfiguration(ScaffoldGeneratedResources event){
  if (event.getProvider() instanceof MetawidgetScaffold) {
    final FileResource<?> configFile=getMetawidgetConfigurationFile();
    if (configFile.exists()) {
      final Node root=XMLParser.parse(configFile.getResourceInputStream());
      removeAllCommentNodes(root);
      boolean choice;
      final Node beanValidationInspector=root.getSingle("String_Node_Str");
      if (beanValidationInspector != null) {
        choice=prompt.promptBoolean("String_Node_Str");
      }
 else {
        choice=prompt.promptBoolean("String_Node_Str");
      }
      if (choice) {
        addValidationConfigurationTo(root);
        configFile.setContents(XMLParser.toXMLString(root));
      }
    }
  }
}

Fixed version (ground truth):
@Override public void addValidationConfiguration(ScaffoldGeneratedResources event){
  if (event.getProvider() instanceof MetawidgetScaffold) {
    final FileResource<?> configFile=getMetawidgetConfigurationFile();
    if (configFile.exists()) {
      final Node root=XMLParser.parse(configFile.getResourceInputStream());
      final Node array=root.getOrCreate("String_Node_Str").attribute("String_Node_Str","String_Node_Str").getOrCreate("String_Node_Str").getOrCreate("String_Node_Str").attribute("String_Node_Str","String_Node_Str").attribute("String_Node_Str","String_Node_Str").getOrCreate("String_Node_Str").getOrCreate("String_Node_Str");
      boolean choice;
      final Node beanValidationInspector=array.getSingle("String_Node_Str");
      if (beanValidationInspector == null) {
        choice=prompt.promptBoolean("String_Node_Str");
      }
 else {
        choice=prompt.promptBoolean("String_Node_Str");
      }
      if (choice) {
        addValidationConfigurationTo(array);
        removeAllCommentNodes(root);
        configFile.setContents(XMLParser.toXMLString(root));
      }
    }
  }
}
Program: 155313
Project: 155313
Buggy source:
@Override public boolean install(){
  if (!isInstalled()) {
    saveConfig(Descriptors.create(ValidationDescriptor.class));
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean install(){
  if (!isInstalled()) {
    final DependencyFacet facet=project.getFacet(DependencyFacet.class);
    if (!facet.hasDependency(javaee6SpecAPI)) {
      facet.addDependency(javaee6SpecAPI);
    }
    saveConfig(Descriptors.create(ValidationDescriptor.class));
  }
  return true;
}
Program: 155314
Project: 155314
Buggy source:
@Override public boolean isInstalled(){
  return getConfigFile().exists();
}

Fixed version (ground truth):
@Override public boolean isInstalled(){
  final DependencyFacet facet=project.getFacet(DependencyFacet.class);
  return getConfigFile().exists() && facet.hasDependency(javaee6SpecAPI);
}
Program: 155315
Project: 155315
Buggy source:
@Override public FileResource<?> getConfigFile(){
  final ResourceFacet resourceFacet=project.getFacet(ResourceFacet.class);
  return resourceFacet.getResource("String_Node_Str" + File.separator + "String_Node_Str");
}

Fixed version (ground truth):
@Override public FileResource<?> getConfigFile(){
  final ResourceFacet facet=project.getFacet(ResourceFacet.class);
  return facet.getResource("String_Node_Str" + File.separator + "String_Node_Str");
}
Program: 155316
Project: 155316
Buggy source:
@Command(value="String_Node_Str",help="String_Node_Str") public void setup(@Option(name="String_Node_Str",defaultValue="String_Node_Str",required=true) BVProvider provider,@Option(name="String_Node_Str") String messageInterpolator,@Option(name="String_Node_Str") String traversableResolver,@Option(name="String_Node_Str") String constraintValidatorFactory,PipeOut pipeOut){
  final ValidationProvider validationProvider=provider.getValidationProvider(beanManager);
  installValidationFacet();
  installValidationDependencies();
  installValidationProviderDependencies(validationProvider.getDependencies());
  if (shouldCreateDescriptor(messageInterpolator,traversableResolver,constraintValidatorFactory)) {
    final ValidationDescriptor providerDescriptor=validationProvider.getDefaultDescriptor();
    final ValidationDescriptor descriptor=Descriptors.create(ValidationDescriptor.class).defaultProvider(providerDescriptor.getDefaultProvider()).messageInterpolator(messageInterpolator == null ? providerDescriptor.getMessageInterpolator() : messageInterpolator).traversableResolver(traversableResolver == null ? providerDescriptor.getTraversableResolver() : traversableResolver).constraintValidatorFactory(constraintValidatorFactory == null ? providerDescriptor.getConstraintValidatorFactory() : constraintValidatorFactory);
    project.getFacet(ValidationFacet.class).saveConfig(descriptor);
    pipeOut.println("String_Node_Str");
  }
}

Fixed version (ground truth):
@Command(value="String_Node_Str",help="String_Node_Str") public void setup(@Option(name="String_Node_Str",defaultValue="String_Node_Str",required=true) BVProvider provider,@Option(name="String_Node_Str") String messageInterpolator,@Option(name="String_Node_Str") String traversableResolver,@Option(name="String_Node_Str") String constraintValidatorFactory,PipeOut pipeOut){
  final ValidationProvider validationProvider=provider.getValidationProvider(beanManager);
  installValidationFacet();
  installValidationProviderDependencies(validationProvider.getDependencies());
  if (shouldCreateDescriptor(messageInterpolator,traversableResolver,constraintValidatorFactory)) {
    final ValidationDescriptor providerDescriptor=validationProvider.getDefaultDescriptor();
    final ValidationDescriptor descriptor=Descriptors.create(ValidationDescriptor.class).defaultProvider(providerDescriptor.getDefaultProvider()).messageInterpolator(messageInterpolator == null ? providerDescriptor.getMessageInterpolator() : messageInterpolator).traversableResolver(traversableResolver == null ? providerDescriptor.getTraversableResolver() : traversableResolver).constraintValidatorFactory(constraintValidatorFactory == null ? providerDescriptor.getConstraintValidatorFactory() : constraintValidatorFactory);
    project.getFacet(ValidationFacet.class).saveConfig(descriptor);
    pipeOut.println("String_Node_Str");
  }
}
Program: 155317
Project: 155317
Buggy source:
@Inject public ValidationPlugin(Project project,Event<InstallFacets> request,BeanManager beanManager,ShellPrompt shellPrompt){
  this.project=project;
  this.beanManager=beanManager;
  this.request=request;
  this.dependencyFacet=project.getFacet(DependencyFacet.class);
  this.shellPrompt=shellPrompt;
  this.javaee6SpecAPI=DependencyBuilder.create().setGroupId("String_Node_Str").setArtifactId("String_Node_Str").setVersion("String_Node_Str").setScopeType(PROVIDED);
  this.beanValidationAPI=DependencyBuilder.create().setGroupId("String_Node_Str").setArtifactId("String_Node_Str").setVersion("String_Node_Str").setScopeType(PROVIDED);
}

Fixed version (ground truth):
@Inject public ValidationPlugin(Project project,Event<InstallFacets> request,BeanManager beanManager,ShellPrompt shellPrompt){
  this.project=project;
  this.beanManager=beanManager;
  this.request=request;
  this.dependencyFacet=project.getFacet(DependencyFacet.class);
  this.shellPrompt=shellPrompt;
}
Program: 155318
Project: 155318
Buggy source:
private boolean checkPage(SpaceContentEntityObject page){
  if (page == null) {
    return false;
  }
  List<String> spaceKeys=pluginSettingsManager.getAllowedConfluenceSpaceKeysAsList();
  if (spaceKeys == null || spaceKeys.isEmpty()) {
    return true;
  }
  for (  String spaceKey : spaceKeys) {
    if (page.getSpaceKey().equals(spaceKey)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean checkPage(ContentEntityObject page){
  if (page == null) {
    return false;
  }
  String pageSpaceKey;
  if (page instanceof Draft) {
    pageSpaceKey=((Draft)page).getDraftSpaceKey();
  }
 else {
    pageSpaceKey=((SpaceContentEntityObject)page).getSpaceKey();
  }
  List<String> spaceKeys=pluginSettingsManager.getAllowedConfluenceSpaceKeysAsList();
  if (spaceKeys == null || spaceKeys.isEmpty()) {
    return true;
  }
  for (  String spaceKey : spaceKeys) {
    if (pageSpaceKey.equals(spaceKey)) {
      return true;
    }
  }
  return false;
}
Program: 155319
Project: 155319
Buggy source:
@Override public boolean checkUsagePermission(User user,SpaceContentEntityObject page){
  return checkUser(user) && checkPage(page);
}

Fixed version (ground truth):
@Override public boolean checkUsagePermission(User user,ContentEntityObject page){
  return checkUser(user) && checkPage(page);
}
Program: 155320
Project: 155320
Buggy source:
boolean checkUsagePermission(User user,SpaceContentEntityObject page);

Fixed version (ground truth):
boolean checkUsagePermission(User user,ContentEntityObject page);
Program: 155321
Project: 155321
Buggy source:
@Override public String execute(@SuppressWarnings("String_Node_Str") Map parameters,String body,RenderContext renderContext) throws MacroException {
  if (!(renderContext instanceof PageContext)) {
    throw new MacroException("String_Node_Str");
  }
  SpaceContentEntityObject page=(SpaceContentEntityObject)((PageContext)renderContext).getEntity();
  Metadata metadata;
  try {
    metadata=metadataManager.extractMetadata(page);
    if (metadata == null) {
      return "String_Node_Str";
    }
  }
 catch (  MetadataException e) {
    throw new MacroException("String_Node_Str",e);
  }
  User user;
  if (ServletActionContext.getRequest().getRemoteUser() == null) {
    user=AuthenticatedUserThreadLocal.getUser();
  }
 else {
    user=page.getUserAccessor().getUser(ServletActionContext.getRequest().getRemoteUser());
  }
  boolean checkUsagePermission=pluginPermissionsManager.checkUsagePermission(user,page);
  return velocityHelper.generateMetadataHtml(page,checkUsagePermission,metadata);
}

Fixed version (ground truth):
@Override public String execute(@SuppressWarnings("String_Node_Str") Map parameters,String body,RenderContext renderContext) throws MacroException {
  if (!(renderContext instanceof PageContext)) {
    throw new MacroException("String_Node_Str");
  }
  ContentEntityObject page=((PageContext)renderContext).getEntity();
  Metadata metadata;
  try {
    metadata=metadataManager.extractMetadata(page);
    if (metadata == null) {
      return "String_Node_Str";
    }
  }
 catch (  MetadataException e) {
    throw new MacroException("String_Node_Str",e);
  }
  User user;
  if (ServletActionContext.getRequest().getRemoteUser() == null) {
    user=AuthenticatedUserThreadLocal.getUser();
  }
 else {
    user=page.getUserAccessor().getUser(ServletActionContext.getRequest().getRemoteUser());
  }
  boolean checkUsagePermission=pluginPermissionsManager.checkUsagePermission(user,page);
  return velocityHelper.generateMetadataHtml(page,checkUsagePermission,metadata);
}
Program: 155322
Project: 155322
Buggy source:
public String getEditLink(){
  return pluginSettingsManager.getWordpressRootUrl() + MessageFormat.format(pluginSettingsManager.getWordpressEditPostRelativePath(),metadata.getPostId());
}

Fixed version (ground truth):
public String getEditLink(){
  return pluginSettingsManager.getWordpressRootUrl() + MessageFormat.format(pluginSettingsManager.getWordpressEditPostRelativePath(),metadata.getPostId().toString());
}
Program: 155323
Project: 155323
Buggy source:
private void mergeLocalAndRemoteTags(){
  List<String> tagNames=metadata.getTagNames();
  for (  String tagName : tagNames) {
    boolean found=false;
    for (    WordpressTag tag : getWordpressTags()) {
      if (tag.getName().equals(tagName)) {
        found=true;
        break;
      }
    }
    if (!found) {
      getWordpressTags().add(new WordpressTag(tagName));
    }
  }
}

Fixed version (ground truth):
private void mergeLocalAndRemoteTags(){
  List<String> tagNames=metadata.getTagNames();
  if (tagNames != null) {
    for (    String tagName : tagNames) {
      boolean found=false;
      Set<WordpressTag> wordpressTags=getWordpressTags();
      for (      WordpressTag tag : wordpressTags) {
        if (tag.getName().equals(tagName)) {
          found=true;
          break;
        }
      }
      if (!found) {
        wordpressTags.add(new WordpressTag(tagName));
      }
    }
  }
}
Program: 155324
Project: 155324
Buggy source:
private StringBuilder buildMacroBody(Metadata metadata,boolean includeMacroDelimiter) throws MetadataException {
  Map<String,String> properties=describe(metadata);
  StringBuilder sb=new StringBuilder();
  if (includeMacroDelimiter) {
    sb.append(LINE_SEPARATOR);
    sb.append(WORDPRESS_META_START);
  }
  sb.append(LINE_SEPARATOR);
  sb.append(WARNING);
  sb.append(LINE_SEPARATOR);
  for (  Entry<String,String> entry : properties.entrySet()) {
    if (entry.getValue() != null) {
      sb.append("String_Node_Str");
      sb.append(entry.getKey());
      sb.append("String_Node_Str");
      sb.append(entry.getValue());
      sb.append(LINE_SEPARATOR);
    }
  }
  if (includeMacroDelimiter) {
    sb.append(WORDPRESS_META_END);
    sb.append(LINE_SEPARATOR);
  }
  return sb;
}

Fixed version (ground truth):
private StringBuilder buildMacroBody(Metadata metadata,boolean includeMacroDelimiter) throws MetadataException {
  Map<String,String> properties=describe(metadata);
  StringBuilder sb=new StringBuilder();
  if (includeMacroDelimiter) {
    sb.append(LINE_SEPARATOR);
    sb.append(LINE_SEPARATOR);
    sb.append(WORDPRESS_META_START);
  }
  sb.append(LINE_SEPARATOR);
  sb.append(WARNING);
  sb.append(LINE_SEPARATOR);
  for (  Entry<String,String> entry : properties.entrySet()) {
    if (entry.getValue() != null) {
      sb.append("String_Node_Str");
      sb.append(entry.getKey());
      sb.append("String_Node_Str");
      sb.append(entry.getValue());
      sb.append(LINE_SEPARATOR);
    }
  }
  if (includeMacroDelimiter) {
    sb.append(WORDPRESS_META_END);
    sb.append(LINE_SEPARATOR);
  }
  return sb;
}
Program: 155325
Project: 155325
Buggy source:
public void tagNamesToPageLabels(ContentEntityObject page,Metadata metadata){
  List<String> tagNames=metadata.getTagNames();
  for (  String tagName : tagNames) {
    boolean found=false;
    List<Label> labels=page.getLabels();
    for (    Label label : labels) {
      if (label.getName().equals(tagName)) {
        found=true;
        break;
      }
    }
    if (!found) {
      labelManager.addLabel(page,new Label(tagName));
    }
  }
  List<Label> deletedLabels=new ArrayList<Label>();
  for (  Label label : page.getLabels()) {
    boolean found=false;
    for (    String tagName : tagNames) {
      if (label.getName().equals(tagName)) {
        found=true;
        break;
      }
    }
    if (!found) {
      deletedLabels.add(label);
    }
  }
  if (!deletedLabels.isEmpty()) {
    labelManager.removeLabels(page,deletedLabels);
  }
}

Fixed version (ground truth):
public void tagNamesToPageLabels(ContentEntityObject page,Metadata metadata){
  List<String> tagNames=metadata.getTagNames();
  if (tagNames != null) {
    for (    String tagName : tagNames) {
      boolean found=false;
      List<Label> labels=page.getLabels();
      for (      Label label : labels) {
        if (label.getName().equals(tagName)) {
          found=true;
          break;
        }
      }
      if (!found) {
        labelManager.addLabel(page,new Label(tagName));
      }
    }
  }
  List<Label> deletedLabels=new ArrayList<Label>();
  for (  Label label : page.getLabels()) {
    boolean found=false;
    if (tagNames != null) {
      for (      String tagName : tagNames) {
        if (label.getName().equals(tagName)) {
          found=true;
          break;
        }
      }
    }
    if (!found) {
      deletedLabels.add(label);
    }
  }
  if (!deletedLabels.isEmpty()) {
    labelManager.removeLabels(page,deletedLabels);
  }
}
Program: 155326
Project: 155326
Buggy source:
public static Map<String,String> split(String str,String entrySep,String keyValueSep){
  String[] tokens=StringUtils.splitPreserveAllTokens(str,entrySep);
  Map<String,String> map=new HashMap<String,String>(tokens.length);
  for (  String token : tokens) {
    String[] keyValue=StringUtils.splitPreserveAllTokens(token,keyValueSep,2);
    String key=keyValue.length > 0 ? StringUtils.trimToNull(keyValue[0]) : null;
    String value=keyValue.length > 1 ? StringUtils.trimToNull(keyValue[1]) : null;
    map.put(key,value);
  }
  return map;
}

Fixed version (ground truth):
public static Map<String,String> split(String str,String entrySep,String keyValueSep){
  if (StringUtils.isEmpty(str)) {
    return null;
  }
  String[] tokens=StringUtils.splitPreserveAllTokens(str,entrySep);
  Map<String,String> map=new HashMap<String,String>(tokens.length);
  for (  String token : tokens) {
    String[] keyValue=StringUtils.splitPreserveAllTokens(token,keyValueSep,2);
    String key=keyValue.length > 0 ? StringUtils.trimToNull(keyValue[0]) : null;
    String value=keyValue.length > 1 ? StringUtils.trimToNull(keyValue[1]) : null;
    map.put(key,value);
  }
  return map;
}
Program: 155330
Project: 155330
Buggy source:
@Override public List<String> getWikiPages(){
  FirefoxProfile profile=new FirefoxProfile();
  profile.setPreference("String_Node_Str",255);
  WebDriver driver=new FirefoxDriver(profile);
  try {
    driver.get(theTracUrl + "String_Node_Str");
    WebDriverUtils.waitForId(driver,"String_Node_Str");
    List<WebElement> allLinks=driver.findElements(By.tagName("String_Node_Str"));
    List<String> ret=new LinkedList<String>();
    for (    WebElement link : allLinks) {
      String url=link.getAttribute("String_Node_Str");
      int position=url.indexOf("String_Node_Str");
      if (position > 0) {
        String pageName=url.substring(position + 6);
        if (!pageName.contains("String_Node_Str") && !pageName.startsWith("String_Node_Str")) {
          ret.add(pageName);
        }
      }
    }
    return ret;
  }
  finally {
    driver.quit();
  }
}

Fixed version (ground truth):
@Override public List<String> getWikiPages(){
  FirefoxProfile profile=new FirefoxProfile();
  profile.setPreference("String_Node_Str",255);
  WebDriver driver=new FirefoxDriver(profile);
  try {
    driver.get(theTracUrl + "String_Node_Str");
    WebDriverUtils.waitForId(driver,"String_Node_Str");
    List<WebElement> allLinks=driver.findElements(By.tagName("String_Node_Str"));
    List<String> ret=new LinkedList<String>();
    for (    WebElement link : allLinks) {
      String url=link.getAttribute("String_Node_Str");
      int position=url.indexOf("String_Node_Str");
      if (position > 0) {
        String pageName=url.substring(position + 6);
        if (!pageName.contains("String_Node_Str") && !pageName.startsWith("String_Node_Str") && !pageName.startsWith("String_Node_Str")) {
          ret.add(pageName);
        }
      }
    }
    return ret;
  }
  finally {
    driver.quit();
  }
}
Program: 155331
Project: 155331
Buggy source:
@Test public void test() throws IOException, InterruptedException {
  ITracService tracService=new TracServiceImpl(System.getProperty("String_Node_Str"));
  IRedmineService redmineService=new RedmineServiceImpl(System.getProperty("String_Node_Str"));
  System.out.println("String_Node_Str");
  List<String> pages=tracService.getWikiPages();
  for (  String page : pages) {
    System.out.println("String_Node_Str" + page + "String_Node_Str");
    String tracWikiText=tracService.getWikiText(page);
    if (!page.startsWith("String_Node_Str")) {
      if (!redmineService.isPageExists(page)) {
        try {
          String redmineWikiText=redmineService.convertFromTracWikiText(tracWikiText);
          redmineService.createPage(page,redmineWikiText);
        }
 catch (        IllegalStateException e) {
          System.err.println("String_Node_Str" + page);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Test public void test() throws IOException, InterruptedException {
  ITracService tracService=new TracServiceImpl(System.getProperty("String_Node_Str"));
  IRedmineService redmineService=new RedmineServiceImpl(System.getProperty("String_Node_Str"));
  System.out.println("String_Node_Str");
  List<String> pages=tracService.getWikiPages();
  for (  String page : pages) {
    page=page.replace("String_Node_Str","String_Node_Str");
    System.out.println("String_Node_Str" + page + "String_Node_Str");
    String tracWikiText="String_Node_Str" + tracService.getWikiText(page);
    if (!redmineService.isPageExists(page)) {
      try {
        String redmineWikiText=redmineService.convertFromTracWikiText(tracWikiText);
        redmineService.createPage(page,redmineWikiText);
      }
 catch (      IllegalStateException e) {
        System.err.println("String_Node_Str" + page);
      }
    }
  }
}
Program: 155332
Project: 155332
Buggy source:
public long getCurrentCumTime(){
  long output=0l;
synchronized (guard) {
    for (    Contract activeContract : activeContracts) {
      output+=activeContract.getTodayTime();
    }
  }
  return output;
}

Fixed version (ground truth):
public long getCurrentCumTime(){
  long output=0l;
synchronized (guard) {
    for (    Contract contract : contracts) {
      output+=contract.getTodayTime();
    }
  }
  return output;
}
Program: 155333
Project: 155333
Buggy source:
private byte[] sendQuery(int window){
  return channel.sendMessage(new byte[]{RFIDConstants.WINDOW_QUERY,new RFIDWindow(window).toByte()});
}

Fixed version (ground truth):
private byte[] sendQuery(byte code,int window){
  return channel.sendMessage(new byte[]{code,new RFIDWindow(window).toByte()});
}
Program: 155334
Project: 155334
Buggy source:
public RFIDReader(RFIDChannel chan){
  currentInventory=new ArrayList<byte[]>();
  channel=chan;
  ByteArrayOutputStream bytesOut=new ByteArrayOutputStream();
  DataOutputStream dataOut=new DataOutputStream(bytesOut);
  try {
    dataOut.writeByte(RFIDConstants.ACK);
    dataOut.flush();
    ack=bytesOut.toByteArray();
    bytesOut.reset();
    dataOut.writeByte(RFIDConstants.QUERY);
    dataOut.flush();
    query=bytesOut.toByteArray();
    bytesOut.reset();
    dataOut.close();
    bytesOut.close();
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public RFIDReader(RFIDChannel chan){
  currentInventory=new ArrayList<byte[]>();
  channel=chan;
}
Program: 155335
Project: 155335
Buggy source:
public List<byte[]> inventory(){
}

Fixed version (ground truth):
public List<byte[]> inventory(){
  int count=0;
  int window=INITIAL_WINDOW;
  byte[] response;
  boolean windowChange=true;
  int timeSinceLastWindowPacket=0;
  byte nextFlag=RFIDConstants.NEW_QUERY;
  while (count < STOPPING_CRITERIA) {
    System.err.println("String_Node_Str" + count);
    if (windowChange && timeSinceLastWindowPacket > WINDOW_TRANS_SPACING)     response=sendQuery(nextFlag,window);
 else     response=sendQuery(nextFlag);
    if (response == null) {
      count+=window == 0 ? 1 : 0;
      windowChange=window != 0;
      window=Math.max(window / 2 - 1,0);
      nextFlag=RFIDConstants.DESPERATE_QUERY;
    }
 else     if (Arrays.equals(response,RFIDChannel.GARBLE)) {
      count=0;
      windowChange=window != 255;
      window=Math.min(window * 2 + 1,255);
      nextFlag=RFIDConstants.COLLISION_QUERY;
    }
 else {
      if (!currentInventory.contains(response))       currentInventory.add(response);
      count=0;
      windowChange=window != 0;
      window=Math.max(window - 1,0);
      nextFlag=RFIDConstants.NEW_QUERY;
    }
  }
  return currentInventory;
}