>  IntelliJ specifies Runtime retention so they can interact
with IntelliJ's internal JRE, which adds additional assertions into the
code to enforce the annotations.

seems never.
see this demo repo.
https://github.com/XenoAmess/demo_jetbrains_annotation

And I looked up the sources and see every annotation classes be
with RetentionPolicy.CLASS or RetentionPolicy.SOURCE

HOWEVER, I was talking about org.jetbrainss.annotations.
but for jsr305, which is google java codes, I will not be very surprised if
they have different ideas.

Miguel Muñoz <swingguy1...@gmail.com> 于2020年8月28日周五 下午1:54写道:

> Good question. IntelliJ specifies Runtime retention so they can interact
> with IntelliJ's internal JRE, which adds additional assertions into the
> code to enforce the annotations. So even though they have Runtime
> retention, they're still a development-phase tool. In production, they
> don't need to be retained at runtime. Personally, I never need the Runtime
> retention feature, so if we write our own annotations, we can give them
> compile-time retention and they'll work fine. That's often how I work. In
> fact, I often use my own annotations, which don't have Runtime retention,
> and they work fine, so I don't miss that feature.
>
> — Miguel Muñoz
>
> On Tue, Aug 25, 2020 at 12:36 PM Jochen Wiedmann <
> jochen.wiedm...@gmail.com>
> wrote:
>
> > On Tue, Aug 25, 2020 at 9:08 PM sebb <seb...@gmail.com> wrote:
> >
> > > AFAIK that means Maven won't download the dependency.
> > > Surely that makes it harder for the developer?
> >
> > No, it means that Maven won't add the dependency to a distribution.
> >
> > However, I've got a question: These annotations have
> > @Retention(Runtime). (See
> >
> >
> https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/latest/javax/annotation/Nullable.html
> > .)
> > Aren't we enforcing the presence of the respective jar at runtime?
> >
> >
> > Jochen
> >
> > --
> >
> > Look, that's why there's rules, understand? So that you think before
> > you break 'em.
> >
> >     -- (Terry Pratchett, Thief of Time)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >
>

Reply via email to