[Demonstration 1]

[Buggy Method]
protected Scan getScaner(String startRow, String stopRow, Long minStamp, Long maxStamp) {
    Scan s = null;
    try {
        s = new Scan();
        if (minStamp != null && maxStamp != null) {
            s.setTimeRange(minStamp, maxStamp);
        } else if (minStamp == null && maxStamp != null) {
            s.setTimeRange(0L, maxStamp);
        } else if (maxStamp == null && minStamp != null) {
            s.setTimeRange(minStamp, 9223372036854775807L);
        }
        if (startRow != null) {
            s.setStartRow(Bytes.toBytes(startRow));
        }
        if (stopRow != null) {
            s.setStopRow(Bytes.toBytes(stopRow));
        }
    } catch (IOException e) {
        Logger.getLogger(ItemTransactionDao.class).error("Failed to extract data!", e);
    }
    return s;
}

[Buggy Hunk]
Logger.getLogger(ItemTransactionDao.class).error("Failed to extract data!", e);

[Patch]
Logger.getLogger(ItemSalesDao.class).error("Failed to extract data!", e);

[Demonstration 2]

[Buggy Method]
public static int main2(String[] args) {
    try {
        long start = System.currentTimeMillis();
        int status = -1;
        options = new BreezeGuiCommandlineOptions();
        if (options.parseCmdLine(args)) {
            logger = LoggerHelper.initLogger(options.getOutputlevel(), options.getLogfile(), options.isDebug());
            String version = BreezeGuiMain.class.getPackage().getImplementationVersion();
            logger.info("ASGbreezeGui " + (version == null ? "Testmode" : "v" + version));
            logger.debug("Args: " + Arrays.asList(args).toString());
            WorkingdirGenerator.getInstance().create(null, null, "guitmp", null);
            status = execute();
            WorkingdirGenerator.getInstance().delete();
        }
        long end = System.currentTimeMillis();
        if (logger != null) {
            logger.info("Runtime: " + LoggerHelper.formatRuntime(end - start, false));
        }
        return status;
    } catch (Exception e) {
        System.out.println("An error occurred: " + e.getLocalizedMessage());
        return 1;
    }
}

[Buggy Hunk]
logger = LoggerHelper.initLogger(options.getOutputlevel(), options.getLogfile(), options.isDebug());

[Patch]
logger = LoggerHelper.initLogger(options.getOutputlevel(), options.getLogfile(), options.isDebug(), Mode.cmdline);

[Demonstration 3]

[Buggy Method]
@Override
public void startDownload(FileResource resource, String childPath, FileObject file, DownloadEventProcessor downloadEventProcessor) {
    InputStream in = null;
    try {
        long started = downloadEventProcessor.downloadStarted(resource, childPath, file, protocol);
        response.setContentType(mimeTypesMap.getContentType(file.getName().getBaseName()));
        if ("true".equals(request.getParameter("forceDownload"))) {
            response.setHeader("Content-disposition", "attachment; filename=" + file.getName().getBaseName());
        }
        if (file.getContent().getSize() <= 1024000 && length <= 1024000) {
            in = file.getContent().getInputStream();
            if (start > 0) {
                in.skip(start);
            }
            byte[] buf = new byte[65535];
            int r;
            long remaining = length;
            while ((r = in.read(buf, 0, (int) Math.min(buf.length, remaining))) > -1 && remaining > 0) {
                response.getOutputStream().write(buf, 0, r);
                remaining -= r;
            }
            downloadEventProcessor.downloadComplete(resource, childPath, file, length, System.currentTimeMillis() - started, protocol, session);
        } else {
            request.setAttribute(CONTENT_INPUTSTREAM, new ContentInputStream(resource, childPath, file, start, length, downloadEventProcessor, started, protocol, session));
        }
    } catch (IOException e) {
        downloadEventProcessor.downloadFailed(resource, childPath, file, e, protocol, session);
    } finally {
        IOUtils.closeQuietly(in);
    }
}

[Buggy Hunk]
"attachment; filename=" + file.getName().getBaseName());

[Patch]
"attachment; filename=\"" + file.getName().getBaseName() + "\"");