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

FR: help users avoid Duration#getNanos/toNanos foot gun #657

Closed
iamdanfox opened this issue Jun 20, 2019 · 2 comments
Closed

FR: help users avoid Duration#getNanos/toNanos foot gun #657

iamdanfox opened this issue Jun 20, 2019 · 2 comments

Comments

@iamdanfox
Copy link
Contributor

What happened?

I just wrote some silly code:

future.get(duration.getNanos(), TimeUnit.NANOSECONDS);

What did you want to happen?

I intended to write:

future.get(duration.toNanos(), TimeUnit.NANOSECONDS);
@gatesn
Copy link
Contributor

gatesn commented Jun 28, 2019

@carterkozak
Copy link
Contributor

This should already be covered by JavaDurationGetSecondsGetNano which uses WARNING level by default.

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

No branches or pull requests

4 participants