[Demonstration 1]

[Buggy Method]
public Resource findResource(ContainerRequestContext requestContext) {
    UriInfo uriInfo = requestContext.getUriInfo();
    String path = uriInfo.getAbsolutePath().getPath();
    Resource resource = getResource(path);
    if (resource == null) {
        if (!hasExtension(path)) {
            List<MediaType> mediaTypes = getMediaTypesToSearch(requestContext);
            for (MediaType mediaType : mediaTypes) {
                String resourcePath = addExtension(path, mediaType);
                if (Strings.isValid(resourcePath)) {
                    resource = getResource(resourcePath);
                    if (resource != null) {
                        break;
                    }
                }
            }
        }
    }
    return resource;
}

[Buggy Hunk]
String path = uriInfo.getAbsolutePath().getPath();

[Patch]
String path = uriInfo.getPath(false);

[Demonstration 2]

[Buggy Method]
@Override
protected String deserializeResponseData(Node responseNode, SOAPMessage message) throws SOAPException {
    // Look for the "processingTime" node, ignore all the other elements
    for (int i = 0; i < responseNode.getChildNodes().getLength(); i++) {
        if (responseNode.getChildNodes().item(i).getNodeType() == Node.ELEMENT_NODE && responseNode.getChildNodes().item(i).getLocalName().equals("processingTime")) {
            return responseNode.getChildNodes().item(i).getTextContent();
        }
    }
    return null;
}

[Buggy Hunk]
&& responseNode.getChildNodes().item(i).getLocalName().equals("processingTime")) {

[Patch]
&& "processingTime".equals(responseNode.getChildNodes().item(i).getLocalName())) {

[Demonstration 3]

[Buggy Method]
protected void setUp() throws Exception {
    Properties props = new Properties();
    props.setProperty(PGProperty.REWRITE_BATCHED_INSERTS.getName(), Boolean.TRUE.toString());
    props.setProperty(PGProperty.PREPARE_THRESHOLD.getName(), "1");
    con = TestUtil.openDB(props);
    Statement stmt = con.createStatement();
    /* Drop the test table if it already exists for some reason. It is
    not an error if it doesn't exist. */
    TestUtil.createTable(con, "testbatch", "pk INTEGER, col1 INTEGER");
    TestUtil.createTable(con, "testunspecified", "pk INTEGER, bday TIMESTAMP");
    stmt.executeUpdate("INSERT INTO testbatch VALUES (1, 0)");
    stmt.close();
    TestUtil.createTable(con, "prep", "a integer, b integer");
    /* Generally recommended with batch updates. By default we run all
    tests in this test case with autoCommit disabled. */
    con.setAutoCommit(false);
}

[Buggy Hunk]
Properties props = new Properties();

[Patch]
Properties props = new Properties(System.getProperties());