Program: 10240
Project: 10240
Buggy source:
public String getAttribute(Attribute attribute){
  if (attribute == null)   return null;
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(2)) {
      int qty=1;
      int attribs=2;
      String search_string=attribute.getContext(2);
      boolean strict=false;
      if (search_string.toLowerCase().startsWith("String_Node_Str")) {
        strict=true;
        search_string=search_string.substring(7);
      }
      if (attribute.hasContext(3) && attribute.getAttribute(3).startsWith("String_Node_Str") && aH.matchesInteger(attribute.getContext(3))) {
        qty=attribute.getIntContext(3);
        attribs=3;
      }
      int found_items=0;
      if (strict) {
        for (        ItemStack item : getContents()) {
          if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equalsIgnoreCase(search_string)) {
            found_items+=item.getAmount();
            if (found_items >= qty)             break;
          }
        }
      }
 else {
        for (        ItemStack item : getContents()) {
          if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().toLowerCase().contains(search_string.toLowerCase())) {
            found_items+=item.getAmount();
            if (found_items >= qty)             break;
          }
        }
      }
      return (found_items >= qty ? Element.TRUE.getAttribute(attribute.fulfill(attribs)) : Element.FALSE.getAttribute(attribute.fulfill(attribs)));
    }
  }
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(2)) {
      int qty=1;
      int attribs=2;
      String search_string=attribute.getContext(2);
      boolean strict=false;
      if (search_string.toLowerCase().startsWith("String_Node_Str")) {
        strict=true;
        search_string=search_string.substring(7);
      }
      dList lore=dList.valueOf(search_string);
      if (attribute.hasContext(3) && attribute.getAttribute(3).startsWith("String_Node_Str") && aH.matchesInteger(attribute.getContext(3))) {
        qty=attribute.getIntContext(3);
        attribs=3;
      }
      int found_items=0;
      if (strict) {
        strict_items:         for (        ItemStack item : getContents()) {
          if (item != null && item.hasItemMeta() && item.getItemMeta().hasLore()) {
            List<String> item_lore=item.getItemMeta().getLore();
            for (int i=0; i < item_lore.size(); i++) {
              if (lore.get(i).equalsIgnoreCase(item_lore.get(i))) {
                found_items++;
                if (found_items >= qty)                 break strict_items;
              }
            }
          }
        }
      }
 else {
        items:         for (        ItemStack item : getContents()) {
          if (item != null && item.hasItemMeta() && item.getItemMeta().hasLore()) {
            List<String> item_lore=item.getItemMeta().getLore();
            int loreCount=0;
            lines:             for (            String line : lore) {
              for (              String item_line : item_lore) {
                if (item_line.toLowerCase().contains(line.toLowerCase())) {
                  loreCount++;
                  continue lines;
                }
              }
            }
            if (loreCount == lore.size()) {
              found_items++;
              if (found_items >= qty)               break;
            }
          }
        }
      }
      return (found_items >= qty ? Element.TRUE.getAttribute(attribute.fulfill(attribs)) : Element.FALSE.getAttribute(attribute.fulfill(attribs)));
    }
  }
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(2)) {
      int qty=1;
      int attribs=2;
      dMaterial material=dMaterial.valueOf(attribute.getContext(2));
      if (attribute.hasContext(3) && attribute.getAttribute(3).startsWith("String_Node_Str") && aH.matchesInteger(attribute.getContext(3))) {
        qty=attribute.getIntContext(3);
        attribs=3;
      }
      int found_items=0;
      for (      ItemStack item : getContents()) {
        if (item != null && item.getType() == material.getMaterial()) {
          found_items++;
          if (found_items >= qty)           break;
        }
      }
      return (found_items >= qty ? Element.TRUE.getAttribute(attribute.fulfill(attribs)) : Element.FALSE.getAttribute(attribute.fulfill(attribs)));
    }
  }
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) {
      int qty=1;
      int attribs=1;
      if (attribute.getAttribute(2).startsWith("String_Node_Str") && attribute.hasContext(2) && aH.matchesInteger(attribute.getContext(2))) {
        qty=attribute.getIntContext(2);
        attribs=2;
      }
      return new Element(getInventory().containsAtLeast(dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC()).getItemStack(),qty)).getAttribute(attribute.fulfill(attribs));
    }
  }
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) {
      int qty=1;
      int attribs=1;
      if (attribute.getAttribute(2).startsWith("String_Node_Str") && attribute.hasContext(2) && aH.matchesInteger(attribute.getContext(2))) {
        qty=attribute.getIntContext(2);
        attribs=2;
      }
      return new Element(getInventory().containsAtLeast(dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC()).getItemStack(),qty)).getAttribute(attribute.fulfill(attribs));
    }
  }
  if (attribute.startsWith("String_Node_Str") && attribute.hasContext(2) && dMaterial.matches(attribute.getContext(2))) {
    dMaterial material=dMaterial.valueOf(attribute.getContext(2));
    int slot=-1;
    for (int i=0; i < inventory.getSize(); i++) {
      if (inventory.getItem(i) != null && inventory.getItem(i).getType() == material.getMaterial()) {
        slot=i + 1;
        break;
      }
    }
    return new Element(slot).getAttribute(attribute.fulfill(2));
  }
  if (attribute.startsWith("String_Node_Str") && attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) {
    dItem item=dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC());
    item.setAmount(1);
    int slot=-1;
    for (int i=0; i < inventory.getSize(); i++) {
      if (inventory.getItem(i) != null) {
        dItem compare_to=new dItem(inventory.getItem(i).clone());
        compare_to.setAmount(1);
        if (item.identify().equalsIgnoreCase(compare_to.identify())) {
          slot=i + 1;
          break;
        }
      }
    }
    return new Element(slot).getAttribute(attribute.fulfill(1));
  }
  if (attribute.startsWith("String_Node_Str")) {
    return new Element(idType).getAttribute(attribute.fulfill(1));
  }
  if (attribute.startsWith("String_Node_Str")) {
    dLocation location=getLocation();
    if (location != null)     return location.getAttribute(attribute.fulfill(1));
 else     return Element.NULL.getAttribute(attribute.fulfill(1));
  }
  if (attribute.startsWith("String_Node_Str"))   if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1)))   return new Element(count(dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC()).getItemStack(),false)).getAttribute(attribute.fulfill(1));
 else   return new Element(count(null,false)).getAttribute(attribute.fulfill(1));
  if (attribute.startsWith("String_Node_Str"))   if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1)))   return new Element(count(dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC()).getItemStack(),true)).getAttribute(attribute.fulfill(1));
 else   return new Element(count(null,true)).getAttribute(attribute.fulfill(1));
  if (attribute.startsWith("String_Node_Str") && attribute.hasContext(1) && aH.matchesInteger(attribute.getContext(1))) {
    int slot=new Element(attribute.getContext(1)).asInt() - 1;
    if (slot < 0)     slot=0;
    if (slot > getInventory().getSize() - 1)     slot=getInventory().getSize() - 1;
    return new dItem(getInventory().getItem(slot)).getAttribute(attribute.fulfill(1));
  }
  if (attribute.startsWith("String_Node_Str"))   return new Element(getInventory().getType().name()).getAttribute(attribute.fulfill(1));
  if (attribute.startsWith("String_Node_Str")) {
    dList equipment=getEquipment();
    if (equipment == null)     return Element.NULL.getAttribute(attribute.fulfill(1));
 else     return equipment.getAttribute(attribute.fulfill(1));
  }
  if (inventory instanceof CraftingInventory) {
    CraftingInventory craftingInventory=(CraftingInventory)inventory;
    if (attribute.startsWith("String_Node_Str")) {
      dList recipeList=new dList();
      for (      ItemStack item : craftingInventory.getMatrix()) {
        if (item != null)         recipeList.add(new dItem(item).identify());
 else         recipeList.add(new dItem(Material.AIR).identify());
      }
      return recipeList.getAttribute(attribute.fulfill(1));
    }
    if (attribute.startsWith("String_Node_Str")) {
      if (craftingInventory.getResult() != null)       return new dItem(craftingInventory.getResult()).getAttribute(attribute.fulfill(1));
 else       return Element.NULL.getAttribute(attribute.fulfill(1));
    }
  }
  for (  Property property : PropertyParser.getProperties(this)) {
    String returned=property.getAttribute(attribute);
    if (returned != null)     return returned;
  }
  return new Element(identify()).getAttribute(attribute);
}

Fixed version (ground truth):
public String getAttribute(Attribute attribute){
  if (attribute == null)   return null;
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(2)) {
      int qty=1;
      int attribs=2;
      String search_string=attribute.getContext(2);
      boolean strict=false;
      if (search_string.toLowerCase().startsWith("String_Node_Str") && search_string.length() > 7) {
        strict=true;
        search_string=search_string.substring(7);
      }
      if (attribute.getAttribute(3).startsWith("String_Node_Str") && attribute.hasContext(3) && aH.matchesInteger(attribute.getContext(3))) {
        qty=attribute.getIntContext(3);
        attribs=3;
      }
      int found_items=0;
      if (strict) {
        for (        ItemStack item : getContents()) {
          if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equalsIgnoreCase(search_string)) {
            found_items+=item.getAmount();
            if (found_items >= qty)             break;
          }
        }
      }
 else {
        for (        ItemStack item : getContents()) {
          if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().toLowerCase().contains(search_string.toLowerCase())) {
            found_items+=item.getAmount();
            if (found_items >= qty)             break;
          }
        }
      }
      return (found_items >= qty ? Element.TRUE.getAttribute(attribute.fulfill(attribs)) : Element.FALSE.getAttribute(attribute.fulfill(attribs)));
    }
  }
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(2)) {
      int qty=1;
      int attribs=2;
      String search_string=attribute.getContext(2);
      boolean strict=false;
      if (search_string.toLowerCase().startsWith("String_Node_Str")) {
        strict=true;
        search_string=search_string.substring(7);
      }
      dList lore=dList.valueOf(search_string);
      if (attribute.getAttribute(3).startsWith("String_Node_Str") && attribute.hasContext(3) && aH.matchesInteger(attribute.getContext(3))) {
        qty=attribute.getIntContext(3);
        attribs=3;
      }
      int found_items=0;
      if (strict) {
        strict_items:         for (        ItemStack item : getContents()) {
          if (item != null && item.hasItemMeta() && item.getItemMeta().hasLore()) {
            List<String> item_lore=item.getItemMeta().getLore();
            if (lore.size() != item_lore.size())             continue;
            for (int i=0; i < item_lore.size(); i++) {
              if (lore.get(i).equalsIgnoreCase(item_lore.get(i))) {
                if (i == lore.size()) {
                  found_items+=item.getAmount();
                  if (found_items >= qty)                   break strict_items;
                }
              }
 else               continue strict_items;
            }
          }
        }
      }
 else {
        items:         for (        ItemStack item : getContents()) {
          if (item != null && item.hasItemMeta() && item.getItemMeta().hasLore()) {
            List<String> item_lore=item.getItemMeta().getLore();
            int loreCount=0;
            lines:             for (            String line : lore) {
              for (              String item_line : item_lore) {
                if (item_line.toLowerCase().contains(line.toLowerCase())) {
                  loreCount++;
                  continue lines;
                }
              }
            }
            if (loreCount == lore.size()) {
              found_items+=item.getAmount();
              if (found_items >= qty)               break;
            }
          }
        }
      }
      return (found_items >= qty ? Element.TRUE.getAttribute(attribute.fulfill(attribs)) : Element.FALSE.getAttribute(attribute.fulfill(attribs)));
    }
  }
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(2)) {
      int qty=1;
      int attribs=2;
      dMaterial material=dMaterial.valueOf(attribute.getContext(2));
      if (attribute.getAttribute(3).startsWith("String_Node_Str") && attribute.hasContext(3) && aH.matchesInteger(attribute.getContext(3))) {
        qty=attribute.getIntContext(3);
        attribs=3;
      }
      int found_items=0;
      for (      ItemStack item : getContents()) {
        if (item != null && item.getType() == material.getMaterial()) {
          found_items+=item.getAmount();
          if (found_items >= qty)           break;
        }
      }
      return (found_items >= qty ? Element.TRUE.getAttribute(attribute.fulfill(attribs)) : Element.FALSE.getAttribute(attribute.fulfill(attribs)));
    }
  }
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) {
      int qty=1;
      int attribs=1;
      if (attribute.getAttribute(2).startsWith("String_Node_Str") && attribute.hasContext(2) && aH.matchesInteger(attribute.getContext(2))) {
        qty=attribute.getIntContext(2);
        attribs=2;
      }
      return new Element(getInventory().containsAtLeast(dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC()).getItemStack(),qty)).getAttribute(attribute.fulfill(attribs));
    }
  }
  if (attribute.startsWith("String_Node_Str")) {
    if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) {
      int qty=1;
      int attribs=1;
      if (attribute.getAttribute(2).startsWith("String_Node_Str") && attribute.hasContext(2) && aH.matchesInteger(attribute.getContext(2))) {
        qty=attribute.getIntContext(2);
        attribs=2;
      }
      return new Element(getInventory().containsAtLeast(dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC()).getItemStack(),qty)).getAttribute(attribute.fulfill(attribs));
    }
  }
  if (attribute.startsWith("String_Node_Str") && attribute.hasContext(2) && dMaterial.matches(attribute.getContext(2))) {
    dMaterial material=dMaterial.valueOf(attribute.getContext(2));
    int slot=-1;
    for (int i=0; i < inventory.getSize(); i++) {
      if (inventory.getItem(i) != null && inventory.getItem(i).getType() == material.getMaterial()) {
        slot=i + 1;
        break;
      }
    }
    return new Element(slot).getAttribute(attribute.fulfill(2));
  }
  if (attribute.startsWith("String_Node_Str") && attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) {
    dItem item=dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC());
    item.setAmount(1);
    int slot=-1;
    for (int i=0; i < inventory.getSize(); i++) {
      if (inventory.getItem(i) != null) {
        dItem compare_to=new dItem(inventory.getItem(i).clone());
        compare_to.setAmount(1);
        if (item.identify().equalsIgnoreCase(compare_to.identify())) {
          slot=i + 1;
          break;
        }
      }
    }
    return new Element(slot).getAttribute(attribute.fulfill(1));
  }
  if (attribute.startsWith("String_Node_Str")) {
    return new Element(idType).getAttribute(attribute.fulfill(1));
  }
  if (attribute.startsWith("String_Node_Str")) {
    dLocation location=getLocation();
    if (location != null)     return location.getAttribute(attribute.fulfill(1));
 else     return Element.NULL.getAttribute(attribute.fulfill(1));
  }
  if (attribute.startsWith("String_Node_Str"))   if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1)))   return new Element(count(dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC()).getItemStack(),false)).getAttribute(attribute.fulfill(1));
 else   return new Element(count(null,false)).getAttribute(attribute.fulfill(1));
  if (attribute.startsWith("String_Node_Str"))   if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1)))   return new Element(count(dItem.valueOf(attribute.getContext(1),attribute.getScriptEntry().getPlayer(),attribute.getScriptEntry().getNPC()).getItemStack(),true)).getAttribute(attribute.fulfill(1));
 else   return new Element(count(null,true)).getAttribute(attribute.fulfill(1));
  if (attribute.startsWith("String_Node_Str") && attribute.hasContext(1) && aH.matchesInteger(attribute.getContext(1))) {
    int slot=new Element(attribute.getContext(1)).asInt() - 1;
    if (slot < 0)     slot=0;
    if (slot > getInventory().getSize() - 1)     slot=getInventory().getSize() - 1;
    return new dItem(getInventory().getItem(slot)).getAttribute(attribute.fulfill(1));
  }
  if (attribute.startsWith("String_Node_Str"))   return new Element(getInventory().getType().name()).getAttribute(attribute.fulfill(1));
  if (attribute.startsWith("String_Node_Str")) {
    dList equipment=getEquipment();
    if (equipment == null)     return Element.NULL.getAttribute(attribute.fulfill(1));
 else     return equipment.getAttribute(attribute.fulfill(1));
  }
  if (inventory instanceof CraftingInventory) {
    CraftingInventory craftingInventory=(CraftingInventory)inventory;
    if (attribute.startsWith("String_Node_Str")) {
      dList recipeList=new dList();
      for (      ItemStack item : craftingInventory.getMatrix()) {
        if (item != null)         recipeList.add(new dItem(item).identify());
 else         recipeList.add(new dItem(Material.AIR).identify());
      }
      return recipeList.getAttribute(attribute.fulfill(1));
    }
    if (attribute.startsWith("String_Node_Str")) {
      if (craftingInventory.getResult() != null)       return new dItem(craftingInventory.getResult()).getAttribute(attribute.fulfill(1));
 else       return Element.NULL.getAttribute(attribute.fulfill(1));
    }
  }
  for (  Property property : PropertyParser.getProperties(this)) {
    String returned=property.getAttribute(attribute);
    if (returned != null)     return returned;
  }
  return new Element(identify()).getAttribute(attribute);
}