[Demonstration 1]

[Buggy Method]
@Override
public void onEnable() {
    plugin = this;
    //listner = new LandListener();
    //getServer().getPluginManager().registerEvents(new LandListener(this), this);
    flagManager = new FlagManager(this);
    manageViewManager = new ViewManager();
    getServer().getPluginManager().registerEvents(mapManager, this);
    //// CONFIG FILE MANAGEMENT ////
    Map<String, Object> oldConfig = getConfig().getValues(true);
    //Generates new config file if not present
    saveDefaultConfig();
    //String header = getConfig().options().header();
    FileConfiguration config = getConfig();
    // checks for missing entries and applies new ones
    for (Map.Entry<String, Object> entry : config.getDefaults().getValues(true).entrySet()) {
        if (oldConfig.containsKey(entry.getKey())) {
            config.set(entry.getKey(), oldConfig.get(entry.getKey()));
        } else {
            config.set(entry.getKey(), entry.getValue());
        }
    }
    saveConfig();
    ////////////////////////////////
    // Registering Alert Listener
    pListen = new LandAlerter();
    if (getConfig().getBoolean("options.showLandAlerts", true)) {
        getServer().getPluginManager().registerEvents(pListen, this);
    }
    // Database creation, configuration, and maintenance.
    setupDatabase();
    //getLogger().info(getDescription().getName() + ": Created by Jcdesimp");
    getLogger().info("Created by Jcdesimp!");
    //Plugin Metrics
    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException e) {
        // Failed to submit the stats :-(
    }
    // Command Executor
    getCommand("landlord").setExecutor(new LandlordCommandExecutor(this));
    //Worldguard Check
    if (!hasWorldGuard() && this.getConfig().getBoolean("worldguard.blockRegionClaim", true)) {
        getLogger().warning("Worldguard not found, worldguard features disabled.");
    } else {
        getLogger().info("Worldguard found!");
        wgHandler = new WorldguardHandler(getWorldGuard());
    }
    //Vault Check
    if (!hasVault() && this.getConfig().getBoolean("economy.enable", true)) {
        getLogger().warning("Vault not found, economy features disabled.");
    } else {
        getLogger().info("Vault found!");
        vHandler = new VaultHandler();
        if (!vHandler.hasEconomy()) {
            getLogger().warning("No economy found, economy features disabled.");
        }
    }
    verifyDatabaseVersion();
    //Register default flags
    if (getConfig().getBoolean("enabled-flags.build")) {
        flagManager.registerFlag(new Build());
    }
    if (getConfig().getBoolean("enabled-flags.harmAnimals")) {
        flagManager.registerFlag(new HarmAnimals());
    }
    if (getConfig().getBoolean("enabled-flags.useContainers")) {
        flagManager.registerFlag(new UseContainers());
    }
    if (getConfig().getBoolean("enabled-flags.tntDamage")) {
        flagManager.registerFlag(new TntDamage());
    }
    if (getConfig().getBoolean("enabled-flags.useRedstone")) {
        flagManager.registerFlag(new UseRedstone());
    }
    if (getConfig().getBoolean("enabled-flags.openDoor")) {
        flagManager.registerFlag(new OpenDoor());
    }
    if (getConfig().getBoolean("enabled-flags.pvp")) {
        flagManager.registerFlag(new PVP());
    }
    //flagManager.registerFlag(new OpenDoorDUPE1());
    //flagManager.registerFlag(new OpenDoorDUPE2());
    //flagManager.registerFlag(new OpenDoorDUPE3());
}

[Buggy Hunk]
if(!hasVault() && this.getConfig().getBoolean("economy.enable", true)){

[Patch]
if(!hasVault() || this.getConfig().getBoolean("economy.enable", true)){

[Demonstration 2]

[Buggy Method]
private String getEncodedServiceUrl(final RequestContext context) {
    final String serviceUrl = context.getRequestParameters().get("service");
    if (serviceUrl == null) {
        return null;
    }
    try {
        return URLEncoder.encode(serviceUrl, "UTF-8");
    } catch (final UnsupportedEncodingException e) {
        throw new AssertionError("UTF-8 is unknown");
    }
}

[Buggy Hunk]
private String getEncodedServiceUrl(final RequestContext context) {

[Patch]
private String getEncodedServiceUrl(final RequestContext context) throws AssertionError {

[Demonstration 3]

[Buggy Method]
@Override
public boolean shouldFilter() {
    RequestContext ctx = getCurrentContext();
    String host = ctx.getRouteHost().getHost();
    HttpServletRequest request = ctx.getRequest();
    String method = request.getMethod();
    LOG.debug("Check for host: {}.", host);
    boolean shouldFilter = true;
    if (config.getHosts().contains(host) | method.equals("OPTIONS")) {
        LOG.debug("Ignore host: {}.", host);
        shouldFilter = false;
    }
    return shouldFilter;
}

[Buggy Hunk]
LOG.debug("Check for host: {}.", host);

[Patch]
LOG.debug("Check for host: {}, method: {}.", host, method);