Program: 178044
Project: 178044
Buggy source:
/** 
 * Gets the data value from a string
 * @param type     Data Value string
 * @param material Material
 * @return data value
 */
public static byte get(String type,Material material){
  if (material == null || material.getData() == null) {
    return 0;
  }
  type=type.toUpperCase().replace("String_Node_Str","String_Node_Str");
  MaterialData materialData=material.getNewData((byte)0);
  if (materialData instanceof TexturedMaterial) {
    TexturedMaterial texturedMaterial=(TexturedMaterial)materialData;
    for (    Material mat : texturedMaterial.getTextures()) {
      if (mat.name().startsWith(type) && !mat.equals(material)) {
        return (byte)texturedMaterial.getTextures().indexOf(mat);
      }
    }
  }
 else   if (materialData instanceof Colorable) {
    DyeColor color;
    try {
      color=DyeColor.valueOf(type);
    }
 catch (    IllegalArgumentException exception) {
      return 0;
    }
    if (material == Material.INK_SACK) {
      return color.getDyeData();
    }
    return color.getWoolData();
  }
 else   if (materialData instanceof Tree) {
    try {
      return TreeSpecies.valueOf(type).getData();
    }
 catch (    IllegalArgumentException ex) {
      return 0;
    }
  }
 else   if (materialData instanceof SpawnEgg) {
    try {
      EntityType entityType=EntityType.valueOf(type);
      return (byte)entityType.getTypeId();
    }
 catch (    IllegalArgumentException ex) {
      return 0;
    }
  }
 else   if (materialData instanceof Coal) {
    try {
      return CoalType.valueOf(type).getData();
    }
 catch (    IllegalArgumentException ex) {
      return 0;
    }
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Gets the data value from a string
 * @param type     Data Value string
 * @param material Material
 * @return data value
 */
public static byte get(String type,Material material){
  if (material == null || material.getData() == null) {
    return 0;
  }
  type=type.toUpperCase().replace("String_Node_Str","String_Node_Str");
  MaterialData materialData=material.getNewData((byte)0);
  if (materialData instanceof TexturedMaterial) {
    TexturedMaterial texturedMaterial=(TexturedMaterial)materialData;
    for (    Material mat : texturedMaterial.getTextures()) {
      if (mat.name().startsWith(type) && !mat.equals(material)) {
        return (byte)texturedMaterial.getTextures().indexOf(mat);
      }
    }
  }
 else   if (materialData instanceof Colorable || material == Material.BANNER) {
    DyeColor color;
    try {
      color=DyeColor.valueOf(type);
    }
 catch (    IllegalArgumentException exception) {
      return 0;
    }
    if (material == Material.INK_SACK || material == Material.BANNER) {
      return color.getDyeData();
    }
    return color.getWoolData();
  }
 else   if (materialData instanceof Tree) {
    try {
      return TreeSpecies.valueOf(type).getData();
    }
 catch (    IllegalArgumentException ex) {
      return 0;
    }
  }
 else   if (materialData instanceof SpawnEgg) {
    try {
      EntityType entityType=EntityType.valueOf(type);
      return (byte)entityType.getTypeId();
    }
 catch (    IllegalArgumentException ex) {
      return 0;
    }
  }
 else   if (materialData instanceof Coal) {
    try {
      return CoalType.valueOf(type).getData();
    }
 catch (    IllegalArgumentException ex) {
      return 0;
    }
  }
  return 0;
}