[Demonstration 1]

[Buggy Method]
@Bean
public AppRegistryController appRegistryController(AppRegistry registry, ApplicationConfigurationMetadataResolver metadataResolver) {
    return new AppRegistryController(registry, metadataResolver);
}

[Buggy Hunk]
return new AppRegistryController(registry, metadataResolver);

[Patch]
return new AppRegistryController(registry, metadataResolver, new ForkJoinPool(2));

[Demonstration 2]

[Buggy Method]
public void processStockpiles() {
    Set<Integer> spNos = spTonnesWigthMapping.keySet();
    for (int spNo : spNos) {
        SPBlock spb = spBlockMapping.get(spNo);
        if (spb == null)
            continue;
        Map<Integer, Double> blockTonnage = spTonnesWigthMapping.get(spNo);
        if (blockTonnage == null || spb.getLasttonnesWt() == spb.getTonnesWt())
            continue;
        balanceStockpileBlock(spb);
        Set<Integer> blockNos = blockTonnage.keySet();
        Set<String> gradeExprs = new HashSet<String>();
        for (int blockNo : blockNos) {
            Block b = getBlocks().get(blockNo);
            int payload = getBlockPayloadMapping().get(b.getId());
            spb.setPayload(payload);
            double blockTonnesWt = blockTonnage.get(blockNo);
            double ratio = blockTonnesWt / spb.getTonnesWt();
            Map<String, BigDecimal> spblockcomputedFields = spb.getComputedFields();
            Map<String, String> computedFields = b.getComputedFields();
            Set<String> fieldNames = computedFields.keySet();
            for (String fieldName : fieldNames) {
                if (isGradeExpression(fieldName)) {
                    gradeExprs.add(fieldName);
                } else {
                    BigDecimal fieldVal = new BigDecimal(computedFields.get(fieldName));
                    fieldVal = fieldVal.multiply(new BigDecimal(ratio));
                    BigDecimal existingVal = spblockcomputedFields.get(fieldName);
                    if (existingVal != null) {
                        fieldVal = fieldVal.add(existingVal);
                    }
                    spblockcomputedFields.put(fieldName, fieldVal);
                }
            }
            /*// calculate grade fields
				Map<String, BigDecimal> spbgradeFields = spb.getGradeFields();
				double totalBlockTonnage = Double.valueOf(b.getField(tonnesWtFieldName));
				double blockTonnageRatio = blockTonnesWt/totalBlockTonnage;
				for(String fieldName: gradeFields ){
					BigDecimal gradeVal = new BigDecimal(b.getField(fieldName));
					gradeVal = gradeVal.multiply(new BigDecimal(blockTonnageRatio));
					BigDecimal spbGradeVal = spbgradeFields.get(fieldName);
					if(spbGradeVal != null){
						spbGradeVal = spbGradeVal.add(gradeVal);
					} else {
						spbGradeVal = gradeVal;
					}
					spbgradeFields.put(fieldName, spbGradeVal);
					//System.out.format("Sp No: %s, block No: %s, fieldName: %s, value: %s \n", spNo, blockNo, fieldName, gradeVal);
				}*/
            // Calculate fields
            Map<String, BigDecimal> spblockFields = spb.getFields();
            List<Field> fields = getFields();
            Map<String, String> blockFields = b.getFields();
            for (Field field : fields) {
                if (field.getDataType() == Field.TYPE_TEXT || field.getDataType() == Field.TYPE_NUMERIC)
                    continue;
                BigDecimal fieldVal = new BigDecimal(blockFields.get(field.getName()));
                fieldVal = fieldVal.multiply(new BigDecimal(ratio));
                BigDecimal existingVal = spblockFields.get(field.getName());
                if (existingVal != null) {
                    fieldVal = fieldVal.add(existingVal);
                }
                spblockFields.put(field.getName(), fieldVal);
            }
            spb.setComputedFields(spblockcomputedFields);
            spb.setFields(spblockFields);
            spb.getProcesses().addAll(b.getProcesses());
        }
        processGrades(spb, gradeExprs);
    }
    spTonnesWigthMapping = new HashMap<Integer, Map<Integer, Double>>();
}

[Buggy Hunk]
Block b = getBlocks().get(blockNo);

[Patch]
Block b = getBlockByNumber(blockNo);

[Demonstration 3]

[Buggy Method]
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
    ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
    for (ItemStack drops : baseBlock.getDrops(world, x, y, z, metadata, fortune)) {
        if (drops.getItem() == Item.getItemFromBlock(baseBlock)) {
            ret.add(new ItemStack(this, drops.stackSize));
        } else {
            ret.add(new ItemStack(this.getNugget(), drops.stackSize));
        }
    }
    return ret;
}

[Buggy Hunk]
for (ItemStack drops : baseBlock.getDrops(world, x, y, z, metadata, fortune)) {

[Patch]
for (ItemStack drops : baseBlock.getDrops(world, x, y, z, this.baseBlockMeta, fortune)) {