[Demonstration 1]

[Buggy Method]
public void run() {
    while (true) {
        try {
            JSONObject json = new JSONObject();
            byte[] receiveData = new byte[1024];
            DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
            datagramSocket.receive(receivePacket);
            String message = new String(receivePacket.getData());
            InetAddress sender = receivePacket.getAddress();
            Integer senderPort = receivePacket.getPort();
            json.put("message", message);
            json.put("sender", sender.toString());
            json.put("senderPort", senderPort.toString());
            PluginResult result = new PluginResult(PluginResult.Status.OK, json.toString());
            // keep callback after this call
            result.setKeepCallback(true);
            receivingCallbackContext.sendPluginResult(result);
        } catch (JSONException e) {
            PluginResult result = new PluginResult(PluginResult.Status.ERROR, "Error: fail to create json object");
            // keep callback after this call
            result.setKeepCallback(true);
            receivingCallbackContext.sendPluginResult(result);
            e.printStackTrace();
        } catch (IOException e) {
            PluginResult result = new PluginResult(PluginResult.Status.ERROR, "Error: fail to receive UDP packet");
            // keep callback after this call
            result.setKeepCallback(true);
            receivingCallbackContext.sendPluginResult(result);
            e.printStackTrace();
        }
    }
}

[Buggy Hunk]
String message = new String(receivePacket.getData());

[Patch]
String message = new String(receivePacket.getData(), 0, receivePacket.getLength());

[Demonstration 2]

[Buggy Method]
public static ResourceLocation getTexture(String name) {
    if (!HeadUtils.lycanites)
        return null;
    ResourceLocation tex = map.get(name);
    if (tex == null) {
        MobInfo info = ObjectManager.getMobInfo(name);
        if (info != null) {
            GroupInfo group = info.group;
            if (group != null) {
                tex = new ResourceLocation(group.filename, "textures/entity/" + name + ".png");
                map.put(name, tex);
            }
        }
    }
    return tex;
}

[Buggy Hunk]
if (!HeadUtils.lycanites)

[Patch]
if (!SkullTypes.lycanites.canShow())

[Demonstration 3]

[Buggy Method]
private static String getVer() {
    return Bukkit.getServer().getPluginManager().getPlugin("skUtilities").getDescription().getVersion();
}

[Buggy Hunk]
return Bukkit.getServer().getPluginManager().getPlugin("skUtilities").getDescription().getVersion();

[Patch]
return getPluginManager().getPlugin("skUtilities").getDescription().getVersion();