[Demonstration 1]

[Buggy Method]
public void cancel() {
    try {
        mmSocket.close();
    } catch (IOException e) {
    }
}

[Buggy Hunk]
} catch (IOException e) { }

[Patch]
} catch (IOException e) { e.printStackTrace(); }

[Demonstration 2]

[Buggy Method]
public static boolean readConfig() {
    Properties prop = new Properties();
    InputStream input = null;
    try {
        try {
            if (!Dir.exists()) {
                Dir.mkdir();
            }
            input = new FileInputStream(ConfDir);
        } catch (FileNotFoundException e) {
            createConfig();
            return false;
        }
        prop.load(input);
        String AP_Temp = prop.getProperty("authorized_players");
        if (!(AP_Temp.equals(""))) {
            BlockTrackR.authorized_players = AP_Temp.substring(1, AP_Temp.length() - 1).split(",");
        } else {
            BlockTrackR.authorized_players = null;
        }
        BlockTrackR.version_check = prop.getProperty("version_check");
        BlockTrackR.debug = prop.getProperty("debug");
        BlockTrackR.host = prop.getProperty("host");
        BlockTrackR.port = prop.getProperty("port");
        BlockTrackR.connector = prop.getProperty("connector");
        BlockTrackR.database = prop.getProperty("database");
        BlockTrackR.dbuser = prop.getProperty("dbuser");
        BlockTrackR.dbpass = prop.getProperty("dbpass");
    } catch (IOException ex) {
        BlockTrackR.logger.warn("Disabled! Configuration error.", ex);
        ;
    }
    try {
        input.close();
    } catch (IOException e) {
        BlockTrackR.logger.warn("Disabled! Configuration error.", e);
        return false;
    }
    return true;
}

[Buggy Hunk]
if (!(AP_Temp.equals(""))) {

[Patch]
if (!((AP_Temp.equals("")) || (AP_Temp.equals("[]")))) {

[Demonstration 3]

[Buggy Method]
@RequestMapping("/gmessage")
public String gmessage(@RequestBody(required = false) String input) {
    log.info("received message" + Optional.ofNullable(input).orElse("null"));
    return "success, received:" + input;
}

[Buggy Hunk]
return "success, received:"+input;

[Patch]
return "success, received:"+Optional.ofNullable(input).orElse("null");