-
Notifications
You must be signed in to change notification settings - Fork 123
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
ThreadlocalRandom instead of ThreadLocal #367
Comments
Flogger is JDK 7 currently. |
But isn't |
Weirdly not, despite the initial JavaDoc saying so (many methods are individually listed as 1.8). https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadLocalRandom.html Basically I originally wrote it with TLR and it didn't compile, so I switched to doing it manually. If someone can get it working (including Android) with TLR I'm fine with it, but it didn't work when I tried it. I don't think it's a big deal though, but thanks for suggesting it. David |
I'm also seeing that
Not a huge deal, but probably an easy enough change to make if we wanted... |
The limitation is very likely Android. |
I guess there's a chance I started writing this bit of API before Flogger bumped to 1.7 and I'm misremembering which version was causing the issue. It's been internally available in Google for a while now. |
I can provide a PR refactoring this, if this doesn't create more work for you. Is there some android CI? |
The Android work is internal to Google and not open sourced. |
Hey,
While reading the changes in the newest releases and the code for it, I saw this comment. https://github.com/google/flogger/blob/master/api/src/main/java/com/google/common/flogger/SamplingRateLimiter.java#L55 If I understand the build system correct flogger requires at least java 8, so ThreadLocalRandom(https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadLocalRandom.html) or
ThreadLocal.withInitial
is available. Is the comment a relict of the past and the code could be changed?The text was updated successfully, but these errors were encountered: