[Demonstration 1]

[Buggy Method]
private Inflector<ContainerRequestContext, Response> utilsHandler() {
    return new Inflector<ContainerRequestContext, Response>() {

        public Response apply(ContainerRequestContext ctx) {
            MultivaluedMap<String, String> params = ctx.getUriInfo().getQueryParameters();
            String method = pathParam("method", ctx);
            method = StringUtils.isBlank(method) ? params.getFirst("method") : method;
            if ("newid".equals(method)) {
                return Response.ok(Utils.getNewId()).build();
            } else if ("timestamp".equals(method)) {
                return Response.ok(Utils.timestamp()).build();
            } else if ("formatdate".equals(method)) {
                String format = params.getFirst("format");
                String locale = params.getFirst("locale");
                Locale loc = LocaleUtils.toLocale(locale);
                return Response.ok(Utils.formatDate(format, loc)).build();
            } else if ("formatmessage".equals(method)) {
                String msg = params.getFirst("message");
                Object[] paramz = params.get("fields").toArray();
                return Response.ok(Utils.formatMessage(msg, paramz)).build();
            } else if ("nospaces".equals(method)) {
                String str = params.getFirst("string");
                String repl = params.getFirst("replacement");
                return Response.ok(Utils.noSpaces(str, repl)).build();
            } else if ("nosymbols".equals(method)) {
                String str = params.getFirst("string");
                return Response.ok(Utils.stripAndTrim(str)).build();
            } else if ("md2html".equals(method)) {
                String md = params.getFirst("md");
                return Response.ok(Utils.markdownToHtml(md), MediaType.TEXT_HTML).build();
            } else if ("timeago".equals(method)) {
                String d = params.getFirst("delta");
                long delta = NumberUtils.toLong(d, 1);
                return Response.ok(HumanTime.approximately(delta)).build();
            }
            return RestUtils.getStatusResponse(Response.Status.BAD_REQUEST, "Unknown method: " + ((method == null) ? "empty" : method));
        }
    };
}

[Buggy Hunk]
Locale loc = LocaleUtils.toLocale(locale);

[Patch]
Locale loc = getLocale(locale);

[Demonstration 2]

[Buggy Method]
public void counting(final int target) {
    Looper.prepare();
    progressDialog = ProgressDialog.show(this, "", "Завантажуються ваші координати");
    new Thread(new Runnable() {

        @Override
        public void run() {
            startService(target);
        }
    }).start();
    Looper.loop();
}

[Buggy Hunk]
public void counting(final int target) {

[Patch]
private void counting(final int target) {

[Demonstration 3]

[Buggy Method]
@Override
public final void cycleMenu() {
    this.cycleMenu(false);
}

[Buggy Hunk]
public final void cycleMenu() {

[Patch]
public void cycleMenu() {