[Demonstration 1]

[Buggy Method]
public static void main(String[] args) throws IOException {
    String uaString = "HbbTV/1.1.1 (;Samsung;SmartTV2013;T-FXPDEUC-1102.2;;) WebKit";
    System.out.println(uaString);
    Parser uaParser = new Parser();
    Client c = uaParser.parse(uaString);
    // => "Mobile Safari"
    System.out.println(c.userAgent.family);
    // => "5"
    System.out.println(c.userAgent.major);
    // => "1"
    System.out.println(c.userAgent.minor);
    // => "iOS"
    System.out.println(c.os.family);
    // => "5"
    System.out.println(c.os.major);
    // => "1"
    System.out.println(c.os.minor);
    // => "iPhone"
    System.out.println(c.device.family);
    System.out.println(c.device.brand);
    System.out.println(c.device.model);
}

[Buggy Hunk]
Parser uaParser = new Parser();

[Patch]
Parser uaParser = CachingParser.getInstance();

[Demonstration 2]

[Buggy Method]
private static void processFile(CsvBeanReader beanReader, boolean dryrun, boolean compare) throws IOException {
    try {
        final String[] header = beanReader.getHeader(true);
        //filter columns
        List<String> columnsToMap = Arrays.asList("header_to_exclude");
        for (int i = 0; i < header.length; i++) {
            //System.out.print(header[i] + " ");
            if (header[i] != null && header[i].startsWith("desc_")) {
                header[i] = null;
            }
            if (columnsToMap.contains(header[i])) {
                header[i] = null;
            }
            if (header[i] != null && header[i].equals("class")) {
                header[i] = "stars";
            }
        }
        int batchSize = 0;
        FeatureCollection featureCollection = new FeatureCollection();
        JuffrouBeanWrapper beanWrapper = new JuffrouBeanWrapper(BeanWrapperContext.create(HotelBean.class));
        /*if (FIRST > 0) {
		    	for (int i=0;i<FIRST;i++) {
		    		try {
		    			beanReader.read(HotelBean.class, header, processors);
		    		} catch (Exception e) {
		    			
		    		}
		    	}
		    }
		    System.out.println("Skipped " + FIRST + " records.");*/
        for (int i = 0; i < TOTAL_FILE_SIZE; i++) {
            //while (true) {
            try {
                count++;
                HotelBean h = beanReader.read(HotelBean.class, header, processors);
                if (h == null) {
                    break;
                }
                h.setHotel_url(h.getHotel_url() + "?aid=864525");
                h.setPhoto_url(h.getPhoto_url().replace("max500", "max200"));
                Feature f = new Feature();
                Point p = new Point();
                LngLatAlt coords = new LngLatAlt(h.getLongitude(), h.getLatitude());
                p.setCoordinates(coords);
                h.setLatitude(null);
                h.setLongitude(null);
                f.setGeometry(p);
                f.setId(Long.toString(h.getId()));
                Map<String, Object> properties = getBeanMap(h, beanWrapper);
                //compare with current version
                boolean equal = false;
                if (compare) {
                    equal = compareHotelBean(properties, beanWrapper, count);
                }
                if (!equal) {
                    System.out.println(count + ". Hotel " + h.getId() + " added to batch.");
                    batchSize++;
                    f.setProperties(properties);
                    featureCollection.add(f);
                } else {
                    System.out.println(count + ". Hotel " + h.getId() + " has not changed.");
                }
                if (batchSize == BATCH_SIZE) {
                    saveBatchToDb(featureCollection, dryrun);
                    featureCollection.setFeatures(new ArrayList<Feature>());
                    batchSize = 0;
                    System.out.println("Processed " + count + " records ...");
                }
            } catch (Exception e) {
                errors++;
                System.err.println(e.getMessage());
                //e.printStackTrace();
            }
        }
        if (batchSize > 0) {
            saveBatchToDb(featureCollection, dryrun);
        }
        System.out.println("Processed " + count + " records with " + errors + " errors.");
    } finally {
        if (beanReader != null) {
            beanReader.close();
        }
    }
}

[Buggy Hunk]
h.setHotel_url(h.getHotel_url() + "?aid=864525");

[Patch]
h.setHotel_url(h.getHotel_url() + "?aid=" + AID);

[Demonstration 3]

[Buggy Method]
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
    if ((Minecraft.getMinecraft().currentScreen instanceof GuiChat)) {
        return;
    }
    if ((DYNServerMod.status == PlayerLevel.MENTOR) && mentorKey.isPressed()) {
        PacketDispatcher.sendToServer(new RequestUserlistMessage());
        GuiFoundation.proxy.display(new Home());
    }
}

[Buggy Hunk]
GuiFoundation.proxy.display(new Home());

[Patch]
RabbitGui.proxy.display(new Home());