[Demonstration 1]

[Buggy Method]
private JFXPanel getPreviewPanel() {
    if (previewPanel == null) {
        previewPanel = new JFXPanel();
        previewPanel.setName("preview");
        previewPanel.setPreferredSize(new Dimension(frameTwipstr.getToolkit().getScreenSize().width, frameTwipstr.getToolkit().getScreenSize().height));
    }
    Platform.runLater(() -> {
        try {
            if (webView == null) {
                webView = new WebView();
                webView.getEngine().setJavaScriptEnabled(true);
                previewPanel.setScene(new Scene(webView));
            }
            String content = statusTextArea.getText();
            if (imageFiles != null) {
                for (String img : imageFiles.values()) {
                    content += "<img class=\"media\" src=\"" + img + "\">";
                }
            }
            String html = Constants.PREVIEW_TEMPLATE.replace(Constants.PREVIEW_TEMPLATE_STATUS_CONTENT_PLACEHOLDER, content);
            File tmpFile = File.createTempFile(Constants.PREVIEW_FILE_NAME_PREFIX, Constants.PREVIEW_FILE_NAME_SUFFIX);
            tmpFile.deleteOnExit();
            FSUtils.writeFile(tmpFile, html);
            webView.getEngine().load("file://" + tmpFile);
        } catch (IOException ioe) {
            ioe.printStackTrace(System.err);
        }
    });
    return previewPanel;
}

[Buggy Hunk]
String content = statusTextArea.getText();

[Patch]
String content = statusTextArea.getText().replaceAll("\n", "<br/>");

[Demonstration 2]

[Buggy Method]
public static Result service(String ownerName, String projectName, String service, boolean isAdvertise) throws IOException, UnsupportedOperationException, ServletException {
    if (!isSupportedService(service)) {
        return forbidden(String.format("Unsupported service: '%s'", service));
    }
    Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
    if (project == null) {
        return notFound();
    }
    models.User user = UserApp.currentUser();
    if (!isAllowed(project, service)) {
        if (user.isAnonymous()) {
            return BasicAuthAction.unauthorized(response());
        } else {
            // If you want the Git client showing your custom message to
            // the user, the Content-Type should be exact "text/plain"
            // without any parameter. For more details, see the code at
            // https://github.com/git/git/commit/426e70d4a11ce3b4f70636d57c6a0ab16ae08a00#diff-eea0ad565ec5903a11b6023755d491cfR154
            response().setHeader("Content-Type", "text/plain");
            return forbidden(String.format("'%s' has no permission to '%s/%s'.", user.name, ownerName, projectName));
        }
    }
    if (isAdvertise) {
        return ok(RepositoryService.gitAdvertise(project, service, response()));
    } else {
        if (request().body().isMaxSizeExceeded()) {
            return status(REQUEST_ENTITY_TOO_LARGE);
        } else {
            user.visits(project);
            return ok(RepositoryService.gitRpc(project, service, request(), response()));
        }
    }
}

[Buggy Hunk]
user.name, ownerName, projectName));

[Patch]
user.loginId, ownerName, projectName));

[Demonstration 3]

[Buggy Method]
@Override
protected void resetEditorFrom(HaxeApplicationConfiguration configuration) {
    myComboModules.removeAllItems();
    final Module[] modules = ModuleManager.getInstance(configuration.getProject()).getModules();
    for (final Module module : modules) {
        if (ModuleType.get(module) == HaxeModuleType.getInstance()) {
            myComboModules.addItem(module);
        }
    }
    myComboModules.setSelectedItem(configuration.getConfigurationModule().getModule());
    myComboModules.setRenderer(new ListCellRendererWrapper() {

        @Override
        public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
            if (value instanceof Module) {
                final Module module = (Module) value;
                setText(module.getName());
            }
        }
    });
    myCustomPathCheckBox.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (!myCustomPathCheckBox.isSelected()) {
                customPathToFile = myPathToFileTextField.getText();
            }
            updateComponents();
        }
    });
    myPathToFileTextField.getButton().addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, true, false, false);
            final VirtualFile file = FileChooser.chooseFile(descriptor, component, null, null);
            if (file != null) {
                customPathToFile = FileUtil.toSystemIndependentName(file.getPath());
                updateComponents();
            }
        }
    });
    myAlternativeExecutable.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (!myAlternativeExecutable.isSelected()) {
                customPathToExecutable = myExecutableField.getText();
            }
            updateComponents();
        }
    });
    myExecutableField.getButton().addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, true, false, false);
            final VirtualFile file = FileChooser.chooseFile(descriptor, component, null, null);
            if (file != null) {
                customPathToExecutable = FileUtil.toSystemIndependentName(file.getPath());
                updateComponents();
            }
        }
    });
    myDebugListenPort.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            String portString = myDebugListenPort.getText();
            if (portString == "") {
                portString = "6972";
            }
            Integer port;
            try {
                port = Integer.parseInt(portString);
            } catch (NumberFormatException ex) {
                port = 6972;
            }
            customDebugListenPort = port;
            myDebugListenPort.setText("" + port);
        }
    });
    myRemoteDebuggingCheckBox.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            customRemoteDebugging = myCustomPathCheckBox.isSelected();
        }
    });
    myCustomPathCheckBox.setSelected(configuration.isCustomFileToLaunch());
    myAlternativeExecutable.setSelected(configuration.isCustomExecutable());
    String launchPath = configuration.getCustomFileToLaunchPath();
    launchPath = !launchPath.contains("://") ? FileUtil.toSystemDependentName(launchPath) : launchPath;
    customPathToFile = launchPath;
    launchPath = configuration.getCustomExecutablePath();
    launchPath = !launchPath.contains("://") ? FileUtil.toSystemDependentName(launchPath) : launchPath;
    customPathToExecutable = launchPath;
    customDebugListenPort = configuration.getCustomDebugPort();
    myDebugListenPort.setText("" + customDebugListenPort);
    customRemoteDebugging = configuration.isCustomRemoteDebugging();
    myRemoteDebuggingCheckBox.setSelected(customRemoteDebugging);
    updateComponents();
}

[Buggy Hunk]
customRemoteDebugging = myCustomPathCheckBox.isSelected();

[Patch]
customRemoteDebugging = myRemoteDebuggingCheckBox.isSelected();