Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
techsy730 opened this issue Dec 18, 2020 · 1 comment

Comments

@techsy730
Copy link
Contributor

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
Copy link
Contributor Author

Low priority as we have such methods @Deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant