nus-yam/ex-repair huggingface dataset:
Program: 44773
Project: 44773
Buggy source:
public void run(){
  while (true) {
    try {
      boolean bOk=true, bSet=true;
      String[] info=q.poll(1,TimeUnit.SECONDS);
      String[] blogs=null;
      String profileID="String_Node_Str";
      if (info == NO_MORE_WORK) {
        break;
      }
      if (info.length == 2) {
        profileID=info[0];
        blogs=Pattern.compile("String_Node_Str").split(info[1]);
      }
 else {
        blogs=info;
      }
      for (      String blog : blogs) {
        String blogID=blog.trim().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
        bOk=getPosts(blogID);
        if (!bOk)         bSet=bOk;
 else {
          if (blog.matches("String_Node_Str")) {
            DBCollection collBlogs=mongoDb.getCollection("String_Node_Str");
            BasicDBObject docId=new BasicDBObject();
            docId.put("String_Node_Str",blog);
            DBObject obj=collBlogs.findOne(docId);
            obj.put("String_Node_Str",1);
            collBlogs.save(obj);
          }
        }
      }
      if (bSet) {
        myStm.executeUpdate("String_Node_Str" + profileID + "String_Node_Str");
      }
    }
 catch (    Exception e) {
      System.out.println(r + "String_Node_Str" + e.getMessage());
    }
  }
  System.out.println("String_Node_Str" + r + "String_Node_Str");
  mongoConn.close();
}

Fixed version (ground truth):
public void run(){
  while (true) {
    try {
      boolean bOk=true, bSet=true;
      String[] info=q.poll(1,TimeUnit.SECONDS);
      String[] blogs=null;
      String profileID="String_Node_Str";
      if (info == NO_MORE_WORK) {
        break;
      }
      if (info.length == 2) {
        profileID=info[0];
        blogs=Pattern.compile("String_Node_Str").split(info[1]);
      }
 else {
        blogs=info;
      }
      for (      String blog : blogs) {
        String blogID=blog.trim().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
        bOk=getPosts(blogID);
        if (!bOk)         bSet=bOk;
 else {
          if (blog.matches("String_Node_Str")) {
            DBCollection collBlogs=mongoDb.getCollection("String_Node_Str");
            BasicDBObject docId=new BasicDBObject();
            docId.put("String_Node_Str",blog);
            DBObject obj=collBlogs.findOne(docId);
            obj.put("String_Node_Str",1);
            collBlogs.save(obj);
          }
        }
      }
      if (bSet) {
        myStm.executeUpdate("String_Node_Str" + profileID + "String_Node_Str");
      }
      System.out.println("String_Node_Str" + r + "String_Node_Str");
    }
 catch (    Exception e) {
      System.out.println(r + "String_Node_Str" + e.getMessage());
    }
  }
  System.out.println("String_Node_Str" + r + "String_Node_Str");
  mongoConn.close();
  try {
    myStm.close();
  }
 catch (  Exception e) {
  }
}
Program: 44775
Project: 44775
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: 44776
Project: 44776
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: 44777
Project: 44777
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: 44778
Project: 44778
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: 44779
Project: 44779
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: 44780
Project: 44780
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: 44781
Project: 44781
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: 44782
Project: 44782
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: 44783
Project: 44783
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: 44784
Project: 44784
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: 44785
Project: 44785
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: 44786
Project: 44786
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: 44787
Project: 44787
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: 44788
Project: 44788
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: 44789
Project: 44789
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());
}
Program: 44790
Project: 44790
Buggy source:
@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());
}

Fixed version (ground truth):
@Test @Ignore public void testMoveTo() throws Exception {
  URI toUri=new URI(blobStoreUri.toASCIIString() + "String_Node_Str");
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(1);
  expect(mockConnection.getBlob(anyObject(URI.class),anyObject(Map.class))).andReturn(new HDFSBlob(toUri,mockConnection));
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(1);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  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: 44791
Project: 44791
Buggy source:
@Test public void testGetId() 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);
  assertEquals(new URI(blobStoreUri + blobUri.toASCIIString().substring(5)),b.getId());
}

Fixed version (ground truth):
@Test public void testGetId() 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);
  assertEquals(blobUri,b.getId());
}
Program: 44792
Project: 44792
Buggy source:
@Test public void testDelete() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs);
  expect(mockFs.delete((Path)anyObject(),anyBoolean())).andReturn(true);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  b.delete();
}

Fixed version (ground truth):
@Test public void testDelete() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore);
  expect(mockStore.getId()).andReturn(blobStoreUri);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(2);
  expect(mockFs.delete((Path)anyObject(),anyBoolean())).andReturn(true);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  b.delete();
}
Program: 44793
Project: 44793
Buggy source:
@Test public void testGetCanonicalId() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertEquals(new URI(blobStoreUri + blobUri.toASCIIString().substring(5)),b.getCanonicalId());
}

Fixed version (ground truth):
@Test public void testGetCanonicalId() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(3);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs);
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertEquals(blobUri,b.getCanonicalId());
}
Program: 44794
Project: 44794
Buggy source:
@Test public void testOpenInputStream() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  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)));
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertNotNull(b.openInputStream());
}

Fixed version (ground truth):
@Test public void testOpenInputStream() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(3);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  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)));
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertNotNull(b.openInputStream());
}
Program: 44795
Project: 44795
Buggy source:
@Test public void testOpenOutputStream() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(2);
  expect(mockFs.exists((Path)anyObject())).andReturn(false);
  expect(mockFs.create((Path)anyObject())).andReturn(new FSDataOutputStream(new ByteArrayOutputStream(1024),null));
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertNotNull(b.openOutputStream(0,false));
}

Fixed version (ground truth):
@Test public void testOpenOutputStream() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(3);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(2);
  expect(mockFs.exists((Path)anyObject())).andReturn(false);
  expect(mockFs.create((Path)anyObject())).andReturn(new FSDataOutputStream(new ByteArrayOutputStream(1024),null));
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertNotNull(b.openOutputStream(0,false));
}
Program: 44796
Project: 44796
Buggy source:
@Test public void testGetConnection() 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);
  assertEquals(mockConnection,b.getConnection());
}

Fixed version (ground truth):
@Test public void testGetConnection() 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);
  assertEquals(mockConnection,b.getConnection());
}
Program: 44797
Project: 44797
Buggy source:
@Test public void testGetSize() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(2);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(2);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  expect(mockFs.getFileStatus((Path)anyObject())).andReturn(createTestFileStatus());
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertTrue(b.getSize() == 1024);
}

Fixed version (ground truth):
@Test public void testGetSize() throws Exception {
  expect(mockConnection.getBlobStore()).andReturn(mockStore).times(3);
  expect(mockStore.getId()).andReturn(blobStoreUri).times(2);
  expect(mockConnection.getFileSystem()).andReturn(mockFs).times(2);
  expect(mockFs.exists((Path)anyObject())).andReturn(true);
  expect(mockFs.getFileStatus((Path)anyObject())).andReturn(createTestFileStatus());
  replay(mockConnection,mockFs,mockStore);
  HDFSBlob b=new HDFSBlob(blobUri,mockConnection);
  assertTrue(b.getSize() == 1024);
}
Program: 44798
Project: 44798
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: 44799
Project: 44799
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: 44800
Project: 44800
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: 44801
Project: 44801
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: 44802
Project: 44802
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: 44803
Project: 44803
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: 44804
Project: 44804
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: 44805
Project: 44805
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: 44806
Project: 44806
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: 44807
Project: 44807
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: 44808
Project: 44808
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: 44809
Project: 44809
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: 44810
Project: 44810
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: 44811
Project: 44811
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: 44812
Project: 44812
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: 44813
Project: 44813
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: 44814
Project: 44814
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: 44815
Project: 44815
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: 44816
Project: 44816
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: 44817
Project: 44817
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: 44818
Project: 44818
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: 44819
Project: 44819
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();
}