-
Notifications
You must be signed in to change notification settings - Fork 344
Add nullable annotation to Tracer#extract #284
Conversation
Maybe @yurishkuro @pavolloffay have something to comment here? ;) |
I think the IDE would show you the help message only if the scope f the dependency were compile. I don't think it's worth to add an extra dependency to API artifact for |
Especially since JSR 305 exposes a 'split package' ( |
@pavolloffay it does not add a dependency to the api artifact, See the description in #203 (which probably could be closed now) |
How can this not be considered adding a dependency when the annotation is actually used in the API code signatures? @Nullable
<C> SpanContext extract(Format<C> format, C carrier); This compiles ok, but will fail in my project if I don't have I also think it is not worth the trouble (at least until the whole split package is resolved by Oracle blessing one big module that contains all current |
As far as I know - it wont, the annotation jar/class is not needed at runtime. Guava had jar305 as an |
@mabn Wouldn't reflecting the |
Annotations don't need to be present at runtime. When reflectively accessing a methods annotations, only those which are actually on the classpath are returned. No |
@felixbarny Thanks, learned something again 😄
Good to know! That takes care of my main concern. |
@felixbarny @realark does IDE show warning message even though the scope of |
IntelliJ 2018.1 does take the annotations into account even when they are not on the classpath. I'd assume the AST IDEs create are based on the bytecode and that they don't use reflection to introspect classes. I would however be consistent in declaring the annotations to either be |
@pavolloffay Intellij 2017.3.4 does show the warning even with the optional scope. @felixbarny (or anyone else) any objections to using |
Is |
I would prefer to leave the dependency out of
What was the reasoning of not having it both optional and provided? 😉 |
That probably works as well. When I wrote that, I didn't realize that one declaration was inside |
@Nullable
annotation toTracer#extract
Closes #168
Closes #203