A new inspection was added in IntelliJ 2018.2 which should warn from unstable APIs: https://youtrack.jetbrains.com/issue/IDEA-159541.
This warning shows up for the Guava's EventBus. Why is this an unstable API?
Because the EventBus
class is annotated as @Beta
.
You'd have to ask the Guava project maintainers why a class that exists for 16 versions of Guava is still Beta, but it still is.
Besides @JB Nizet's answer that perfectly explains why IntelliJ flags this error, you may also want to suppress it globally but only for the Google Beta annotations.
Just go to Settings -> Editor -> Inspections -> JVM languages
as per the picture below and, if you feel like it, delete the com.google.common.anotations.Beta
.
You can also ask IntelliJ to suppress the warning for the definition of your @Beta
annotated class as follows:
@SuppressWarnings("UnstableApiUsage")
static RateLimiter API_RATE_LIMITER = RateLimiter.create(8);
This properly deals with the warning in a particular case when you're okay with using the class anyway (and don't run into issues).
EventBus class is marked with the @com.google.common.annotations.Beta
annotation. So I think the inspection is triggering on that. See: https://google.github.io/guava/releases/22.0/api/docs/com/google/common/eventbus/EventBus.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With