Buggy code:
private int itemId ; private byte itemData ; private boolean isLegal = true ; private boolean hasData = false ; private int maxStack = 64 ; private short maxdamage = 0 ; public String name = null ; private LinkedList < CraftRecipe > recipes = new LinkedList < CraftRecipe > ( ) ; private static int [ ] tools = new int [ ] { 256 , 257 , 258 , 259 , 267 , 268 , 269 , 270 , 271 , 272 , 273 , 274 , 275 , 276 , 277 , 278 , 278 , 279 , 283 , 284 , 285 , 286 , 290 , 291 , 292 , 293 , 294 , 298 , 299 , 300 , 301 , 302 , 303 , 304 , 305 , 306 , 307 , 308 , 309 , 310 , 311 , 312 , 313 , 314 , 315 , 316 , 317 , 346 , 359 } ; private JItems ( String name , int id ) { } private JItems ( String name , int id , boolean legal ) { } private JItems ( String name , int id , byte dat ) { } private JItems ( String name , int id , int maxStack ) { } private JItems ( String name , int id , int maxStack , boolean legal ) { } private JItems ( String name , int id , byte dat , boolean legal ) { } private JItems ( String name , int id , String craftRecipies ) { } private JItems ( String name , int id , String craftRecipies , boolean legal ) { } private JItems ( String name , int id , byte dat , String craftRecipies ) { } private JItems ( String name , int id , String craftRecipies , int maxStack ) { } private JItems ( String name , int id , String craftRecipies , int maxStack , boolean legal ) { } private JItems ( String name , int id , String craftRecipies , short maxDamage ) { } private JItems ( String name , int id , String craftRecipies , short maxDamage , boolean legal ) { } private JItems ( String name , int id , String craftRecipies , int maxStack , short maxDamage ) { } private JItems ( String name , int id , byte dat , String craftRecipies , int maxStack , short maxDamage ) { } private JItems ( String name , int id , byte dat , String craftRecipies , boolean legal ) { } private JItems ( int id ) { } private JItems ( int id , byte dat ) { } private boolean SetID ( int id ) { } private void AutoName ( ) { } public int ID ( ) { } public byte Data ( ) { } public short MaxDamage ( ) { } public boolean IsTool ( ) { } public boolean IsLegal ( ) { } public int MaxStackSize ( ) { } public String IdDatStr ( ) { } public String getName ( ) { } public void setName ( String newname ) { } protected void setMaxStack ( int stack ) { } private JItem _getIdDat ( String datStr ) { } private CraftRecipe _getRecipe ( String craftStr ) { } private void _setRecipe ( String craft ) { } public boolean HasRecipe ( ) { } public Kit [ ] GetRecipeAsKit ( int index ) { } public Kit [ ] GetFullRecipeKits ( ) { } public CraftRecipe GetRecipe ( int index ) { } public CraftRecipe [ ] GetRecipes ( ) { } public ItemStack toItemStack ( ) { } public ItemStack toItemStack ( int amount ) { } public boolean isEntity ( ) { } public static JItems getItem ( int id ) { } public static JItems getItem ( int id , byte dat ) { } public static JItems getItem ( Material material ) { } public static JItems findItem ( Item search ) { } public static int getMaxStack ( int id , byte dat ) { } public static int getMaxStack ( ItemStack it ) { <START_BUG> JItems i = JItems . getItem ( it . getTypeId ( ) , ( ( it . getData ( ) ) == null ? 0 : it . getData ( ) . getData ( ) ) ) ; <END_BUG> return i == null ? 64 : i . MaxStackSize ( ) ; } public static boolean isTool ( int id ) { } public static boolean isTool ( ItemStack it ) { } public static boolean hasData ( int id ) { } @ Override public String toString ( ) { } public boolean equals ( ItemStack i ) { } }

Fix:
JItems i = ( it == null ) ? null : JItems . getItem ( it . getTypeId ( ) , ( ( it . getData ( ) ) == null ? 0 : it . getData ( ) . getData ( ) ) ) ;