[Demonstration 1]

[Buggy Method]
public List<String> getZoneDownloadFiles() {
    List<String> zoneFiles = new ArrayList<String>();
    ;
    SQLiteDatabase db = this.getReadableDatabase();
    Cursor cursor = db.rawQuery("select guide_voice, guide_voice_en, photo, photo_vertical from zone", null);
    cursor.moveToFirst();
    String guide_voice = null;
    String guide_voice_en = null;
    String photo = null;
    String photo_vertical = null;
    // fetch all guide_voice, photo, photo_vertical
    while (cursor.isAfterLast() == false) {
        guide_voice = cursor.getString(cursor.getColumnIndex("guide_voice"));
        guide_voice_en = cursor.getString(cursor.getColumnIndex("guide_voice_en"));
        photo = cursor.getString(cursor.getColumnIndex("photo"));
        photo_vertical = cursor.getString(cursor.getColumnIndex("photo_vertical"));
        if (guide_voice.length() != 0 && guide_voice != null && guide_voice != "null") {
            zoneFiles.add(guide_voice);
        }
        if (guide_voice_en.length() != 0 && guide_voice_en != null && guide_voice_en != "null") {
            zoneFiles.add(guide_voice_en);
        }
        if (photo_vertical.length() != 0 && photo_vertical != null && photo_vertical != "null") {
            zoneFiles.add(photo_vertical);
        }
        // add to List
        zoneFiles.add(photo);
        cursor.moveToNext();
    }
    cursor.close();
    return zoneFiles;
}

[Buggy Hunk]
List<String> zoneFiles = new ArrayList<String>();;

[Patch]
List<String> zoneFiles = new ArrayList<String>();

[Demonstration 2]

[Buggy Method]
private static void addStartTagBeginQuery(StringBuilder sb, String variable, String filename, Node node) {
    sb.append(variable).append("=$(").append("cat -n ").append(filename).append(" | sed -n -e 1,").append(node.getUserData(PositionalXMLReader.START_LINE_NUMBER_KEY)).append("p").append(" | sed -n -e \"/<").append(node.getNodeName()).append(" /=\"").append(" | tail -n 1)\n");
}

[Buggy Hunk]
.append(" | sed -n -e \"/<").append(node.getNodeName()).append(" /=\"")

[Patch]
.append(" | sed -n -e \"/<").append(node.getNodeName()).append(" /=;/<").append(node.getNodeName()).append(">/=\"")

[Demonstration 3]

[Buggy Method]
private static Block registerMultiBlock(Block block, String name, String[] names) {
    List<String> namesList = new ArrayList<String>();
    Collections.addAll(namesList, names);
    Class<? extends ItemBlock> clazz;
    clazz = ItemBlockTropicraft.class;
    GameRegistry.registerBlock(block, clazz, name, namesList);
    block.setUnlocalizedName(getNamePrefixed(name));
    int count = 0;
    // get the preset blocks variants
    ImmutableSet<IBlockState> presets = getBlockPresets(block);
    ITropicraftBlock tcBlock = (ITropicraftBlock) block;
    if (presets.isEmpty()) {
        // block has no sub-blocks to register
        registerBlockVariant(block, name, 0);
    } else {
        // register all the sub-blocks
        for (IBlockState state : presets) {
            String stateName = tcBlock.getStateName(state);
            int stateMeta = block.damageDropped(state);
            System.err.println("Registering block " + name + " with stateName " + stateName + " and meta " + stateMeta);
            registerBlockVariant(block, name, stateMeta, stateName);
        }
    }
    block.setCreativeTab(CreativeTabRegistry.tropicraftTab);
    return block;
}

[Buggy Hunk]
int stateMeta = block.damageDropped(state);

[Patch]
int stateMeta = block.getMetaFromState(state);