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.
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, callingnext()
instead ofnextInt()
, or giving an Object based consumer instead of anIntConsumer
to aforEach
. 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.