[Demonstration 1]

[Buggy Method]
public static ArrayList<BlockEntry> getContentofStack(ItemStack stack, boolean useStructures) {
    ArrayList<BlockEntry> entries = new ArrayList<BlockEntry>();
    if (!stack.isEmpty()) {
        if (useStructures) {
            ILittleTile tile = PlacementHelper.getLittleInterface(stack);
            if (tile != null) {
                ArrayList<LittleTilePreview> tiles = tile.getLittlePreview(stack);
                if (tiles != null) {
                    for (int i = 0; i < tiles.size(); i++) {
                        Block block2 = tiles.get(i).getPreviewBlock();
                        if (block2 != null && !(block2 instanceof BlockAir))
                            entries.add(new BlockEntry(block2, tiles.get(i).getPreviewBlockMeta(), tiles.get(i).size.getPercentVolume()));
                    }
                    return entries;
                }
            }
        }
        if (stack.getItem() instanceof ItemTileContainer) {
            entries.addAll(ItemTileContainer.loadMap(stack));
        } else {
            Block block = Block.getBlockFromItem(stack.getItem());
            if (block != null && !(block instanceof BlockAir)) {
                if (SubContainerHammer.isBlockValid(block)) {
                    entries.add(new BlockEntry(block, stack.getItemDamage(), 1));
                }
            }
        }
    }
    return entries;
}

[Buggy Hunk]
if(!stack.isEmpty())

[Patch]
if(stack != null)

[Demonstration 2]

[Buggy Method]
private EntityInfo createEntityInfoFromJson(Map map) {
    EntityInfo info = new EntityInfo();
    Map aspect = (Map) map.get("entityAspect");
    map.remove("entityAspect");
    String entityTypeName = (String) aspect.get("entityTypeName");
    Class type = MetadataHelper.lookupClass(entityTypeName);
    info.entityType = getMetadata().getEntityType(entityTypeName);
    info.entity = JsonGson.fromMap(type, map);
    info.entityState = EntityState.valueOf((String) aspect.get("entityState"));
    info.originalValuesMap = (Map) aspect.get("originalValuesMap");
    info.unmappedValuesMap = (Map) aspect.get("unmappedValuesMap");
    // AutoGeneratedKey info from the client isn't needed because we have the metadata already on the server.
    //        Map autoKey = (Map) aspect.get("autoGeneratedKey");
    //        if (autoKey != null) {
    //            info.autoGeneratedKey = new AutoGeneratedKey(info.entity,
    //                    (String) autoKey.get("propertyName"),
    //                    (String) autoKey.get("autoGeneratedKeyType"));
    //        }
    return info;
}

[Buggy Hunk]
info.unmappedValuesMap = (Map) aspect.get("unmappedValuesMap");

[Patch]
info.unmappedValuesMap = (Map) map.get("__unmapped");

[Demonstration 3]

[Buggy Method]
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == SPEECH_INPUT_ID && resultCode == RESULT_OK) {
        ArrayList<String> outputList = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
        noteBody.append(" " + outputList.get(0));
    } else if (requestCode == TAKE_PICTURE_ID && resultCode == RESULT_OK) {
        Bundle extras = data.getExtras();
        String fileName = extras.getString("FILE_PATH");
        System.out.println(fileName);
        //Bitmap bitmapToDisplayFromSDCard = BitmapFactory.decodeFile(fileName);
        //picTaken.setImageBitmap(bitmapToDisplayFromSDCard);
    } else if (requestCode == GO_TO_GALLERY) {
    }
}

[Buggy Hunk]
noteBody.append(" " + outputList.get(0));

[Patch]
noteText.append(" " + outputList.get(0));