[Demonstration 1]

[Buggy Method]
public static void main(String[] args) {
    // Do global inititing
    Security.addProvider(new PivCertChoosingProvider());
    InputStream pivConfig = MysqlAuth.class.getClassLoader().getResourceAsStream("us/dashernet/piv/piv.cfg");
    Security.insertProviderAt(new SunPKCS11(pivConfig), 6);
    Security.setProperty("ssl.KeyManagerFactory.algorithm", "pivcert");
    Security.setProperty("ssl.SocketFactory.provider", "us.dashernet.piv.PivSSLSocketFactory");
    if (args.length != 1) {
        System.out.println("Usage: SslClientAuth <url>");
    } else
        try {
            URL url = new URL(args[0]);
            HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
            printContent(conn);
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
}

[Buggy Hunk]
InputStream pivConfig = MysqlAuth.class.getClassLoader().getResourceAsStream("us/dashernet/piv/piv.cfg");

[Patch]
InputStream pivConfig = SslClientAuth.class.getClassLoader().getResourceAsStream("us/dashernet/piv/piv.cfg");

[Demonstration 2]

[Buggy Method]
@Override
public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
    if (newState == Worker.State.SUCCEEDED) {
        EventListener listener = event -> {
            final String href = ((Element) event.getTarget()).getAttribute("href");
            if (href != null) {
                String domEventType = event.getType();
                if (domEventType.equals(EVENT_CLICK)) {
                    showPage(href);
                } else if (domEventType.equals(EVENT_MOUSEOVER)) {
                    showStatus(href);
                } else if (domEventType.equals(EVENT_MOUSEOUT)) {
                    showStatus(BLANK);
                }
            }
        };
        Document doc = myPage.getEngine().getDocument();
        NodeList nodes = doc.getElementsByTagName("a");
        for (int i = 0; i < nodes.getLength(); i++) {
            EventTarget node = (EventTarget) nodes.item(i);
            node.addEventListener(EVENT_CLICK, listener, false);
            node.addEventListener(EVENT_MOUSEOVER, listener, false);
            node.addEventListener(EVENT_MOUSEOUT, listener, false);
        }
    }
}

[Buggy Hunk]
final String href = ((Element)event.getTarget()).getAttribute("href");

[Patch]
final String href = ((Element)event.getTarget()).getAttribute(HTML_LINK);

[Demonstration 3]

[Buggy Method]
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (isInitialized)
        pushConnector.onActivityResult(requestCode, resultCode, intent);
    super.onActivityResult(requestCode, resultCode, intent);
}

[Buggy Hunk]
if(isInitialized)

[Patch]
if(isInitialized && isRegistered && (pushConnector != null))