[Demonstration 1]

[Buggy Method]
private void readRePatternResources(ResourceMap hmResourcesRePattern, boolean load_temponym_resources) {
    //////////////////////////////////////
    // READ REGULAR EXPRESSION PATTERNS //
    //////////////////////////////////////
    for (String resource : hmResourcesRePattern.keySet()) {
        // read pattern resources with "Temponym" only if temponym tagging is selected
        if (!load_temponym_resources && resource.contains("Temponym")) {
            LOG.debug("No Temponym Tagging selected. Skipping pattern resource: {}", resource);
            continue;
        }
        LOG.debug("Adding pattern resource: {}", resource);
        // create a buffered reader for every repattern resource file
        try (//
        InputStream is = hmResourcesRePattern.getInputStream(resource);
            //
            InputStreamReader isr = new InputStreamReader(is, "UTF-8");
            BufferedReader br = new BufferedReader(isr)) {
            List<String> patterns = new ArrayList<String>();
            for (String line; (line = br.readLine()) != null; ) // disregard comments
            if (!line.startsWith("//") && !line.equals(""))
                patterns.add(line);
            patterns = optimizePatterns(resource, patterns);
            hmAllRePattern.put(resource, String.join("|", patterns));
        } catch (IOException e) {
            LOG.error(e.getMessage(), e);
        }
    }
    ////////////////////////////
    // FINALIZE THE REPATTERN //
    ////////////////////////////
    for (String which : hmAllRePattern.keySet()) finalizeRePattern(which, hmAllRePattern.get(which));
}

[Buggy Hunk]
LOG.debug("No Temponym Tagging selected. Skipping pattern resource: {}", resource);

[Patch]
LOG.trace("No Temponym tagging selected. Skipping pattern resource: {}", resource);

[Demonstration 2]

[Buggy Method]
private void run(Vertx vertx, String messagingHost, int messagingPort, String kafkaTopic, int messagesCount, int messagesDelay) {
    LOG.info("Starting sender : connecting to [{}:{}] topic [{}] msgs count/delay [{}/{}]", messagingHost, messagingPort, kafkaTopic, messagesCount, messagesDelay);
    ProtonClient client = ProtonClient.create(vertx);
    client.connect(messagingHost, messagingPort, done -> {
        if (done.succeeded()) {
            this.connection = done.result();
            this.connection.open();
            LOG.info("Connected as {}", this.connection.getContainer());
            this.sender = this.connection.createSender(kafkaTopic);
            this.sender.open();
            vertx.setPeriodic(messagesDelay, t -> {
                if (this.connection.isDisconnected()) {
                    vertx.cancelTimer(t);
                } else {
                    if (++count <= messagesCount) {
                        Message message = ProtonHelper.message(KAFKA_TOPIC, String.format("Hello %d from Vert.x Proton [%s] !", count, connection.getContainer()));
                        sender.send(message, delivery -> {
                            LOG.info("Message delivered {}", delivery.getRemoteState());
                            if (delivery.getRemoteState() instanceof Rejected) {
                                Rejected rejected = (Rejected) delivery.getRemoteState();
                                LOG.info("... but rejected {} {}", rejected.getError().getCondition(), rejected.getError().getDescription());
                            }
                        });
                    } else {
                        vertx.cancelTimer(t);
                    }
                }
            });
        } else {
            LOG.info("Error on connection {}", done.cause());
        }
    });
    try {
        System.in.read();
        if (this.sender.isOpen())
            this.sender.close();
        this.connection.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
Message message = ProtonHelper.message(KAFKA_TOPIC,

[Patch]
Message message = ProtonHelper.message(kafkaTopic,

[Demonstration 3]

[Buggy Method]
public boolean handleInput(IMessage message) {
    if (message.getContent().startsWith(message.getClient().getConfig().getMisc().getCommandPrefix())) {
        String commandName = message.getContent().replace(message.getClient().getConfig().getMisc().getCommandPrefix(), "").split(" ")[0];
        Optional<Command> command = getCommandByName(commandName);
        if (command.isPresent()) {
            final boolean[] badUsage = { false };
            command.get().getParameters().stream().filter(CommandParameter::isRequired).forEach(parameter -> {
                boolean found = false;
                Pattern pattern = Pattern.compile("-([0-9A-Za-z]) ([ 0-9A-Za-z?:/.=_&]*)\\b");
                Matcher matcher = pattern.matcher(message.getContent());
                while (matcher.find()) {
                    if (parameter.getName().equals(matcher.group(1))) {
                        found = true;
                    }
                }
                if (!found) {
                    badUsage[0] = true;
                }
            });
            if (badUsage[0]) {
                IMessage usageMessage = message.copy();
                usageMessage.setContent("USAGE ERROR: " + command.get().getUsage());
                message.getClient().sendMessage(usageMessage);
                return true;
            }
            CommandContext context = new CommandContext(message, command.get(), message.getClient(), this);
            if (command.get().isContinuousCommand()) {
                onGoingCommand = command.get();
                onGoingStorage = new CommandStorage(message, message.getContent(), context.getParameters(), command.get());
            }
            command.get().onRun.accept(context);
            command.get().getParameters().stream().forEach(e -> e.setValue(""));
            if (command.get().canMultiCommand() && !command.get().isContinuousCommand()) {
                Pattern multiPattern = Pattern.compile("/[" + message.getClient().getConfig().getMisc().getCommandPrefix() + "]([A-Za-z0-9]*)\\b");
                Matcher multiMather = multiPattern.matcher(message.getContent());
                while (multiMather.find()) {
                    executeCommand(message, multiMather.group(1));
                }
            }
            return true;
        } else {
            if (onGoingCommand != null) {
                CommandContext context = new CommandContext(message.getContent(), onGoingStorage, this, message.getClient());
                if (message.getContent().equals(onGoingCommand.getContinuousEndText())) {
                    IMessage commandEnded = message.copy();
                    commandEnded.setContent("Command " + onGoingCommand.getName() + " has been exited!");
                    message.getClient().sendMessage(commandEnded);
                    endCommand(onGoingCommand, context);
                    return true;
                }
                onGoingCommand.onNext.accept(context);
                return true;
            }
        }
        return false;
    } else {
        return false;
    }
}

[Buggy Hunk]
if(message.getContent().startsWith(message.getClient().getConfig().getMisc().getCommandPrefix()))

[Patch]
if(message.getContent().startsWith(message.getClient().getConfig().getMisc().getCommandPrefix()) && onGoingCommand == null)