OddItem

25k Downloads

OddItem should use primitives if possible

chrisyco opened this issue ยท 0 comments

commented

Some methods (such as compare) accept primitives, while others (such as getItemStack) accept boxed values.

According to the Java documentation:

An Integer is not a substitute for an int; autoboxing and unboxing blur the distinction between primitive types and reference types, but they do not eliminate it.

I understand the inconsistency in OddItem is probably for backwards compatibility. But according to Stack Overflow, it is possible to have a fully boxed and fully unboxed version together without ambiguity issues -- just don't try to mix them. We can just mark the boxed version as @Deprecated and remove it in the next major release without fuss.