[Demonstration 1]

[Buggy Method]
private String find(IPath styles) {
    String name = styles.lastSegment();
    IPath base = styles.removeLastSegments(1);
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IContainer dir = root.getContainerForLocation(base);
    while (dir.getType() != IResource.ROOT) {
        IResource member = dir.findMember(name);
        if (member != null) {
            return root.getLocation().append(member.getFullPath()).toFile().toURI().toString();
        }
        dir = dir.getParent();
    }
    return null;
}

[Buggy Hunk]
while (dir.getType() != IResource.ROOT) {

[Patch]
while (dir != null && dir.getType() != IResource.ROOT) {

[Demonstration 2]

[Buggy Method]
public FileEntry findMD5Hash(String filePath) {
    Connection connection = null;
    FileEntry entry = null;
    try {
        connection = this.getConnection();
        entry = fileEntryDao.findByPath(filePath, connection);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (connection != null) {
            try {
                connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
    return entry;
}

[Buggy Hunk]
entry = fileEntryDao.findByPath(filePath, connection);

[Patch]
entry = fileEntryDao.findByPath(FileTools.multiplatformPath(filePath), connection);

[Demonstration 3]

[Buggy Method]
void addResource(final String path, final Object resource) {
    try {
        if (resource instanceof TemporaryZipFile) {
            final URL url = ((TemporaryZipFile) resource).getFile().toURI().toURL();
            this.pathHandler.addPrefixPath(path, createZipResourceHandler(url));
        } else if (resource instanceof TemporaryFolder) {
            final Path resourcePath = ((TemporaryFolder) resource).getRoot().toPath();
            this.pathHandler.addPrefixPath(path, new ResourceHandler(new PathResourceManager(resourcePath, 1024)));
        } else if (resource instanceof TemporaryFile) {
            final Path resourcePath = ((TemporaryFile) resource).getFile().toPath();
            this.pathHandler.addExactPath(path, new PathResourceHandler(resourcePath));
        } else if (resource instanceof URL) {
            final URL url = ((URL) resource);
            if (url.getPath().endsWith(".zip")) {
                this.pathHandler.addPrefixPath(path, createZipResourceHandler(url));
            } else {
                this.pathHandler.addExactPath(path, new UrlResourceHandler(url));
            }
        } else if (resource instanceof byte[]) {
            this.pathHandler.addExactPath(path, new ByteArrayHandler((byte[]) resource));
        }
    } catch (IOException e) {
        throw new AssertionError("Could not add Resource", e);
    }
}

[Buggy Hunk]
final URL url = ((URL) resource);

[Patch]
final URL url = (URL) resource;