nus-yam/ex-repair huggingface dataset:
Program: 44491
Project: 44491
Buggy source:
@Test public void test_link_refer_path_and_value(){
  ZRefer href=p("String_Node_Str").ele(0).getHref();
  assertEquals("String_Node_Str",href.getPath());
  assertEquals("String_Node_Str",href.getValue());
  assertEquals("String_Node_Str",href.toString());
  href=p("String_Node_Str").ele(0).getHref();
  assertEquals("String_Node_Str",href.getPath());
  assertEquals("String_Node_Str",href.getValue());
  assertEquals("String_Node_Str",href.toString());
  href=p("String_Node_Str").ele(0).getHref();
  assertEquals("String_Node_Str",href.getPath());
  assertEquals("String_Node_Str",href.getInner());
  assertEquals("String_Node_Str",href.toString());
  href=p("String_Node_Str").ele(0).getHref();
  assertEquals("String_Node_Str",href.getPath());
  assertEquals("String_Node_Str",href.getValue());
  assertEquals("String_Node_Str",href.toString());
}

Fixed version (ground truth):
@Test public void test_link_refer_path_and_value(){
  ZRefer href=P("String_Node_Str").ele(0).getHref();
  assertEquals("String_Node_Str",href.getPath());
  assertEquals("String_Node_Str",href.getValue());
  assertEquals("String_Node_Str",href.toString());
  href=P("String_Node_Str").ele(0).getHref();
  assertEquals("String_Node_Str",href.getPath());
  assertEquals("String_Node_Str",href.getValue());
  assertEquals("String_Node_Str",href.toString());
  href=P("String_Node_Str").ele(0).getHref();
  assertEquals("String_Node_Str",href.getPath());
  assertEquals("String_Node_Str",href.getInner());
  assertEquals("String_Node_Str",href.toString());
  href=P("String_Node_Str").ele(0).getHref();
  assertEquals("String_Node_Str",href.getPath());
  assertEquals("String_Node_Str",href.getValue());
  assertEquals("String_Node_Str",href.toString());
}
Program: 44492
Project: 44492
Buggy source:
@Test public void test_style_in_link(){
  ZBlock p=p("String_Node_Str");
  assertEquals("String_Node_Str",p.ele(0).getHref().getValue());
  assertEquals("String_Node_Str",p.ele(0).getText());
  assertTrue(p.ele(0).getStyle().getFont().isBold());
  assertTrue(p.ele(0).getStyle().getFont().isItalic());
  assertEquals("String_Node_Str",p.ele(1).getText());
}

Fixed version (ground truth):
@Test public void test_style_in_link(){
  ZBlock p=P("String_Node_Str");
  assertEquals("String_Node_Str",p.ele(0).getHref().getValue());
  assertEquals("String_Node_Str",p.ele(0).getText());
  assertTrue(p.ele(0).getStyle().getFont().isBold());
  assertTrue(p.ele(0).getStyle().getFont().isItalic());
  assertEquals("String_Node_Str",p.ele(1).getText());
}
Program: 44493
Project: 44493
Buggy source:
@Test public void test_simple_link(){
  ZBlock p=p("String_Node_Str");
  assertEquals("String_Node_Str",p.ele(0).getText());
  assertEquals("String_Node_Str",p.ele(0).getHref().getValue());
}

Fixed version (ground truth):
@Test public void test_simple_link(){
  ZBlock p=P("String_Node_Str");
  assertEquals("String_Node_Str",p.ele(0).getText());
  assertEquals("String_Node_Str",p.ele(0).getHref().getValue());
}
Program: 44494
Project: 44494
Buggy source:
@Test public void teset_image_in_link_remote(){
  ZBlock p=p("String_Node_Str");
  ZEle img=p.ele(0);
  assertEquals("String_Node_Str",img.getHref().getPath());
  assertEquals("String_Node_Str",img.getSrc().getPath());
  assertTrue(img.getSrc().isHttp());
}

Fixed version (ground truth):
@Test public void teset_image_in_link_remote(){
  ZBlock p=P("String_Node_Str");
  ZEle img=p.ele(0);
  assertEquals("String_Node_Str",img.getHref().getPath());
  assertEquals("String_Node_Str",img.getSrc().getPath());
  assertTrue(img.getSrc().isHttp());
}
Program: 44495
Project: 44495
Buggy source:
@Test public void test_text_link(){
  ZBlock p=p("String_Node_Str");
  assertEquals("String_Node_Str",p.ele(0).getText());
  assertEquals("String_Node_Str",p.ele(0).getHref().getValue());
}

Fixed version (ground truth):
@Test public void test_text_link(){
  ZBlock p=P("String_Node_Str");
  assertEquals("String_Node_Str",p.ele(0).getText());
  assertEquals("String_Node_Str",p.ele(0).getHref().getValue());
}
Program: 44496
Project: 44496
Buggy source:
@Test public void test_image_sizing(){
  ZBlock p=p("String_Node_Str");
  assertTrue(p.ele(0).isImage());
  assertEquals("String_Node_Str",p.ele(0).getSrc().getValue());
  assertEquals(3,p.ele(0).getWidth());
  assertEquals(5,p.ele(0).getHeight());
  p=p("String_Node_Str");
  assertTrue(p.ele(0).isImage());
  assertEquals("String_Node_Str",p.ele(0).getSrc().getValue());
  assertEquals(3,p.ele(0).getWidth());
  assertEquals(5,p.ele(0).getHeight());
  p=p("String_Node_Str");
  assertTrue(p.ele(0).isImage());
  assertEquals("String_Node_Str",p.ele(0).getSrc().getValue());
  assertEquals(0,p.ele(0).getWidth());
  assertEquals(5,p.ele(0).getHeight());
  p=p("String_Node_Str");
  assertTrue(p.ele(0).isImage());
  assertEquals("String_Node_Str",p.ele(0).getSrc().getValue());
  assertEquals(3,p.ele(0).getWidth());
  assertEquals(0,p.ele(0).getHeight());
}

Fixed version (ground truth):
@Test public void test_image_sizing(){
  ZBlock p=P("String_Node_Str");
  assertTrue(p.ele(0).isImage());
  assertEquals("String_Node_Str",p.ele(0).getSrc().getValue());
  assertEquals(3,p.ele(0).getWidth());
  assertEquals(5,p.ele(0).getHeight());
  p=P("String_Node_Str");
  assertTrue(p.ele(0).isImage());
  assertEquals("String_Node_Str",p.ele(0).getSrc().getValue());
  assertEquals(3,p.ele(0).getWidth());
  assertEquals(5,p.ele(0).getHeight());
  p=P("String_Node_Str");
  assertTrue(p.ele(0).isImage());
  assertEquals("String_Node_Str",p.ele(0).getSrc().getValue());
  assertEquals(0,p.ele(0).getWidth());
  assertEquals(5,p.ele(0).getHeight());
  p=P("String_Node_Str");
  assertTrue(p.ele(0).isImage());
  assertEquals("String_Node_Str",p.ele(0).getSrc().getValue());
  assertEquals(3,p.ele(0).getWidth());
  assertEquals(0,p.ele(0).getHeight());
}
Program: 44498
Project: 44498
Buggy source:
public GoogleWikiBuilder appendHeading(String text,int level){
  sb.append(makeHeading(text,level));
  nextLine();
  return this;
}

Fixed version (ground truth):
public GoogleWikiBuilder appendHeading(String text,int level){
  nextLine();
  sb.append(makeHeading(text,level));
  nextLine();
  return this;
}
Program: 44499
Project: 44499
Buggy source:
public static String makeHeading(String text,int level){
  if (level < 1)   level=1;
  if (level > 6)   level=6;
  String str="String_Node_Str";
  for (int i=0; i < 6; i++) {
    str+="String_Node_Str";
  }
  str=str + text + str;
  return str;
}

Fixed version (ground truth):
public static String makeHeading(String text,int level){
  if (level < 1)   level=1;
  if (level > 6)   level=6;
  String str="String_Node_Str";
  for (int i=0; i < level; i++) {
    str+="String_Node_Str";
  }
  str=str + text + str;
  return str;
}
Program: 44500
Project: 44500
Buggy source:
private void handleListItem(ZBlock li,GoogleWikiBuilder wikiBuilder){
  int liDeep=li.countMyTypeInAncestors();
  wikiBuilder.appendRaw(GoogleWikiBuilder.makeListItem(parseEles(li.eles()),liDeep)).nextLine();
  if (li.hasChildren()) {
    ZBlock[] ps=li.children();
    for (    ZBlock p : ps)     renderBlock(p,wikiBuilder);
  }
}

Fixed version (ground truth):
private void handleListItem(ZBlock li,GoogleWikiBuilder wikiBuilder){
  int liDeep=li.countMyTypeInAncestors();
  wikiBuilder.nextLine();
  wikiBuilder.appendRaw(GoogleWikiBuilder.makeListItem(parseEles(li.eles()),liDeep)).nextLine();
  if (li.hasChildren()) {
    ZBlock[] ps=li.children();
    for (    ZBlock p : ps)     renderBlock(p,wikiBuilder);
  }
}
Program: 44502
Project: 44502
Buggy source:
/** 
 * @param tableInfo 数据库表含义
 * @param classPath 类 存放路径
 * @return 是否操作成功
 */
private static boolean createMybatis(TableInfo tableInfo,String classPath){
  String className=StringUtil.tableNameToClass(tableInfo.getTableName());
  Sql sql=createSql(tableInfo,className);
  StringBuilder xmlContent=new StringBuilder();
  xmlContent.append(sql.getInsertSql()).append(sql.getUpdateSql()).append(sql.getSelectAllSql()).append(sql.getSelectSql()).append(sql.getDeleteSql());
  String content=MYBATIS_XML.replace("String_Node_Str",ResourceUtils.getProject().getPackageName() + "String_Node_Str" + className+ "String_Node_Str").replace("String_Node_Str",xmlContent);
  String xmlPath=FileUtil.createXmlFolder(classPath,ResourceUtils.getProject().getPackageName() + "String_Node_Str");
  String filePath=xmlPath + "String_Node_Str" + className+ "String_Node_Str";
  if (FileUtil.createClassFile(content,filePath)) {
    String packageName=ResourceUtils.getProject().getPackageName() + "String_Node_Str";
    classPath=FileUtil.createJavaFolder(classPath,packageName);
    filePath=classPath + "String_Node_Str" + className+ "String_Node_Str";
    String dataTime=DatetimeUtil.dateTime();
    String header=CODE_TEMPLATE.replace("String_Node_Str",className + "String_Node_Str").replace("String_Node_Str",dataTime).replace("String_Node_Str",packageName);
    return FileUtil.createClassFile(header + sql.getMapper(),filePath);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param tableInfo 数据库表含义
 * @param classPath 类 存放路径
 * @return 是否操作成功
 */
private static boolean createMybatis(TableInfo tableInfo,String classPath){
  String className=StringUtil.tableNameToClass(tableInfo.getTableName());
  Sql sql=createSql(tableInfo,className);
  StringBuilder xmlContent=new StringBuilder();
  xmlContent.append(sql.getInsertSql()).append(sql.getUpdateSql()).append(sql.getSelectAllSql()).append(sql.getSelectSql()).append(sql.getDeleteSql());
  String packageName=PACKAGE_NAME + "String_Node_Str";
  String content=MYBATIS_XML.replace("String_Node_Str",packageName + "String_Node_Str" + className+ "String_Node_Str").replace("String_Node_Str",xmlContent);
  String xmlPath=FileUtil.createXmlFolder(classPath,packageName);
  String filePath=xmlPath + "String_Node_Str" + className+ "String_Node_Str";
  if (FileUtil.createClassFile(content,filePath)) {
    classPath=FileUtil.createJavaFolder(classPath,packageName);
    filePath=classPath + "String_Node_Str" + className+ "String_Node_Str";
    String dataTime=DatetimeUtil.dateTime();
    String header=CODE_TEMPLATE.replace("String_Node_Str",className + "String_Node_Str").replace("String_Node_Str",dataTime).replace("String_Node_Str",packageName);
    String importDomain="String_Node_Str" + PACKAGE_NAME + "String_Node_Str"+ className+ "String_Node_Str";
    return FileUtil.createClassFile(header + importDomain + sql.getMapper(),filePath);
  }
  return false;
}
Program: 44504
Project: 44504
Buggy source:
/** 
 * 如果xml文件夹不存在，则创建.
 * @param folderPath 文件夹地址
 * @param packageName 包名
 * @return 路径
 */
public static String createXmlFolder(String folderPath,String packageName){
  folderPath=generatPackageFileFloder(folderPath + "String_Node_Str",ResourceUtils.getProject().getPackageName());
  File file=new File(folderPath);
  if (!file.exists()) {
    file.mkdirs();
  }
  return folderPath;
}

Fixed version (ground truth):
/** 
 * 如果xml文件夹不存在，则创建.
 * @param folderPath 文件夹地址
 * @param packageName 包名
 * @return 路径
 */
public static String createXmlFolder(String folderPath,String packageName){
  folderPath=generatPackageFileFloder(folderPath + "String_Node_Str",packageName);
  File file=new File(folderPath);
  if (!file.exists()) {
    file.mkdirs();
  }
  return folderPath;
}
Program: 44505
Project: 44505
Buggy source:
/** 
 * get the size of the   {@link HDFSBlob}
 * @return the size of the {@link HDFSBlob}
 * @throws IOException if the operation did not succeed
 * @throws MissingBlobException if this  {@link HDFSBlob} does not exist
 */
public long getSize() throws IOException, MissingBlobException {
  log.debug("String_Node_Str" + this.getId().toASCIIString());
  if (!this.exists()) {
    throw new MissingBlobException(uri);
  }
  return getFileSystem().getFileStatus(path).getLen();
}

Fixed version (ground truth):
/** 
 * get the size of the   {@link HDFSBlob}
 * @return the size of the {@link HDFSBlob}
 * @throws IOException if the operation did not succeed
 * @throws MissingBlobException if this  {@link HDFSBlob} does not exist
 */
public long getSize() throws IOException, MissingBlobException {
  if (!this.exists()) {
    throw new MissingBlobException(uri);
  }
  return getFileSystem().getFileStatus(path).getLen();
}
Program: 44506
Project: 44506
Buggy source:
/** 
 * check if this   {@link HDFSBlob} exists in the underlying Hadoop filesystem
 * @throws IOException if the operation did not succeed
 */
public boolean exists() throws IOException {
  try {
    return this.getFileSystem().exists(path);
  }
 catch (  IOException e) {
    log.debug(e.getLocalizedMessage() + "String_Node_Str",e);
    this.conn=(HDFSBlobStoreConnection)this.getConnection().getBlobStore().openConnection(null,null);
    this.hdfs=this.conn.getFileSystem();
    return this.getFileSystem().exists(path);
  }
}

Fixed version (ground truth):
/** 
 * check if this   {@link HDFSBlob} exists in the underlying Hadoop filesystem
 * @throws IOException if the operation did not succeed
 */
public boolean exists() throws IOException {
  try {
    return this.getFileSystem().exists(path);
  }
 catch (  IOException e) {
    this.conn=(HDFSBlobStoreConnection)this.getConnection().getBlobStore().openConnection(null,null);
    return this.getFileSystem().exists(path);
  }
}
Program: 44507
Project: 44507
Buggy source:
/** 
 * move a   {@link HDFSBlob} to another location on the Hadoop filesystem
 * @param toUri the  {@link URI} of the new location where this{@link HDFSBlob} should be moved to
 * @param hints hints are currently ignored
 * @throws DuplicateBlobException if another file exists with the same  {@link URI}
 * @throws IOException if the move did not succeed on the underlying filesystem
 * @throws MissingBlobException if this  {@link HDFSBlob} does not exist
 */
public Blob moveTo(final URI toUri,final Map<String,String> hints) throws DuplicateBlobException, IOException, MissingBlobException {
  log.debug("String_Node_Str" + this.getId().toASCIIString() + "String_Node_Str"+ toUri.toASCIIString());
  if (!this.exists()) {
    throw new MissingBlobException(uri);
  }
  HDFSBlob newBlob=(HDFSBlob)this.getConnection().getBlob(toUri,null);
  if (newBlob.exists()) {
    throw new DuplicateBlobException(toUri);
  }
  InputStream in=this.openInputStream();
  OutputStream out=newBlob.openOutputStream(this.getSize(),false);
  IOUtils.copy(in,out);
  in.close();
  out.close();
  this.delete();
  return newBlob;
}

Fixed version (ground truth):
/** 
 * move a   {@link HDFSBlob} to another location on the Hadoop filesystem
 * @param toUri the  {@link URI} of the new location where this{@link HDFSBlob} should be moved to
 * @param hints hints are currently ignored
 * @throws DuplicateBlobException if another file exists with the same  {@link URI}
 * @throws IOException if the move did not succeed on the underlying filesystem
 * @throws MissingBlobException if this  {@link HDFSBlob} does not exist
 */
public Blob moveTo(final URI toUri,final Map<String,String> hints) throws DuplicateBlobException, IOException, MissingBlobException {
  if (!this.exists()) {
    throw new MissingBlobException(uri);
  }
  HDFSBlob newBlob=(HDFSBlob)this.getConnection().getBlob(toUri,null);
  if (newBlob.exists()) {
    throw new DuplicateBlobException(toUri);
  }
  InputStream in=null;
  OutputStream out=null;
  try {
    in=this.openInputStream();
    out=newBlob.openOutputStream(this.getSize(),false);
    IOUtils.copy(in,out);
  }
 catch (  IOException e) {
    throw e;
  }
 finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
  this.delete();
  return newBlob;
}
Program: 44508
Project: 44508
Buggy source:
/** 
 * create a new   {@link HDFSBlob} in the {@link HDFSBlobStore}
 * @param in the  {@link InputStream} pointing to the new {@link HDFSBlob}'s data
 * @param estimatedSize not used
 * @param hints not used
 * @throws IOException if the operation did not succeed
 */
public Blob getBlob(final InputStream in,final long estimatedSize,final Map<String,String> hints) throws IOException {
  HDFSBlob blob;
  try {
    blob=new HDFSBlob(new URI(this.store.getId() + UUID.randomUUID().toString()),this);
    OutputStream out=blob.openOutputStream(estimatedSize,false);
    IOUtils.copy(in,out);
    in.close();
    out.close();
    return blob;
  }
 catch (  URISyntaxException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * create a new   {@link HDFSBlob} in the {@link HDFSBlobStore}
 * @param in the  {@link InputStream} pointing to the new {@link HDFSBlob}'s data
 * @param estimatedSize not used
 * @param hints not used
 * @throws IOException if the operation did not succeed
 */
public Blob getBlob(final InputStream in,final long estimatedSize,final Map<String,String> hints) throws IOException {
  HDFSBlob blob;
  OutputStream out=null;
  try {
    blob=new HDFSBlob(new URI(this.store.getId() + UUID.randomUUID().toString()),this);
    out=blob.openOutputStream(estimatedSize,false);
    IOUtils.copy(in,out);
    return blob;
  }
 catch (  URISyntaxException e) {
    throw new IOException(e);
  }
 finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}
Program: 44509
Project: 44509
Buggy source:
@Test public void testGetId() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri.toASCIIString());
  assertNotNull(store);
  assertEquals(storeUri,store.getId());
}

Fixed version (ground truth):
@Test public void testGetId() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri.toASCIIString());
  store.setFileSystem(mockFs);
  assertNotNull(store);
  assertEquals(storeUri,store.getId());
}
Program: 44510
Project: 44510
Buggy source:
@Test public void testHDFSBlobStoreString() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri.toASCIIString());
  assertNotNull(store);
}

Fixed version (ground truth):
@Test public void testHDFSBlobStoreString() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri.toASCIIString());
  store.setFileSystem(mockFs);
  assertNotNull(store);
}
Program: 44511
Project: 44511
Buggy source:
@Test public void testOpenConnection() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri.toASCIIString());
  assertNotNull(store.openConnection(null,null));
  assertFalse(store.openConnection(null,null).isClosed());
}

Fixed version (ground truth):
@Test public void testOpenConnection() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri.toASCIIString());
  store.setFileSystem(mockFs);
  assertNotNull(store.openConnection(null,null));
  assertFalse(store.openConnection(null,null).isClosed());
}
Program: 44512
Project: 44512
Buggy source:
@Test public void testMoveTo() throws Exception {
  URI toUri=new URI(blobStoreUri.toASCIIString() + "String_Node_Str");
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(9);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  expect(mockConnection.getBlob((URI)anyObject(),(Map<String,String>)anyObject())).andReturn(new HDFSBlob(toUri,mockConnection));
  expect(mockFs.exists((Path)anyObject())).andReturn(false);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  byte[] buf=new byte[1024];
  new Random().nextBytes(buf);
  expect(mockFs.open((Path)anyObject())).andReturn(new FSDataInputStream(new SeekableInputStream(buf)));
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  expect(mockFs.getFileStatus((Path)anyObject())).andReturn(createTestFileStatus());
  expect(mockFs.exists((Path)anyObject())).andReturn(false);
  expect(mockFs.create((Path)anyObject())).andReturn(new FSDataOutputStream(new ByteArrayOutputStream(1024),null));
  expect(mockFs.delete((Path)anyObject(),anyBoolean())).andReturn(true);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  HDFSBlob newBlob=(HDFSBlob)b.moveTo(toUri,null);
  assertNotNull(newBlob);
  assertEquals(toUri,newBlob.getId());
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testMoveTo() throws Exception {
  URI toUri=new URI(blobStoreUri.toASCIIString() + "String_Node_Str");
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(9);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  expect(mockConnection.getBlob((URI)anyObject(),(Map<String,String>)anyObject())).andReturn(new HDFSBlob(toUri,mockConnection));
  expect(mockFs.exists((Path)anyObject())).andReturn(false);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  byte[] buf=new byte[1024];
  new Random().nextBytes(buf);
  expect(mockFs.open((Path)anyObject())).andReturn(new FSDataInputStream(new SeekableInputStream(buf)));
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  expect(mockFs.getFileStatus((Path)anyObject())).andReturn(createTestFileStatus());
  expect(mockFs.exists((Path)anyObject())).andReturn(false);
  expect(mockFs.create((Path)anyObject())).andReturn(new FSDataOutputStream(new ByteArrayOutputStream(1024),null));
  expect(mockFs.delete((Path)anyObject(),anyBoolean())).andReturn(true);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  HDFSBlob newBlob=(HDFSBlob)b.moveTo(toUri,null);
  assertNotNull(newBlob);
  assertEquals(toUri,newBlob.getId());
}
Program: 44513
Project: 44513
Buggy source:
/** 
 * create a new   {@link HDFSBlobStoreConnection} to specified HDFs namenode
 * @param store the  {@link HDFSBlobStore} this {@link HDFSBlobStoreConnection}will try to connect to
 * @throws IOException if the connection did not succeed
 */
public HDFSBlobStoreConnection(final HDFSBlobStore store) throws IOException {
  this.store=store;
  hdfs=store.openHDFSConnection();
}

Fixed version (ground truth):
/** 
 * create a new   {@link HDFSBlobStoreConnection} to specified HDFs namenode
 * @param store the  {@link HDFSBlobStore} this {@link HDFSBlobStoreConnection}will try to connect to
 * @throws IOException if the connection did not succeed
 */
public HDFSBlobStoreConnection(final HDFSBlobStore store) throws IOException {
  this.store=store;
  hdfs=this.getFileSystem();
}
Program: 44514
Project: 44514
Buggy source:
/** 
 * check the connection state
 * @return true if the connection is open
 */
public boolean isClosed(){
  return hdfs == null;
}

Fixed version (ground truth):
/** 
 * check the connection state
 * @return true if the connection is open
 */
public boolean isClosed(){
  return closed;
}
Program: 44515
Project: 44515
Buggy source:
FileSystem getFileSystem() throws IOException {
  if (hdfs == null) {
    hdfs=store.openHDFSConnection();
    log.debug("String_Node_Str" + store.getId());
  }
  return hdfs;
}

Fixed version (ground truth):
FileSystem getFileSystem() throws IOException {
  if (hdfs == null) {
    hdfs=store.getFilesystem();
    log.debug("String_Node_Str" + store.getId());
  }
  return hdfs;
}
Program: 44516
Project: 44516
Buggy source:
/** 
 * create a new   {@link HDFSIdIterator} over all the {@link HDFSBlob}s in the  {@link HDFSBlobStore}
 * @return an {@link Iterator} for the collection of filesystem entries
 * @throws IOException if the operation did not succeed
 */
public Iterator<URI> listBlobIds(final String filterPrefix) throws IOException {
  return new HDFSIdIterator(this.getFileSystem(),filterPrefix);
}

Fixed version (ground truth):
/** 
 * create a new   {@link HDFSIdIterator} over all the {@link HDFSBlob}s in the  {@link HDFSBlobStore}
 * @return an {@link Iterator} for the collection of filesystem entries
 * @throws IOException if the operation did not succeed
 */
public Iterator<URI> listBlobIds(final String filterPrefix) throws IOException {
  if (isClosed()) {
    throw new IllegalStateException("String_Node_Str");
  }
  return new HDFSIdIterator(this.getFileSystem(),filterPrefix);
}
Program: 44517
Project: 44517
Buggy source:
/** 
 * close this connection
 */
@Override public void close(){
  store.releaseHDFSConnection(hdfs);
  hdfs=null;
}

Fixed version (ground truth):
/** 
 * close this connection
 */
@Override public void close(){
  closed=true;
  hdfs=null;
}
Program: 44518
Project: 44518
Buggy source:
/** 
 * fetch a   {@link HDFSBlob} from the {@link HDFSBlobStore}
 * @param uri the  {@link URI} of the {@link HDFSBlob}
 * @param hints not used
 * @throws UnsupportedIdException if the supplied  {@link URI} was not valid
 */
public Blob getBlob(final URI uri,final Map<String,String> hints) throws UnsupportedIdException, IOException {
  if (uri == null) {
    URI tmp=URI.create(store.getId() + UUID.randomUUID().toString());
    log.debug("String_Node_Str" + tmp.toASCIIString());
    return new HDFSBlob(tmp,this);
  }
  log.debug("String_Node_Str" + uri);
  if (uri.getRawSchemeSpecificPart().startsWith("String_Node_Str")) {
    log.debug("String_Node_Str" + uri);
  }
  if (!uri.toASCIIString().startsWith("String_Node_Str")) {
    throw new UnsupportedIdException(uri,"String_Node_Str");
  }
  HDFSBlob blob=new HDFSBlob(uri,this);
  return blob;
}

Fixed version (ground truth):
/** 
 * fetch a   {@link HDFSBlob} from the {@link HDFSBlobStore}
 * @param uri the  {@link URI} of the {@link HDFSBlob}
 * @param hints not used
 * @throws UnsupportedIdException if the supplied  {@link URI} was not valid
 */
public Blob getBlob(final URI uri,final Map<String,String> hints) throws UnsupportedIdException, IOException {
  if (isClosed()) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (uri == null) {
    URI tmp=URI.create(store.getId() + UUID.randomUUID().toString());
    log.debug("String_Node_Str" + tmp.toASCIIString());
    return new HDFSBlob(tmp,this);
  }
  log.debug("String_Node_Str" + uri);
  if (uri.getRawSchemeSpecificPart().startsWith("String_Node_Str")) {
    log.debug("String_Node_Str" + uri);
  }
  if (!uri.toASCIIString().startsWith("String_Node_Str")) {
    throw new UnsupportedIdException(uri,"String_Node_Str");
  }
  HDFSBlob blob=new HDFSBlob(uri,this);
  return blob;
}
Program: 44519
Project: 44519
Buggy source:
@Test public void testGetFileSystem() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  assertNotNull(connection.getFileSystem());
  assertTrue(connection.getFileSystem() == mockFs);
}

Fixed version (ground truth):
@Test public void testGetFileSystem() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(mockId);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  assertNotNull(connection.getFileSystem());
  assertTrue(connection.getFileSystem() == mockFs);
}
Program: 44520
Project: 44520
Buggy source:
@Test(expected=UnsupportedOperationException.class) public void testSync() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  connection.sync();
}

Fixed version (ground truth):
@Test(expected=UnsupportedOperationException.class) public void testSync() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(mockId);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  connection.sync();
}
Program: 44521
Project: 44521
Buggy source:
@Test public void testGetBlob1() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(new URI("String_Node_Str")).times(3);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  HDFSBlob b=(HDFSBlob)connection.getBlob(new URI("String_Node_Str"),null);
  assertNotNull(b);
  assertTrue(b.getConnection() == connection);
}

Fixed version (ground truth):
@Test public void testGetBlob1() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(mockId).times(3);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  HDFSBlob b=(HDFSBlob)connection.getBlob(new URI("String_Node_Str"),null);
  assertNotNull(b);
  assertTrue(b.getConnection() == connection);
}
Program: 44522
Project: 44522
Buggy source:
@Test public void testListBlobIds() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  expect(mockFs.listStatus((Path)anyObject())).andReturn(createTestFileStatus()).times(2);
  expect(mockStore.getId()).andReturn(URI.create("String_Node_Str")).times(2);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  HDFSIdIterator it=(HDFSIdIterator)connection.listBlobIds("String_Node_Str");
  assertNotNull(it);
}

Fixed version (ground truth):
@Test public void testListBlobIds() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockFs.listStatus((Path)anyObject())).andReturn(createTestFileStatus()).times(2);
  expect(mockStore.getId()).andReturn(URI.create("String_Node_Str")).times(2);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  HDFSIdIterator it=(HDFSIdIterator)connection.listBlobIds("String_Node_Str");
  assertNotNull(it);
}
Program: 44523
Project: 44523
Buggy source:
@Test public void testGetBlobStore() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  assertNotNull(connection.getBlobStore());
  assertTrue(connection.getBlobStore() == mockStore);
  assertTrue(connection.getBlobStore() instanceof HDFSBlobStore);
}

Fixed version (ground truth):
@Test public void testGetBlobStore() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(mockId);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  assertNotNull(connection.getBlobStore());
  assertTrue(connection.getBlobStore() == mockStore);
  assertTrue(connection.getBlobStore() instanceof HDFSBlobStore);
}
Program: 44524
Project: 44524
Buggy source:
@Test public void testClose() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  mockFs.close();
  mockStore.releaseHDFSConnection(mockFs);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  connection.close();
}

Fixed version (ground truth):
@Test public void testClose() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(mockId);
  mockFs.close();
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  connection.close();
}
Program: 44525
Project: 44525
Buggy source:
@Test public void testHDFSBlobStoreConnection() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(new URI("String_Node_Str"));
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  assertNotNull(connection);
}

Fixed version (ground truth):
@Test public void testHDFSBlobStoreConnection() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(mockId);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  assertNotNull(connection);
}
Program: 44526
Project: 44526
Buggy source:
@Test public void testReopen() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(new URI("String_Node_Str"));
  mockFs.close();
  mockStore.releaseHDFSConnection(mockFs);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  assertFalse(connection.isClosed());
  connection.close();
}

Fixed version (ground truth):
@Test public void testReopen() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(mockId);
  mockFs.close();
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  assertFalse(connection.isClosed());
  connection.close();
}
Program: 44527
Project: 44527
Buggy source:
@Test public void testCreateBlob1() throws Exception {
  expect(mockStore.openHDFSConnection()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(new URI("String_Node_Str")).times(2);
  expect(mockFs.exists((Path)anyObject())).andReturn(false);
  expect(mockFs.create((Path)anyObject())).andReturn(new FSDataOutputStream(new ByteArrayOutputStream(20),null));
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  byte[] buf=new byte[4096];
  new Random().nextBytes(buf);
  HDFSBlob b=(HDFSBlob)connection.getBlob(new ByteArrayInputStream(buf),4096,null);
  assertNotNull(b);
  assertTrue(b.getConnection() == connection);
  assertTrue(b.exists());
}

Fixed version (ground truth):
@Test public void testCreateBlob1() throws Exception {
  expect(mockStore.getFilesystem()).andReturn(mockFs);
  expect(mockStore.getId()).andReturn(mockId).times(3);
  expect(mockFs.exists((Path)anyObject())).andReturn(false);
  expect(mockFs.create((Path)anyObject())).andReturn(new FSDataOutputStream(new ByteArrayOutputStream(20),null));
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=createTestConnection();
  byte[] buf=new byte[4096];
  new Random().nextBytes(buf);
  HDFSBlob b=(HDFSBlob)connection.getBlob(new ByteArrayInputStream(buf),4096,null);
  assertNotNull(b);
  assertTrue(b.getConnection() == connection);
  assertTrue(b.exists());
}
Program: 44528
Project: 44528
Buggy source:
/** 
 * creates a new   {@link HDFSBlob} using the supplied uri as an identifierfor the underlying  {@link HDFSBlobStoreConnection}
 * @param uri the identifier of the  {@link HDFSBlob}
 * @param conn the  {@link HDFSBlobStoreConnection} that should be used tomanipulate this  {@link HDFSBlob}
 * @throws UnsupportedIdException
 */
public HDFSBlob(final URI uri,final HDFSBlobStoreConnection conn) throws UnsupportedIdException {
  if (uri.getScheme() == null) {
    throw new UnsupportedIdException(uri);
  }
  this.conn=conn;
  try {
    if (uri.getPath() == null && uri.toString().startsWith("String_Node_Str")) {
      this.uri=new URI(conn.getBlobStore().getId() + (conn.getBlobStore().getId().toASCIIString().endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str") + uri.getRawSchemeSpecificPart());
    }
 else {
      this.uri=uri;
    }
    this.path=new Path(this.uri.toASCIIString());
  }
 catch (  URISyntaxException e) {
    throw new UnsupportedIdException(uri,e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * creates a new   {@link HDFSBlob} using the supplied uri as an identifierfor the underlying  {@link HDFSBlobStoreConnection}
 * @param uri the identifier of the  {@link HDFSBlob}
 * @param conn the  {@link HDFSBlobStoreConnection} that should be used tomanipulate this  {@link HDFSBlob}
 * @throws UnsupportedIdException
 */
public HDFSBlob(final URI uri,final HDFSBlobStoreConnection conn){
  this.conn=conn;
  this.storeId=this.conn.getBlobStore().getId();
  this.uri=uri;
  this.path=new Path(this.storeId.toASCIIString() + "String_Node_Str" + this.uri.getRawSchemeSpecificPart());
}
Program: 44529
Project: 44529
Buggy source:
/** 
 * check if this   {@link HDFSBlob} exists in the underlying Hadoop filesystem
 * @throws IOException if the operation did not succeed
 */
public boolean exists() throws IOException {
  try {
    return this.getFileSystem().exists(path);
  }
 catch (  IOException e) {
    this.conn=(HDFSBlobStoreConnection)this.getConnection().getBlobStore().openConnection(null,null);
    return this.getFileSystem().exists(path);
  }
}

Fixed version (ground truth):
/** 
 * check if this   {@link HDFSBlob} exists in the underlying Hadoop filesystem
 * @throws IOException if the operation did not succeed
 */
public boolean exists() throws IOException {
  try {
    return this.getFileSystem().exists(path);
  }
 catch (  IOException e) {
    this.conn=(HDFSBlobStoreConnection)this.getConnection().getBlobStore().openConnection(null,null);
    this.storeId=this.conn.getBlobStore().getId();
    return this.getFileSystem().exists(path);
  }
}
Program: 44530
Project: 44530
Buggy source:
/** 
 * open a new   {@link HDFSBlobStoreConnection} to a HDFS namenode
 * @param tx since transactions are not supported. this must be set to null
 * @param hints not used
 * @return a new {@link HDFSBlobStoreConnection} th this{@link HDFSBlobStore}'s id
 * @throws UnsupportedOperationException if the transaction parameter was not null
 * @throws IOException if the operation did not succeed
 */
public BlobStoreConnection openConnection(final Transaction tx,final Map<String,String> hints) throws UnsupportedOperationException, IOException {
  return new HDFSBlobStoreConnection(this);
}

Fixed version (ground truth):
/** 
 * open a new   {@link HDFSBlobStoreConnection} to a HDFS namenode
 * @param tx since transactions are not supported. this must be set to null
 * @param hints not used
 * @return a new {@link HDFSBlobStoreConnection} th this{@link HDFSBlobStore}'s id
 * @throws UnsupportedOperationException if the transaction parameter was not null
 * @throws IOException if the operation did not succeed
 */
public BlobStoreConnection openConnection(final Transaction tx,final Map<String,String> hints) throws UnsupportedOperationException, IOException {
  if (tx != null) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  return new HDFSBlobStoreConnection(this);
}
Program: 44531
Project: 44531
Buggy source:
/** 
 * create a new   {@link HDFSBlobStore} at a specific URI in {@link String}format
 * @param id the  {@link URI} pointing to the HDFS namenode
 * @throws URISyntaxException if the supplied  {@link URI} was not valid
 */
public HDFSBlobStore(final String uri) throws URISyntaxException {
  this.id=new URI(uri);
}

Fixed version (ground truth):
/** 
 * create a new   {@link HDFSBlobStore} at a specific URI in {@link String}format
 * @param id the  {@link URI} pointing to the HDFS namenode
 * @throws URISyntaxException if the supplied  {@link URI} was not valid
 */
public HDFSBlobStore(final URI uri){
  this.id=uri;
}
Program: 44532
Project: 44532
Buggy source:
/** 
 * create a new   {@link HDFSIdIterator} over all the {@link HDFSBlob}s in the  {@link HDFSBlobStore}
 * @return an {@link Iterator} for the collection of filesystem entries
 * @throws IOException if the operation did not succeed
 */
public Iterator<URI> listBlobIds(final String filterPrefix) throws IOException {
  return new HDFSIdIterator(getFiles(new Path(filterPrefix),new ArrayList<FileStatus>()));
}

Fixed version (ground truth):
/** 
 * create a new   {@link HDFSIdIterator} over all the {@link HDFSBlob}s in the  {@link HDFSBlobStore}
 * @return an {@link Iterator} for the collection of filesystem entries
 * @throws IOException if the operation did not succeed
 */
public Iterator<URI> listBlobIds(final String filterPrefix) throws IOException {
  if (filterPrefix == null || filterPrefix.length() == 0) {
    return new HDFSIdIterator(getFiles(new Path(this.store.getId().toASCIIString() + "String_Node_Str"),new ArrayList<FileStatus>(),true));
  }
  int delim=filterPrefix.lastIndexOf('/');
  List<FileStatus> files=new ArrayList<FileStatus>();
  Path path=new Path(this.store.getId().toASCIIString() + "String_Node_Str" + (delim > -1 ? filterPrefix.substring(0,delim) : "String_Node_Str"));
  List<FileStatus> tmpFiles=getFiles(path,new ArrayList<FileStatus>(),false);
  for (  FileStatus f : tmpFiles) {
    log.debug("String_Node_Str" + f.getPath().getName());
    if (f.getPath().getName().startsWith(filterPrefix)) {
      files.add(f);
    }
  }
  return new HDFSIdIterator(files);
}
Program: 44533
Project: 44533
Buggy source:
private List<FileStatus> getFiles(final Path p,List<FileStatus> target) throws IOException {
  for (  FileStatus f : getFileSystem().listStatus(p)) {
    if (f.isFile()) {
      target.add(f);
    }
    if (f.isDirectory()) {
      getFiles(f.getPath(),target);
    }
  }
  return target;
}

Fixed version (ground truth):
private List<FileStatus> getFiles(final Path p,List<FileStatus> target,boolean recursive) throws IOException {
  for (  FileStatus f : getFileSystem().listStatus(p)) {
    if (f.isFile()) {
      target.add(f);
    }
    if (f.isDirectory() && recursive) {
      getFiles(f.getPath(),target,recursive);
    }
  }
  return target;
}
Program: 44534
Project: 44534
Buggy source:
/** 
 * create a new   {@link HDFSBlob} in the {@link HDFSBlobStore}
 * @param in the  {@link InputStream} pointing to the new {@link HDFSBlob}'s data
 * @param estimatedSize not used
 * @param hints not used
 * @throws IOException if the operation did not succeed
 */
public Blob getBlob(final InputStream in,final long estimatedSize,final Map<String,String> hints) throws IOException {
  HDFSBlob blob;
  OutputStream out=null;
  try {
    blob=new HDFSBlob(new URI(this.store.getId() + UUID.randomUUID().toString()),this);
    out=blob.openOutputStream(estimatedSize,false);
    IOUtils.copy(in,out);
    return blob;
  }
 catch (  URISyntaxException e) {
    throw new IOException(e);
  }
 finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

Fixed version (ground truth):
/** 
 * create a new   {@link HDFSBlob} in the {@link HDFSBlobStore}
 * @param in the  {@link InputStream} pointing to the new {@link HDFSBlob}'s data
 * @param estimatedSize not used
 * @param hints not used
 * @throws IOException if the operation did not succeed
 */
public Blob getBlob(final InputStream in,final long estimatedSize,final Map<String,String> hints) throws IOException {
  if (in == null) {
    throw new NullPointerException("String_Node_Str");
  }
  HDFSBlob blob;
  OutputStream out=null;
  try {
    blob=new HDFSBlob(URI.create("String_Node_Str" + UUID.randomUUID().toString()),this);
    log.debug("String_Node_Str" + blob.getId().toASCIIString());
    out=blob.openOutputStream(estimatedSize,false);
    IOUtils.copy(in,out);
    return blob;
  }
  finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}
Program: 44535
Project: 44535
Buggy source:
@Override public URI next(){
  return files.get(currentIndex++).getPath().toUri();
}

Fixed version (ground truth):
@Override public URI next(){
  return URI.create("String_Node_Str" + files.get(currentIndex++).getPath().getName());
}
Program: 44536
Project: 44536
Buggy source:
@Test public void testGetBlob1() throws Exception {
  expect(mockStore.getId()).andReturn(new URI("String_Node_Str")).times(2);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=new HDFSBlobStoreConnection(mockStore);
  HDFSBlob b=(HDFSBlob)connection.getBlob(new URI("String_Node_Str"),null);
  assertNotNull(b);
  assertTrue(b.getConnection() == connection);
}

Fixed version (ground truth):
@Test public void testGetBlob1() throws Exception {
  expect(mockStore.getId()).andReturn(new URI("String_Node_Str")).times(3);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=new HDFSBlobStoreConnection(mockStore);
  HDFSBlob b=(HDFSBlob)connection.getBlob(new URI("String_Node_Str"),null);
  assertNotNull(b);
  assertTrue(b.getConnection() == connection);
}
Program: 44537
Project: 44537
Buggy source:
@Test public void testListBlobIds() throws Exception {
  expect(mockStore.getFileSystem()).andReturn(mockFs);
  expect(mockFs.listStatus((Path)anyObject())).andReturn(createTestFileStatus());
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=new HDFSBlobStoreConnection(mockStore);
  HDFSIdIterator it=(HDFSIdIterator)connection.listBlobIds("String_Node_Str");
  assertNotNull(it);
}

Fixed version (ground truth):
@Test public void testListBlobIds() throws Exception {
  expect(mockFs.listStatus((Path)anyObject())).andReturn(createTestFileStatus()).times(2);
  expect(mockStore.getId()).andReturn(URI.create("String_Node_Str")).times(2);
  expect(mockStore.getFileSystem()).andReturn(mockFs).times(2);
  replay(mockStore,mockFs);
  HDFSBlobStoreConnection connection=new HDFSBlobStoreConnection(mockStore);
  HDFSIdIterator it=(HDFSIdIterator)connection.listBlobIds("String_Node_Str");
  assertNotNull(it);
}
Program: 44538
Project: 44538
Buggy source:
@Test public void testGetId() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri.toASCIIString());
  assertNotNull(store);
  assertEquals(storeUri,store.getId());
}

Fixed version (ground truth):
@Test public void testGetId() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri);
  assertNotNull(store);
  assertEquals(storeUri,store.getId());
}
Program: 44539
Project: 44539
Buggy source:
@Before public void init() throws Exception {
  mockFs=createMock(FileSystem.class);
  store=new HDFSBlobStore(storeUri.toASCIIString());
  Field f=HDFSBlobStore.class.getDeclaredField("String_Node_Str");
  f.setAccessible(true);
  f.set(store,mockFs);
}

Fixed version (ground truth):
@Before public void init() throws Exception {
  mockFs=createMock(FileSystem.class);
  store=new HDFSBlobStore(storeUri);
  Field f=HDFSBlobStore.class.getDeclaredField("String_Node_Str");
  f.setAccessible(true);
  f.set(store,mockFs);
}
Program: 44540
Project: 44540
Buggy source:
@Test public void testOpenConnection() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri.toASCIIString());
  assertNotNull(store.openConnection(null,null));
  assertFalse(store.openConnection(null,null).isClosed());
}

Fixed version (ground truth):
@Test public void testOpenConnection() throws Exception {
  HDFSBlobStore store=new HDFSBlobStore(storeUri);
  assertNotNull(store.openConnection(null,null));
  assertFalse(store.openConnection(null,null).isClosed());
}
Program: 44541
Project: 44541
Buggy source:
@Test public void testHDFSBlob() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertNotNull(b);
}

Fixed version (ground truth):
@Test public void testHDFSBlob() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(3);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertNotNull(b);
}
Program: 44542
Project: 44542
Buggy source:
@Test public void testExists() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertTrue(b.exists());
}

Fixed version (ground truth):
@Test public void testExists() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(3);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertTrue(b.exists());
}