[Demonstration 1]

[Buggy Method]
private static List<Map.Entry<ItemStack[], Integer>> findMatchingRecipes(ItemStack itemStack) {
    // initialize a list of tuples to hold the crafting grid and stack sizes
    List<Map.Entry<ItemStack[], Integer>> list = new ArrayList<Map.Entry<ItemStack[], Integer>>();
    // if uncrafting of this item is disabled in config, return the empty list
    String itemName = Item.REGISTRY.getNameForObject(itemStack.getItem()).toString();
    String itemNameWithDamage = itemName + (itemStack.getItemDamage() > 0 ? "," + Integer.toString(itemStack.getItemDamage()) : "");
    if (ArrayUtils.indexOf(ModConfiguration.excludedItems, itemName) >= 0)
        return list;
    if (ArrayUtils.indexOf(ModConfiguration.excludedItems, itemNameWithDamage) >= 0)
        return list;
    // iterate over all the crafting recipes known to the crafting manager
    List<IRecipe> recipeList = CraftingManager.getInstance().getRecipeList();
    for (IRecipe recipe : recipeList) {
        // if the current recipe can be used to craft the item
        ItemStack recipeOutput = recipe.getRecipeOutput();
        if (recipeOutput == null)
            recipeOutput = RecipeHandler.getPossibleRecipeOutput(recipe, itemStack);
        if (ItemStack.areItemsEqualIgnoreDurability(itemStack, recipeOutput)) {
            // load any custom mapping data we have for this item
            ItemMapping mapping = ModJsonConfiguration.itemMappings.get(itemName);
            // if we have mapping data...
            if (mapping != null) {
                // if the mapping data specifies a particular IRecipe instance, and the current recipe does not match, continue
                if ((mapping.recipeType != null) && (!recipe.getClass().getCanonicalName().equals(mapping.recipeType)))
                    continue;
                // if the mapping data specifies a match on NBT data, and the data does not match, continue
                if ((mapping.matchTag == true) && (!areItemStackSubTagsEqual(itemStack, recipeOutput, mapping.tagName)))
                    continue;
                // if the mapping data specifies a match on a private field, and the field values do not match, continue
                if ((mapping.matchField == true) && (!arePrivateFieldValuesEqual(itemStack, recipeOutput, mapping.fieldNames)))
                    continue;
            }
            // get an instance of the appropriate handler class for the IRecipe type of the crafting recipe
            RecipeHandler handler = RecipeHandlers.HANDLERS.get(recipe.getClass());
            if (handler != null) {
                // if the recipe is nbt sensitive, copy the input itemstack into the recipe handler
                if (handler instanceof INBTSensitiveRecipeHandler)
                    ((INBTSensitiveRecipeHandler) handler).setInputStack(itemStack.copy());
                // get the minimum stack size required to uncraft, and the itemstacks that comprise the crafting ingredients
                int minStackSize = recipeOutput.stackSize;
                ItemStack[] craftingGrid = handler.getCraftingGrid(recipe);
                if (craftingGrid != null && craftingGrid.length > 0) {
                    // if the recipe output contains the input item, disallow use of this recipe for uncrafting (e.g. white wool -> white wool + bonemeal)
                    if (craftingGridContainsInputItem(itemStack, craftingGrid))
                        continue;
                    // if we're doing a partial material return on a damaged item, remove items from the crafting grid as appropriate
                    if (ModConfiguration.uncraftMethod == UncraftingMethod.JGLRXAVPOK && itemStack.isItemStackDamageable() && itemStack.isItemDamaged()) {
                        craftingGrid = removeItemsFromOutputByDamage(itemStack, craftingGrid);
                    }
                    // add the stack size and the crafting grid to the results list
                    if (countFilledSlotsInCraftingGrid(craftingGrid) > 0) {
                        Map.Entry<ItemStack[], Integer> pair = new AbstractMap.SimpleEntry<ItemStack[], Integer>(craftingGrid, minStackSize);
                        list.add(pair);
                    }
                    // if we have custom mapping data which specifies a single recipe
                    if (mapping != null && mapping.singleRecipe == true) {
                        // we've found that recipe, so break out of the loop
                        break;
                    }
                }
            } else
                // if we couldn't find a handler class for this IRecipe implementation, write some details to the log for debugging.
                ModUncrafting.instance.getLogger().error("findMatchingRecipes :: Unknown IRecipe implementation " + recipe.getClass().getCanonicalName() + " for item " + itemName);
        }
    }
    return list;
}

[Buggy Hunk]
ItemMapping mapping = ModJsonConfiguration.itemMappings.get(itemName);

[Patch]
ItemMapping mapping = ModJsonConfiguration.itemMappings.get(itemStack);

[Demonstration 2]

[Buggy Method]
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    String item = (String) getListAdapter().getItem(position);
    Workout w = WorkoutListData.getWorkout(position);
    log.info(w.toString());
    Toast.makeText(this, item + " selected", Toast.LENGTH_LONG).show();
    Intent intent = new Intent(this, WorkoutSectionDetail.class);
    intent.putExtra(WorkoutDetailActivity.WORKOUT_PARAM, w);
    startActivity(intent);
}

[Buggy Hunk]
Intent intent = new Intent(this, WorkoutSectionDetail.class);

[Patch]
Intent intent = new Intent(this, WorkoutDetailActivity.class);

[Demonstration 3]

[Buggy Method]
@Override
protected void getView() {
    // TODO Auto-generated method stub
    super.getView();
    name = (EditText) findViewById(R.id.usereditnameET);
    mode = (Spinner) findViewById(R.id.usertypeSP);
    passwd = (EditText) findViewById(R.id.usereditpasswdET);
    ret = (Button) findViewById(R.id.usereditretBT);
    ret.setOnClickListener(this);
    confirm = (Button) findViewById(R.id.usereditconfirmBT);
    confirm.setOnClickListener(this);
    delete = (Button) findViewById(R.id.usereditdeleteBT);
    delete.setOnClickListener(this);
    if (showmode == 1)
        delete.setVisibility(View.GONE);
    new Thread(new Runnable() {

        @Override
        public void run() {
            // TODO Auto-generated method stub
            Message message = new Message();
            message.what = UPDATE_INFO;
            handler.sendMessage(message);
        }
    }).start();
    list.add("*");
    list.add("Deliver");
    list.add("Engineer");
    list.add("Saler");
    list.add("Admin");
    adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    mode.setAdapter(adapter);
    mode.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            // TODO Auto-generated method stub
            if (adapter.getItem(position).equals("Deliver")) {
                select = "1";
            }
            if (adapter.getItem(position).equals("Engineer")) {
                select = "2";
            }
            if (adapter.getItem(position).equals("Saler")) {
                select = "3";
            }
            if (adapter.getItem(position).equals("Admin")) {
                select = "4";
            }
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {
            // TODO Auto-generated method stub
            if (showmode == 2) {
                select = "" + user.spinner(user.mode);
            } else {
                select = "2";
            }
        }
    });
}

[Buggy Hunk]
list.add("*");list.add("Deliver");list.add("Engineer");list.add("Saler");list.add("Admin");

[Patch]
list.add("Deliver");list.add("Engineer");list.add("Saler");list.add("Admin");