[Demonstration 1]

[Buggy Method]
@Test
public void testEvaluateSingeFilterIndex() throws TupleQueryResultHandlerException, QueryEvaluationException, MalformedQueryException, RepositoryException, AccumuloException, AccumuloSecurityException, TableExistsException, RyaDAOException, SailException, TableNotFoundException, PcjException {
    final String indexSparqlString = //
    "" + //
    "SELECT ?e ?l ?c " + //
    "{" + //
    "  Filter(?e = <uri:entity>) " + //
    "  ?e a ?c . " + //
    "  ?e <http://www.w3.org/2000/01/rdf-schema#label> ?l " + //
    "}";
    PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix + "INDEX_1", indexSparqlString, new String[] { "e", "l", "c" }, Optional.<PcjVarOrderFactory>absent());
    final String queryString = //
    "" + //
    "SELECT ?e ?c ?l ?o " + //
    "{" + //
    "   Filter(?e = <uri:entity>) " + //
    "  ?e a ?c . " + //
    "  ?e <http://www.w3.org/2000/01/rdf-schema#label> ?l . " + //
    "  ?e <uri:talksTo> ?o . " + //
    "}";
    final CountingResultHandler crh = new CountingResultHandler();
    PcjIntegrationTestingUtil.deleteCoreRyaTables(accCon, tablePrefix);
    PcjIntegrationTestingUtil.closeAndShutdown(conn, repo);
    repo = PcjIntegrationTestingUtil.getPcjRepo(tablePrefix, "instance");
    conn = repo.getConnection();
    conn.add(sub, talksTo, obj);
    conn.add(sub2, talksTo, obj2);
    pcjConn.prepareTupleQuery(QueryLanguage.SPARQL, queryString).evaluate(crh);
    Assert.assertEquals(1, crh.getCount());
}

[Buggy Hunk]
SailException, TableNotFoundException, PcjException {

[Patch]
SailException, TableNotFoundException, PcjException, InferenceEngineException {

[Demonstration 2]

[Buggy Method]
@Override
public FSFile[] listFiles() {
    File[] files = plainFile.listFiles();
    if (files == null) {
        return null;
    }
    FSFile[] array = new CFile[files.length];
    for (int i = 0; i < files.length; i++) {
        array[i] = new CFile(files[i]);
    }
    return array;
}

[Buggy Hunk]
File[] files = plainFile.listFiles();

[Patch]
File[] files = getPlainFile().listFiles();

[Demonstration 3]

[Buggy Method]
public static void walkFileTree(File directory, FileTreeVisitor visitor) {
    visitor.preVisitDirectory(directory);
    File[] files = directory.listFiles();
    if (files != null) {
        for (File file : files) {
            if (file.isDirectory() && !isSymlink(file)) {
                walkFileTree(file, visitor);
            } else {
                visitor.visitFile(file);
            }
        }
    }
    visitor.postVisitDirectory(directory);
}

[Buggy Hunk]
if (file.isDirectory() && !isSymlink(file)) {

[Patch]
if (file.isDirectory()) {