[Demonstration 1]

[Buggy Method]
protected void readValues() throws Exception {
    try {
        settings.exportImageSize = Integer.parseInt(fldExportSize.getText());
        settings.exportAntiAlias = chckbxAntiAliasExport.isEnabled();
        settings.randomFieldRadius = Integer.parseInt(fldRandomAreaSize.getText());
        if (settings.randomFieldRadius < 0)
            throw new Exception("Size can not be < 0");
        if (settings.randomFieldRadius > 20)
            throw new Exception("Size can not be > 20");
        settings.randomFillPercent = Math.min(100, Math.max(0, Integer.parseInt(fldRandomFillPercent.getText())));
    } catch (NumberFormatException e) {
        throw new Exception("Bd number format in export image size");
    }
    if (settings.exportImageSize <= 0)
        throw new Exception("Image size too small");
    if (settings.exportImageSize >= 4096)
        throw new Exception("Image size too big");
}

[Buggy Hunk]
settings.randomFillPercent = Math.min( 100, Math.max( 0, Integer.parseInt(fldRandomFillPercent.getText() )));

[Patch]
settings.randomFillPercent = 0.01 * Math.min( 100, Math.max( 0, Integer.parseInt(fldRandomFillPercent.getText() )));

[Demonstration 2]

[Buggy Method]
public int targetSdkVersion() {
    List<AXmlNode> usesSdk = this.manifest.getChildrenWithTag("uses-sdk");
    if (usesSdk == null || usesSdk.isEmpty())
        return -1;
    AXmlAttribute<?> attr = usesSdk.get(0).getAttribute("targetSdkVersion");
    if (attr == null)
        return -1;
    if (attr.getValue() instanceof Integer)
        return (Integer) attr.getValue();
    return Integer.getInteger((String) attr.getValue());
}

[Buggy Hunk]
return Integer.getInteger((String) attr.getValue());

[Patch]
return Integer.parseInt("" + attr.getValue());

[Demonstration 3]

[Buggy Method]
@Override
public void actionPerformed(ActionEvent e) {
    Object src = e.getSource();
    if (src == btnDownload || src == tfUrl) {
        downloadFile();
    } else if (src == btnClean) {
        taConsole.setText(null);
    } else if (src == btnAbout) {
        aboutApp();
    } else if (src == btnOutput) {
        selectFile();
    } else if (src == btnSearch) {
        searchBook();
    } else if (src == btnMore) {
        String path = tfOutput.getText();
        if (StringUtils.isNotBlank(path)) {
            try {
                Desktop.getDesktop().browse(new File(path).toURI());
            } catch (IOException ex) {
                Log.e(TAG, ex);
            }
        }
    }
}

[Buggy Hunk]
if (src == btnDownload || src == tfUrl) {

[Patch]
if (src == btnDownload || src == tfUrl || src == tfOutput) {