Program: 10132
Project: 10132
Buggy source:
@EventHandler public void specialRecipeClick(InventoryClickEvent event){
  if (ItemScriptContainer.specialrecipesMap.isEmpty() && ItemScriptContainer.shapelessRecipesMap.isEmpty()) {
    return;
  }
  if (!(event.getInventory() instanceof CraftingInventory)) {
    return;
  }
  SlotType slotType=event.getSlotType();
  if (slotType.equals(InventoryType.SlotType.CRAFTING) || slotType.equals(InventoryType.SlotType.RESULT)) {
    CraftingInventory inventory=(CraftingInventory)event.getInventory();
    Player player=(Player)event.getWhoClicked();
    if (slotType == SlotType.RESULT && inventory.getResult() != null && inventory.getResult().getData().getItemType() != Material.AIR) {
      PlayerCraftsItemScriptEvent scriptEvent=PlayerCraftsItemScriptEvent.instance;
      scriptEvent.inventory=inventory;
      scriptEvent.result=new dItem(inventory.getResult());
      dList recipeList=new dList();
      for (      ItemStack item : inventory.getMatrix()) {
        if (item != null) {
          recipeList.add(new dItem(item.clone()).identify());
        }
 else {
          recipeList.add(new dItem(Material.AIR).identify());
        }
      }
      scriptEvent.recipe=recipeList;
      scriptEvent.player=dPlayer.mirrorBukkitPlayer(player);
      scriptEvent.resultChanged=false;
      scriptEvent.cancelled=false;
      scriptEvent.fire();
      if (scriptEvent.cancelled) {
        event.setCancelled(true);
        return;
      }
 else       if (scriptEvent.resultChanged) {
        event.setCurrentItem(scriptEvent.result.getItemStack());
      }
    }
    boolean clicked;
    if (slotType == SlotType.RESULT && event.isShiftClick()) {
      clicked=emulateSpecialRecipeResultShiftClick(inventory,player);
    }
 else {
      clicked=processSpecialRecipes(inventory,player);
    }
    if (clicked && slotType.equals(SlotType.RESULT)) {
      removeOneFromEachSlot(inventory,player);
    }
  }
}

Fixed version (ground truth):
@EventHandler public void specialRecipeClick(InventoryClickEvent event){
  if (ItemScriptContainer.specialrecipesMap.isEmpty() && ItemScriptContainer.shapelessRecipesMap.isEmpty()) {
    return;
  }
  if (!(event.getInventory() instanceof CraftingInventory)) {
    return;
  }
  SlotType slotType=event.getSlotType();
  if (slotType.equals(InventoryType.SlotType.CRAFTING) || slotType.equals(InventoryType.SlotType.RESULT)) {
    CraftingInventory inventory=(CraftingInventory)event.getInventory();
    Player player=(Player)event.getWhoClicked();
    Map.Entry<ItemScriptContainer,List<dItem>> recipeEntry=null;
    if (slotType == SlotType.RESULT && inventory.getResult() != null && inventory.getResult().getData().getItemType() != Material.AIR) {
      if (!event.isShiftClick() && event.getCursor().getData().getItemType() != Material.AIR && (!event.getCursor().isSimilar(inventory.getResult()) || event.getCursor().getAmount() + inventory.getResult().getAmount() > event.getCursor().getMaxStackSize())) {
        return;
      }
      recipeEntry=getSpecialRecipeEntry(inventory.getMatrix());
      if (recipeEntry == null) {
        return;
      }
      PlayerCraftsItemScriptEvent scriptEvent=PlayerCraftsItemScriptEvent.instance;
      scriptEvent.inventory=inventory;
      scriptEvent.result=new dItem(inventory.getResult());
      dList recipeList=new dList();
      for (      ItemStack item : inventory.getMatrix()) {
        if (item != null) {
          recipeList.add(new dItem(item.clone()).identify());
        }
 else {
          recipeList.add(new dItem(Material.AIR).identify());
        }
      }
      scriptEvent.recipe=recipeList;
      scriptEvent.player=dPlayer.mirrorBukkitPlayer(player);
      scriptEvent.resultChanged=false;
      scriptEvent.cancelled=false;
      scriptEvent.fire();
      if (scriptEvent.cancelled) {
        event.setCancelled(true);
        return;
      }
 else       if (scriptEvent.resultChanged) {
        event.setCurrentItem(scriptEvent.result.getItemStack());
      }
    }
    boolean clicked;
    if (slotType == SlotType.RESULT && event.isShiftClick()) {
      clicked=emulateSpecialRecipeResultShiftClick(inventory,player);
    }
 else {
      clicked=processSpecialRecipes(inventory,player);
    }
    if (clicked && slotType.equals(SlotType.RESULT)) {
      removeFromEachSlot(inventory,recipeEntry.getValue(),player);
    }
  }
}