fastutil
fastutil copied to clipboard
[Feature Request] Have an optional tripwire bit to detect Boxing/Unboxing
OpenJDK has a nifty feature where if you set the org.openjdk.java.util.stream.tripwire
system property to "true"
, then warnings will be logged if a boxing/unboxing method is called that has a primitive equivalent. For example, calling next()
instead of nextInt()
, or giving an Object based consumer instead of an IntConsumer
to a forEach
.
See https://docs.oracle.com/javase/8/docs/api/java/util/PrimitiveIterator.html for where it is described.
Perhaps fastutil can have a similar sort of flag to help developers expose cases where they are boxing/unboxing when they weren't expecting it.
Low priority as we have such methods @Deprecated