fastutil icon indicating copy to clipboard operation
fastutil copied to clipboard

[Feature Request] Have an optional tripwire bit to detect Boxing/Unboxing

Open techsy730 opened this issue 4 years ago • 1 comments

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.

techsy730 avatar Dec 18 '20 21:12 techsy730

Low priority as we have such methods @Deprecated

techsy730 avatar Dec 18 '20 21:12 techsy730