You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Anton Vinogradov <av...@apache.org> on 2016/07/28 08:09:17 UTC

JetBrains Annotaions usage.

Igniters,

As you may know we had only 2 dependencies at ignite-core: jcache and
ignite-shmen.

IGNITE-3323 Get rid of copypasted JB annotations, use dependency instead.
<https://issues.apache.org/jira/browse/IGNITE-3323> brings one more
dependency to org.jetbrains.annotations.
This solves problems for people using JB annotations at their projects. but
makes ignite-core less dependency-lightweight.

JB annotaions are used to highlight null problems in IDE and provide some
understanding to users on whether null is allowed/possible in concrete
place. I doubt other products/frameworks use it much.

But, do we really need them? As for me, we can replace all these
annotations by asserts.

I propose to discontinue usage of jb annotation and replace them by asserts.

Thoughts?

Re: JetBrains Annotaions usage.

Posted by Anton Vinogradov <av...@gridgain.com>.
Alexey, thanks for tips.
Seems maven dependency's "optional" tag can handle this.
See pullrequest <https://github.com/apache/ignite/pull/909> for details.
P.s. I'm not pretty sure this change will not brake something, need to
recheck it twice.

On Thu, Jul 28, 2016 at 5:15 PM, Alexey Goncharuk <
alexey.goncharuk@gmail.com> wrote:

> According to the JLS [1], adding or removing annotations has no effect on
> the correct linkage of the binary representations of programs in the Java
> programming language. Even if these annotations were RUNTIME, a user could
> successfully use Ignite unless he explicitly uses those classes in runtime.
> See also [2]
>
> [1]
> https://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html#jls-13.5.7
> [2] http://bugs.java.com/view_bug.do?bug_id=6322301
>
> 2016-07-28 16:29 GMT+03:00 Anton Vinogradov <av...@gridgain.com>:
>
> > Dmitriy,
> >
> > Annotations have @Retention(RetentionPolicy.CLASS)
> > which means
> >      * Annotations are to be recorded in the class file by the compiler
> >      * but need not be retained by the VM at run time.  This is the
> default
> >      * behavior.
> >
> > So, from what I understand, everyone using ignite API with such
> annotations
> > still require them, correct?
> >
> > On Thu, Jul 28, 2016 at 4:16 PM, Dmitriy Setrakyan <
> dsetrakyan@apache.org>
> > wrote:
> >
> > > Anton, compile-time annotations should mean that Ignite should not
> > require
> > > these libraries at runtime. Did you try it already and run into issues?
> > >
> > > On Thu, Jul 28, 2016 at 4:34 AM, Anton Vinogradov <
> > > avinogradov@gridgain.com>
> > > wrote:
> > >
> > > > Possible, what's the solution in this case?
> > > >
> > > > On Thu, Jul 28, 2016 at 11:17 AM, Sergi Vladykin <
> > > sergi.vladykin@gmail.com
> > > > >
> > > > wrote:
> > > >
> > > > > I don't think that JB annotations is a runtime dependency, we
> should
> > > need
> > > > > them only at compile time, no?
> > > > >
> > > > > Sergi
> > > > >
> > > > > 2016-07-28 11:09 GMT+03:00 Anton Vinogradov <av...@apache.org>:
> > > > >
> > > > > > Igniters,
> > > > > >
> > > > > > As you may know we had only 2 dependencies at ignite-core: jcache
> > and
> > > > > > ignite-shmen.
> > > > > >
> > > > > > IGNITE-3323 Get rid of copypasted JB annotations, use dependency
> > > > instead.
> > > > > > <https://issues.apache.org/jira/browse/IGNITE-3323> brings one
> > more
> > > > > > dependency to org.jetbrains.annotations.
> > > > > > This solves problems for people using JB annotations at their
> > > projects.
> > > > > but
> > > > > > makes ignite-core less dependency-lightweight.
> > > > > >
> > > > > > JB annotaions are used to highlight null problems in IDE and
> > provide
> > > > some
> > > > > > understanding to users on whether null is allowed/possible in
> > > concrete
> > > > > > place. I doubt other products/frameworks use it much.
> > > > > >
> > > > > > But, do we really need them? As for me, we can replace all these
> > > > > > annotations by asserts.
> > > > > >
> > > > > > I propose to discontinue usage of jb annotation and replace them
> by
> > > > > > asserts.
> > > > > >
> > > > > > Thoughts?
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: JetBrains Annotaions usage.

Posted by Alexey Goncharuk <al...@gmail.com>.
According to the JLS [1], adding or removing annotations has no effect on
the correct linkage of the binary representations of programs in the Java
programming language. Even if these annotations were RUNTIME, a user could
successfully use Ignite unless he explicitly uses those classes in runtime.
See also [2]

[1] https://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html#jls-13.5.7
[2] http://bugs.java.com/view_bug.do?bug_id=6322301

2016-07-28 16:29 GMT+03:00 Anton Vinogradov <av...@gridgain.com>:

> Dmitriy,
>
> Annotations have @Retention(RetentionPolicy.CLASS)
> which means
>      * Annotations are to be recorded in the class file by the compiler
>      * but need not be retained by the VM at run time.  This is the default
>      * behavior.
>
> So, from what I understand, everyone using ignite API with such annotations
> still require them, correct?
>
> On Thu, Jul 28, 2016 at 4:16 PM, Dmitriy Setrakyan <ds...@apache.org>
> wrote:
>
> > Anton, compile-time annotations should mean that Ignite should not
> require
> > these libraries at runtime. Did you try it already and run into issues?
> >
> > On Thu, Jul 28, 2016 at 4:34 AM, Anton Vinogradov <
> > avinogradov@gridgain.com>
> > wrote:
> >
> > > Possible, what's the solution in this case?
> > >
> > > On Thu, Jul 28, 2016 at 11:17 AM, Sergi Vladykin <
> > sergi.vladykin@gmail.com
> > > >
> > > wrote:
> > >
> > > > I don't think that JB annotations is a runtime dependency, we should
> > need
> > > > them only at compile time, no?
> > > >
> > > > Sergi
> > > >
> > > > 2016-07-28 11:09 GMT+03:00 Anton Vinogradov <av...@apache.org>:
> > > >
> > > > > Igniters,
> > > > >
> > > > > As you may know we had only 2 dependencies at ignite-core: jcache
> and
> > > > > ignite-shmen.
> > > > >
> > > > > IGNITE-3323 Get rid of copypasted JB annotations, use dependency
> > > instead.
> > > > > <https://issues.apache.org/jira/browse/IGNITE-3323> brings one
> more
> > > > > dependency to org.jetbrains.annotations.
> > > > > This solves problems for people using JB annotations at their
> > projects.
> > > > but
> > > > > makes ignite-core less dependency-lightweight.
> > > > >
> > > > > JB annotaions are used to highlight null problems in IDE and
> provide
> > > some
> > > > > understanding to users on whether null is allowed/possible in
> > concrete
> > > > > place. I doubt other products/frameworks use it much.
> > > > >
> > > > > But, do we really need them? As for me, we can replace all these
> > > > > annotations by asserts.
> > > > >
> > > > > I propose to discontinue usage of jb annotation and replace them by
> > > > > asserts.
> > > > >
> > > > > Thoughts?
> > > > >
> > > >
> > >
> >
>

Re: JetBrains Annotaions usage.

Posted by Anton Vinogradov <av...@gridgain.com>.
Dmitriy,

Annotations have @Retention(RetentionPolicy.CLASS)
which means
     * Annotations are to be recorded in the class file by the compiler
     * but need not be retained by the VM at run time.  This is the default
     * behavior.

So, from what I understand, everyone using ignite API with such annotations
still require them, correct?

On Thu, Jul 28, 2016 at 4:16 PM, Dmitriy Setrakyan <ds...@apache.org>
wrote:

> Anton, compile-time annotations should mean that Ignite should not require
> these libraries at runtime. Did you try it already and run into issues?
>
> On Thu, Jul 28, 2016 at 4:34 AM, Anton Vinogradov <
> avinogradov@gridgain.com>
> wrote:
>
> > Possible, what's the solution in this case?
> >
> > On Thu, Jul 28, 2016 at 11:17 AM, Sergi Vladykin <
> sergi.vladykin@gmail.com
> > >
> > wrote:
> >
> > > I don't think that JB annotations is a runtime dependency, we should
> need
> > > them only at compile time, no?
> > >
> > > Sergi
> > >
> > > 2016-07-28 11:09 GMT+03:00 Anton Vinogradov <av...@apache.org>:
> > >
> > > > Igniters,
> > > >
> > > > As you may know we had only 2 dependencies at ignite-core: jcache and
> > > > ignite-shmen.
> > > >
> > > > IGNITE-3323 Get rid of copypasted JB annotations, use dependency
> > instead.
> > > > <https://issues.apache.org/jira/browse/IGNITE-3323> brings one more
> > > > dependency to org.jetbrains.annotations.
> > > > This solves problems for people using JB annotations at their
> projects.
> > > but
> > > > makes ignite-core less dependency-lightweight.
> > > >
> > > > JB annotaions are used to highlight null problems in IDE and provide
> > some
> > > > understanding to users on whether null is allowed/possible in
> concrete
> > > > place. I doubt other products/frameworks use it much.
> > > >
> > > > But, do we really need them? As for me, we can replace all these
> > > > annotations by asserts.
> > > >
> > > > I propose to discontinue usage of jb annotation and replace them by
> > > > asserts.
> > > >
> > > > Thoughts?
> > > >
> > >
> >
>

Re: JetBrains Annotaions usage.

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Anton, compile-time annotations should mean that Ignite should not require
these libraries at runtime. Did you try it already and run into issues?

On Thu, Jul 28, 2016 at 4:34 AM, Anton Vinogradov <av...@gridgain.com>
wrote:

> Possible, what's the solution in this case?
>
> On Thu, Jul 28, 2016 at 11:17 AM, Sergi Vladykin <sergi.vladykin@gmail.com
> >
> wrote:
>
> > I don't think that JB annotations is a runtime dependency, we should need
> > them only at compile time, no?
> >
> > Sergi
> >
> > 2016-07-28 11:09 GMT+03:00 Anton Vinogradov <av...@apache.org>:
> >
> > > Igniters,
> > >
> > > As you may know we had only 2 dependencies at ignite-core: jcache and
> > > ignite-shmen.
> > >
> > > IGNITE-3323 Get rid of copypasted JB annotations, use dependency
> instead.
> > > <https://issues.apache.org/jira/browse/IGNITE-3323> brings one more
> > > dependency to org.jetbrains.annotations.
> > > This solves problems for people using JB annotations at their projects.
> > but
> > > makes ignite-core less dependency-lightweight.
> > >
> > > JB annotaions are used to highlight null problems in IDE and provide
> some
> > > understanding to users on whether null is allowed/possible in concrete
> > > place. I doubt other products/frameworks use it much.
> > >
> > > But, do we really need them? As for me, we can replace all these
> > > annotations by asserts.
> > >
> > > I propose to discontinue usage of jb annotation and replace them by
> > > asserts.
> > >
> > > Thoughts?
> > >
> >
>

Re: JetBrains Annotaions usage.

Posted by Anton Vinogradov <av...@gridgain.com>.
Possible, what's the solution in this case?

On Thu, Jul 28, 2016 at 11:17 AM, Sergi Vladykin <se...@gmail.com>
wrote:

> I don't think that JB annotations is a runtime dependency, we should need
> them only at compile time, no?
>
> Sergi
>
> 2016-07-28 11:09 GMT+03:00 Anton Vinogradov <av...@apache.org>:
>
> > Igniters,
> >
> > As you may know we had only 2 dependencies at ignite-core: jcache and
> > ignite-shmen.
> >
> > IGNITE-3323 Get rid of copypasted JB annotations, use dependency instead.
> > <https://issues.apache.org/jira/browse/IGNITE-3323> brings one more
> > dependency to org.jetbrains.annotations.
> > This solves problems for people using JB annotations at their projects.
> but
> > makes ignite-core less dependency-lightweight.
> >
> > JB annotaions are used to highlight null problems in IDE and provide some
> > understanding to users on whether null is allowed/possible in concrete
> > place. I doubt other products/frameworks use it much.
> >
> > But, do we really need them? As for me, we can replace all these
> > annotations by asserts.
> >
> > I propose to discontinue usage of jb annotation and replace them by
> > asserts.
> >
> > Thoughts?
> >
>

Re: JetBrains Annotaions usage.

Posted by Sergi Vladykin <se...@gmail.com>.
I don't think that JB annotations is a runtime dependency, we should need
them only at compile time, no?

Sergi

2016-07-28 11:09 GMT+03:00 Anton Vinogradov <av...@apache.org>:

> Igniters,
>
> As you may know we had only 2 dependencies at ignite-core: jcache and
> ignite-shmen.
>
> IGNITE-3323 Get rid of copypasted JB annotations, use dependency instead.
> <https://issues.apache.org/jira/browse/IGNITE-3323> brings one more
> dependency to org.jetbrains.annotations.
> This solves problems for people using JB annotations at their projects. but
> makes ignite-core less dependency-lightweight.
>
> JB annotaions are used to highlight null problems in IDE and provide some
> understanding to users on whether null is allowed/possible in concrete
> place. I doubt other products/frameworks use it much.
>
> But, do we really need them? As for me, we can replace all these
> annotations by asserts.
>
> I propose to discontinue usage of jb annotation and replace them by
> asserts.
>
> Thoughts?
>