You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Stefan Seifert <ss...@pro-vision.de> on 2018/08/02 08:55:58 UTC

[VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

as recently discussed in SLING-7312 and the mailing list the JSR-305 annotations for null-analysis (javax.annotations) we are currently using break our compatibility with Java 9. the problem is that JSR-305 was never accepted and thus it's hard and troublesome to use them in Java 9 (see [1]). there are several alternatives for nullable annotations with good tool support, but some of them (e.g. findbugs/spotbugs annotations) use a license not fully compatible with the apache license (discussed in [2]).

the jackrabbit/oak team has decided to switch to jetbrains annotations [3][4][5] and developed some tooling to ease the migration. although coming from the manufacturer of IntelliJ there is wide tool support for them e.g. in FindBugs/SpotBugs, Sonar and can be configured in Eclipse as well.

i've created a ticket [6] to describe the steps we need to go and which sling modules are affected. this ticket is about to get a consensus that the jetbrains annotations are the way we want to go.

benefits:
- removes a blocker from achieving Java 9 compatibility
- same annotations as used by jackrabbit/oak
- tooling for migration available
- jetbrains annotations use apache 2.0 license
- wide-spread tooling support for jetbrains annotations (which would not be the case if we develop our own annotations)

drawbacks:
- the jetbrains annotations include some more (mostly IntelliJ-specific) annotations than only the nullable annotations
- the jetbrains annotations are no "standard annotations"


Please vote to approve switching to Jetbrains Annotations:

  [ ] +1 Switch to Jetbrains Annotations
  [ ]  0 Don't care
  [ ] -1 Don't switch to Jetbrains Annotations


stefan


[1] https://blog.codefx.org/java/jsr-305-java-9/
[2] https://issues.apache.org/jira/browse/JCR-4301
[3] https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
[4] http://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/
[5] https://github.com/JetBrains/java-annotations
[6] https://issues.apache.org/jira/browse/SLING-7798



Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Konrad Windszus <ko...@gmx.de>.
+1

> On 2. Aug 2018, at 10:55, Stefan Seifert <ss...@pro-vision.de> wrote:
> 
> as recently discussed in SLING-7312 and the mailing list the JSR-305 annotations for null-analysis (javax.annotations) we are currently using break our compatibility with Java 9. the problem is that JSR-305 was never accepted and thus it's hard and troublesome to use them in Java 9 (see [1]). there are several alternatives for nullable annotations with good tool support, but some of them (e.g. findbugs/spotbugs annotations) use a license not fully compatible with the apache license (discussed in [2]).
> 
> the jackrabbit/oak team has decided to switch to jetbrains annotations [3][4][5] and developed some tooling to ease the migration. although coming from the manufacturer of IntelliJ there is wide tool support for them e.g. in FindBugs/SpotBugs, Sonar and can be configured in Eclipse as well.
> 
> i've created a ticket [6] to describe the steps we need to go and which sling modules are affected. this ticket is about to get a consensus that the jetbrains annotations are the way we want to go.
> 
> benefits:
> - removes a blocker from achieving Java 9 compatibility
> - same annotations as used by jackrabbit/oak
> - tooling for migration available
> - jetbrains annotations use apache 2.0 license
> - wide-spread tooling support for jetbrains annotations (which would not be the case if we develop our own annotations)
> 
> drawbacks:
> - the jetbrains annotations include some more (mostly IntelliJ-specific) annotations than only the nullable annotations
> - the jetbrains annotations are no "standard annotations"
> 
> 
> Please vote to approve switching to Jetbrains Annotations:
> 
>  [ ] +1 Switch to Jetbrains Annotations
>  [ ]  0 Don't care
>  [ ] -1 Don't switch to Jetbrains Annotations
> 
> 
> stefan
> 
> 
> [1] https://blog.codefx.org/java/jsr-305-java-9/
> [2] https://issues.apache.org/jira/browse/JCR-4301
> [3] https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
> [4] http://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/
> [5] https://github.com/JetBrains/java-annotations
> [6] https://issues.apache.org/jira/browse/SLING-7798
> 
> 


Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-03 11:50, Carsten Ziegeler wrote:
> We might get a little bit OT here, but...  *your* script does not work,
> my Mac works perfectly fine, they way Apple intends it to work. (It's a
> lame try for a joke...)
> 
> Carsten

Well, if Apple's intent is not to give you a recent awk version...

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Carsten Ziegeler <cz...@apache.org>.
We might get a little bit OT here, but...  *your* script does not work,
my Mac works perfectly fine, they way Apple intends it to work. (It's a
lame try for a joke...)

Carsten


Julian Reschke wrote
> On 2018-08-03 10:33, Carsten Ziegeler wrote:
>> I have a Mac - it works out of the box the way it should be :)
>> ...
> 
> I thought it didn't work?
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-03 10:33, Carsten Ziegeler wrote:
> I have a Mac - it works out of the box the way it should be :)
> ...

I thought it didn't work?

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Carsten Ziegeler <cz...@apache.org>.
I have a Mac - it works out of the box the way it should be :)

But thanks for the hint

Carsten


Julian Reschke wrote
> On 2018-08-03 10:19, Carsten Ziegeler wrote:
>> I ran into a general problem, the function gensub() was not available
>> when running the script.
>>
>> But it's just four find/replace operations, so not a big deal anyway.
>>
>> Regards
>>
>> Carsten
> 
> Make sure that awk is actually *gawk* on your system...
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-03 10:19, Carsten Ziegeler wrote:
> I ran into a general problem, the function gensub() was not available
> when running the script.
> 
> But it's just four find/replace operations, so not a big deal anyway.
> 
> Regards
> 
> Carsten

Make sure that awk is actually *gawk* on your system...


Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Carsten Ziegeler <cz...@apache.org>.
I ran into a general problem, the function gensub() was not available
when running the script.

But it's just four find/replace operations, so not a big deal anyway.

Regards

Carsten


Julian Reschke wrote
> On 2018-08-03 08:01, Carsten Ziegeler wrote:
>> I did a similar exercise for the Apache Felix Http bundles and although
>> the script did not work for me, a simple find/replace for the two
>> annotations did the trick.
>> ...
> 
> If you can provide a few details (git coordinates?), I can have a look.
> 
> Best regards, Julian
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-03 08:01, Carsten Ziegeler wrote:
> I did a similar exercise for the Apache Felix Http bundles and although
> the script did not work for me, a simple find/replace for the two
> annotations did the trick.
> ...

If you can provide a few details (git coordinates?), I can have a look.

Best regards, Julian

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Robert Munteanu <ro...@apache.org>.
On Fri, 2018-08-03 at 08:01 +0200, Carsten Ziegeler wrote:
> I did a similar exercise for the Apache Felix Http bundles and
> although
> the script did not work for me, a simple find/replace for the two
> annotations did the trick.
> 
> I think we're discussing three things here in parallel:
> 
> a) which annotations we should use
> 
> b) should we change existing usage
> 
> c) how to deal with existing releases
> 
> I have the feeling that for a) we all agree that the jetbrains
> annotations are the preferred way. Therefore once the vote is over we
> should go ahead adjust our parent pom, release it.
> 
> For b), I think we should definitely change existing usage in our
> source
> code after we did a) and replace it. Hopefully someone is able to run
> the script (or comes up with a working one).
> 
> 
> Finally we have different options for c). I personally think if we
> have
> done a) and b), then simply doing a release of all modules is the way
> to
> go. We're working on some of the affected modules anywhay, so a
> release
> will happen soon and for the others its not that much of a big deal,
> especially if we can spread the process amongst some of us.

+1

Robert


Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Carsten Ziegeler <cz...@apache.org>.
There is no need to rush - however if there has been no change in a
module since the last release (and I think that applies for many of
them), doing a release is a no brainer

Regards

Carsten


Konrad Windszus wrote
> for c) I would rather argue, there is no need to hurry with the releases if JSR 305 still works with the bundle proposed in https://issues.apache.org/jira/browse/SLING-7135 <https://issues.apache.org/jira/browse/SLING-7135>.
> So we should rather include that bundle in Sling (as it is anyhow needed for Sling Models Java 9+ compatibility) and do the releases one by one without rush.
> Konrad
> 
>> On 3. Aug 2018, at 08:01, Carsten Ziegeler <cz...@apache.org> wrote:
>>
>> I did a similar exercise for the Apache Felix Http bundles and although
>> the script did not work for me, a simple find/replace for the two
>> annotations did the trick.
>>
>> I think we're discussing three things here in parallel:
>>
>> a) which annotations we should use
>>
>> b) should we change existing usage
>>
>> c) how to deal with existing releases
>>
>> I have the feeling that for a) we all agree that the jetbrains
>> annotations are the preferred way. Therefore once the vote is over we
>> should go ahead adjust our parent pom, release it.
>>
>> For b), I think we should definitely change existing usage in our source
>> code after we did a) and replace it. Hopefully someone is able to run
>> the script (or comes up with a working one).
>>
>>
>> Finally we have different options for c). I personally think if we have
>> done a) and b), then simply doing a release of all modules is the way to
>> go. We're working on some of the affected modules anywhay, so a release
>> will happen soon and for the others its not that much of a big deal,
>> especially if we can spread the process amongst some of us.
>>
>> Carsten
>>
>> Stefan Seifert wrote
>>> as recently discussed in SLING-7312 and the mailing list the JSR-305 annotations for null-analysis (javax.annotations) we are currently using break our compatibility with Java 9. the problem is that JSR-305 was never accepted and thus it's hard and troublesome to use them in Java 9 (see [1]). there are several alternatives for nullable annotations with good tool support, but some of them (e.g. findbugs/spotbugs annotations) use a license not fully compatible with the apache license (discussed in [2]).
>>>
>>> the jackrabbit/oak team has decided to switch to jetbrains annotations [3][4][5] and developed some tooling to ease the migration. although coming from the manufacturer of IntelliJ there is wide tool support for them e.g. in FindBugs/SpotBugs, Sonar and can be configured in Eclipse as well.
>>>
>>> i've created a ticket [6] to describe the steps we need to go and which sling modules are affected. this ticket is about to get a consensus that the jetbrains annotations are the way we want to go.
>>>
>>> benefits:
>>> - removes a blocker from achieving Java 9 compatibility
>>> - same annotations as used by jackrabbit/oak
>>> - tooling for migration available
>>> - jetbrains annotations use apache 2.0 license
>>> - wide-spread tooling support for jetbrains annotations (which would not be the case if we develop our own annotations)
>>>
>>> drawbacks:
>>> - the jetbrains annotations include some more (mostly IntelliJ-specific) annotations than only the nullable annotations
>>> - the jetbrains annotations are no "standard annotations"
>>>
>>>
>>> Please vote to approve switching to Jetbrains Annotations:
>>>
>>>  [ ] +1 Switch to Jetbrains Annotations
>>>  [ ]  0 Don't care
>>>  [ ] -1 Don't switch to Jetbrains Annotations
>>>
>>>
>>> stefan
>>>
>>>
>>> [1] https://blog.codefx.org/java/jsr-305-java-9/
>>> [2] https://issues.apache.org/jira/browse/JCR-4301
>>> [3] https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
>>> [4] http://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/
>>> [5] https://github.com/JetBrains/java-annotations
>>> [6] https://issues.apache.org/jira/browse/SLING-7798
>>>
>>>
>> -- 
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> cziegeler@apache.org
> 
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Konrad Windszus <ko...@gmx.de>.
for c) I would rather argue, there is no need to hurry with the releases if JSR 305 still works with the bundle proposed in https://issues.apache.org/jira/browse/SLING-7135 <https://issues.apache.org/jira/browse/SLING-7135>.
So we should rather include that bundle in Sling (as it is anyhow needed for Sling Models Java 9+ compatibility) and do the releases one by one without rush.
Konrad

> On 3. Aug 2018, at 08:01, Carsten Ziegeler <cz...@apache.org> wrote:
> 
> I did a similar exercise for the Apache Felix Http bundles and although
> the script did not work for me, a simple find/replace for the two
> annotations did the trick.
> 
> I think we're discussing three things here in parallel:
> 
> a) which annotations we should use
> 
> b) should we change existing usage
> 
> c) how to deal with existing releases
> 
> I have the feeling that for a) we all agree that the jetbrains
> annotations are the preferred way. Therefore once the vote is over we
> should go ahead adjust our parent pom, release it.
> 
> For b), I think we should definitely change existing usage in our source
> code after we did a) and replace it. Hopefully someone is able to run
> the script (or comes up with a working one).
> 
> 
> Finally we have different options for c). I personally think if we have
> done a) and b), then simply doing a release of all modules is the way to
> go. We're working on some of the affected modules anywhay, so a release
> will happen soon and for the others its not that much of a big deal,
> especially if we can spread the process amongst some of us.
> 
> Carsten
> 
> Stefan Seifert wrote
>> as recently discussed in SLING-7312 and the mailing list the JSR-305 annotations for null-analysis (javax.annotations) we are currently using break our compatibility with Java 9. the problem is that JSR-305 was never accepted and thus it's hard and troublesome to use them in Java 9 (see [1]). there are several alternatives for nullable annotations with good tool support, but some of them (e.g. findbugs/spotbugs annotations) use a license not fully compatible with the apache license (discussed in [2]).
>> 
>> the jackrabbit/oak team has decided to switch to jetbrains annotations [3][4][5] and developed some tooling to ease the migration. although coming from the manufacturer of IntelliJ there is wide tool support for them e.g. in FindBugs/SpotBugs, Sonar and can be configured in Eclipse as well.
>> 
>> i've created a ticket [6] to describe the steps we need to go and which sling modules are affected. this ticket is about to get a consensus that the jetbrains annotations are the way we want to go.
>> 
>> benefits:
>> - removes a blocker from achieving Java 9 compatibility
>> - same annotations as used by jackrabbit/oak
>> - tooling for migration available
>> - jetbrains annotations use apache 2.0 license
>> - wide-spread tooling support for jetbrains annotations (which would not be the case if we develop our own annotations)
>> 
>> drawbacks:
>> - the jetbrains annotations include some more (mostly IntelliJ-specific) annotations than only the nullable annotations
>> - the jetbrains annotations are no "standard annotations"
>> 
>> 
>> Please vote to approve switching to Jetbrains Annotations:
>> 
>>  [ ] +1 Switch to Jetbrains Annotations
>>  [ ]  0 Don't care
>>  [ ] -1 Don't switch to Jetbrains Annotations
>> 
>> 
>> stefan
>> 
>> 
>> [1] https://blog.codefx.org/java/jsr-305-java-9/
>> [2] https://issues.apache.org/jira/browse/JCR-4301
>> [3] https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
>> [4] http://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/
>> [5] https://github.com/JetBrains/java-annotations
>> [6] https://issues.apache.org/jira/browse/SLING-7798
>> 
>> 
> -- 
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org


Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Carsten Ziegeler <cz...@apache.org>.
I did a similar exercise for the Apache Felix Http bundles and although
the script did not work for me, a simple find/replace for the two
annotations did the trick.

I think we're discussing three things here in parallel:

a) which annotations we should use

b) should we change existing usage

c) how to deal with existing releases

I have the feeling that for a) we all agree that the jetbrains
annotations are the preferred way. Therefore once the vote is over we
should go ahead adjust our parent pom, release it.

For b), I think we should definitely change existing usage in our source
code after we did a) and replace it. Hopefully someone is able to run
the script (or comes up with a working one).


Finally we have different options for c). I personally think if we have
done a) and b), then simply doing a release of all modules is the way to
go. We're working on some of the affected modules anywhay, so a release
will happen soon and for the others its not that much of a big deal,
especially if we can spread the process amongst some of us.

Carsten

Stefan Seifert wrote
> as recently discussed in SLING-7312 and the mailing list the JSR-305 annotations for null-analysis (javax.annotations) we are currently using break our compatibility with Java 9. the problem is that JSR-305 was never accepted and thus it's hard and troublesome to use them in Java 9 (see [1]). there are several alternatives for nullable annotations with good tool support, but some of them (e.g. findbugs/spotbugs annotations) use a license not fully compatible with the apache license (discussed in [2]).
> 
> the jackrabbit/oak team has decided to switch to jetbrains annotations [3][4][5] and developed some tooling to ease the migration. although coming from the manufacturer of IntelliJ there is wide tool support for them e.g. in FindBugs/SpotBugs, Sonar and can be configured in Eclipse as well.
> 
> i've created a ticket [6] to describe the steps we need to go and which sling modules are affected. this ticket is about to get a consensus that the jetbrains annotations are the way we want to go.
> 
> benefits:
> - removes a blocker from achieving Java 9 compatibility
> - same annotations as used by jackrabbit/oak
> - tooling for migration available
> - jetbrains annotations use apache 2.0 license
> - wide-spread tooling support for jetbrains annotations (which would not be the case if we develop our own annotations)
> 
> drawbacks:
> - the jetbrains annotations include some more (mostly IntelliJ-specific) annotations than only the nullable annotations
> - the jetbrains annotations are no "standard annotations"
> 
> 
> Please vote to approve switching to Jetbrains Annotations:
> 
>   [ ] +1 Switch to Jetbrains Annotations
>   [ ]  0 Don't care
>   [ ] -1 Don't switch to Jetbrains Annotations
> 
> 
> stefan
> 
> 
> [1] https://blog.codefx.org/java/jsr-305-java-9/
> [2] https://issues.apache.org/jira/browse/JCR-4301
> [3] https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
> [4] http://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/
> [5] https://github.com/JetBrains/java-annotations
> [6] https://issues.apache.org/jira/browse/SLING-7798
> 
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-02 14:00, Konrad Windszus wrote:
> The JSR 305 classes are not actually necessary at run time!
> ...

Indeed.

I tried this in Oak 1.8, and the OSGi ITs indeed pass with Java 11 when 
javax.annotation-api is present.

Best regards, Julian

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Konrad Windszus <ko...@gmx.de>.
The JSR 305 classes are not actually necessary at run time!

Von meinem iPhone gesendet

> Am 02.08.2018 um 13:23 schrieb Julian Reschke <ju...@gmx.de>:
> 
>> On 2018-08-02 12:32, Konrad Windszus wrote:
>> Then I would be in favour of just trying to deploy http://search.maven.org/#artifactdetails%7Cjavax.annotation%7Cjavax.annotation-api%7C1.3%7Cjar <http://search.maven.org/#artifactdetails|javax.annotation|javax.annotation-api|1.3|jar> with Sling and see how that behaves with Java 8, 9 and 11. That will gives us some time for the migration of the JSR-305 annotations (as that bundle is exporting the correct package to also workaround the missing import for JSR 305).
>> ...
> 
> How does this help? After all, that AR file does not contain the Nullability annotations.
> 
> Best regards, Julian


Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-02 13:23, Julian Reschke wrote:
> On 2018-08-02 12:32, Konrad Windszus wrote:
>> Then I would be in favour of just trying to deploy 
>> http://search.maven.org/#artifactdetails%7Cjavax.annotation%7Cjavax.annotation-api%7C1.3%7Cjar 
>> <http://search.maven.org/#artifactdetails|javax.annotation|javax.annotation-api|1.3|jar> 
>> with Sling and see how that behaves with Java 8, 9 and 11. That will 
>> gives us some time for the migration of the JSR-305 annotations (as 
>> that bundle is exporting the correct package to also workaround the 
>> missing import for JSR 305).
>> ...
> 
> How does this help? After all, that AR file does not contain the 
> Nullability annotations.

s/AR/JAR/


Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-02 12:32, Konrad Windszus wrote:
> Then I would be in favour of just trying to deploy http://search.maven.org/#artifactdetails%7Cjavax.annotation%7Cjavax.annotation-api%7C1.3%7Cjar <http://search.maven.org/#artifactdetails|javax.annotation|javax.annotation-api|1.3|jar> with Sling and see how that behaves with Java 8, 9 and 11. That will gives us some time for the migration of the JSR-305 annotations (as that bundle is exporting the correct package to also workaround the missing import for JSR 305).
> ...

How does this help? After all, that AR file does not contain the 
Nullability annotations.

Best regards, Julian

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Konrad Windszus <ko...@gmx.de>.
Then I would be in favour of just trying to deploy http://search.maven.org/#artifactdetails%7Cjavax.annotation%7Cjavax.annotation-api%7C1.3%7Cjar <http://search.maven.org/#artifactdetails|javax.annotation|javax.annotation-api|1.3|jar> with Sling and see how that behaves with Java 8, 9 and 11. That will gives us some time for the migration of the JSR-305 annotations (as that bundle is exporting the correct package to also workaround the missing import for JSR 305).

> On 2. Aug 2018, at 12:28, Karl Pauls <ka...@gmail.com> wrote:
> 
> On Thursday, August 2, 2018, Karl Pauls <karlpauls@gmail.com <ma...@gmail.com>> wrote:
> 
>> 
>> 
>> On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:
>> 
>>> At Sling we use other classes from javax.annotation as well (compare with
>>> https://issues.apache.org/jira/browse/SLING-7135 <
>>> https://issues.apache.org/jira/browse/SLING-7135>). So most probably we
>>> have to rely on the official Oracle replacement and the question for me is
>>> how that behaves in the context of Java 8 which exports javax.annotation
>>> from the system bundle.
>> 
>> 
>>> That would work like normal, assuming no versioning or uses constraints
>> to the contrary it would just resolve from the system bundle if it is there
>> in the jdk or from the bundle if not.
>> 
> 
> Luckily, there are no split packages in osgi :-)
> 
> 
> 
>> regards,
>> 
>> Karl
>> 
>>> 
>>>> On 2. Aug 2018, at 12:11, Karl Pauls <ka...@gmail.com> wrote:
>>>> 
>>>> Would would be the problem with that? I wasn’t talking about a jpms
>>> module
>>>> - IMO, we can just create a bundle that contains and exports
>>>> javax.annotation and be done with it think.
>>>> 
>>>> regards,
>>>> 
>>>> Karl
>>>> 
>>>> On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:
>>>> 
>>>>> 
>>>>>> However, I wanted to point out option b). IIRC, there is nothing
>>>>>> preventing us to just provide the package ourselves and then it would
>>> be
>>>>>> problem solved, no?
>>>>> 
>>>>> Unfortunately not, due to potential split-packages:
>>>>> https://blog.codefx.org/java/jsr-305-java-9/ <
>>>>> https://blog.codefx.org/java/jsr-305-java-9/>
>>>>>> 
>>>>>> 
>>>>>> regards,
>>>>>> 
>>>>>> Karl
>>>>>> 
>>>>>> On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de>
>>>>> wrote:
>>>>>> 
>>>>>>> On 2018-08-02 10:55, Stefan Seifert wrote:
>>>>>>> 
>>>>>>>> ...
>>>>>>>> benefits:
>>>>>>>> - removes a blocker from achieving Java 9 compatibility
>>>>>>>> 
>>>>>>> 
>>>>>>> AFAICT, it's only Java 11 where there's an actual compat problem (but
>>>>> yes,
>>>>>>> that'll be the version we need to support soonish).
>>>>>>> 
>>>>>>> ... > drawbacks:
>>>>>>>> - the jetbrains annotations include some more (mostly
>>>>> IntelliJ-specific)
>>>>>>>> annotations than only the nullable annotations
>>>>>>>> - the jetbrains annotations are no "standard annotations"
>>>>>>>> ...
>>>>>>>> 
>>>>>>> 
>>>>>>> Well, if there were "standard annotations" for this, we'd use them
>>> :-)
>>>>>>> 
>>>>>>>> ...
>>>>>>> 
>>>>>>> Best regards, Julian
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Karl Pauls
>>>>>> karlpauls@gmail.com
>>>>> 
>>>>> 
>>>> 
>>>> --
>>>> Karl Pauls
>>>> karlpauls@gmail.com
>>> 
>>> 
>> 
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>> 
>> 
> 
> -- 
> Karl Pauls
> karlpauls@gmail.com <ma...@gmail.com>

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Karl Pauls <ka...@gmail.com>.
On Thursday, August 2, 2018, Karl Pauls <ka...@gmail.com> wrote:

>
>
> On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:
>
>> At Sling we use other classes from javax.annotation as well (compare with
>> https://issues.apache.org/jira/browse/SLING-7135 <
>> https://issues.apache.org/jira/browse/SLING-7135>). So most probably we
>> have to rely on the official Oracle replacement and the question for me is
>> how that behaves in the context of Java 8 which exports javax.annotation
>> from the system bundle.
>
>
>> That would work like normal, assuming no versioning or uses constraints
> to the contrary it would just resolve from the system bundle if it is there
> in the jdk or from the bundle if not.
>

Luckily, there are no split packages in osgi :-)



> regards,
>
> Karl
>
>>
>> > On 2. Aug 2018, at 12:11, Karl Pauls <ka...@gmail.com> wrote:
>> >
>> > Would would be the problem with that? I wasn’t talking about a jpms
>> module
>> > - IMO, we can just create a bundle that contains and exports
>> > javax.annotation and be done with it think.
>> >
>> > regards,
>> >
>> > Karl
>> >
>> > On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:
>> >
>> >>
>> >>> However, I wanted to point out option b). IIRC, there is nothing
>> >>> preventing us to just provide the package ourselves and then it would
>> be
>> >>> problem solved, no?
>> >>
>> >> Unfortunately not, due to potential split-packages:
>> >> https://blog.codefx.org/java/jsr-305-java-9/ <
>> >> https://blog.codefx.org/java/jsr-305-java-9/>
>> >>>
>> >>>
>> >>> regards,
>> >>>
>> >>> Karl
>> >>>
>> >>> On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de>
>> >> wrote:
>> >>>
>> >>>> On 2018-08-02 10:55, Stefan Seifert wrote:
>> >>>>
>> >>>>> ...
>> >>>>> benefits:
>> >>>>> - removes a blocker from achieving Java 9 compatibility
>> >>>>>
>> >>>>
>> >>>> AFAICT, it's only Java 11 where there's an actual compat problem (but
>> >> yes,
>> >>>> that'll be the version we need to support soonish).
>> >>>>
>> >>>> ... > drawbacks:
>> >>>>> - the jetbrains annotations include some more (mostly
>> >> IntelliJ-specific)
>> >>>>> annotations than only the nullable annotations
>> >>>>> - the jetbrains annotations are no "standard annotations"
>> >>>>> ...
>> >>>>>
>> >>>>
>> >>>> Well, if there were "standard annotations" for this, we'd use them
>> :-)
>> >>>>
>> >>>>> ...
>> >>>>
>> >>>> Best regards, Julian
>> >>>>
>> >>>
>> >>>
>> >>> --
>> >>> Karl Pauls
>> >>> karlpauls@gmail.com
>> >>
>> >>
>> >
>> > --
>> > Karl Pauls
>> > karlpauls@gmail.com
>>
>>
>
> --
> Karl Pauls
> karlpauls@gmail.com
>
>

-- 
Karl Pauls
karlpauls@gmail.com

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Karl Pauls <ka...@gmail.com>.
On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:

> At Sling we use other classes from javax.annotation as well (compare with
> https://issues.apache.org/jira/browse/SLING-7135 <
> https://issues.apache.org/jira/browse/SLING-7135>). So most probably we
> have to rely on the official Oracle replacement and the question for me is
> how that behaves in the context of Java 8 which exports javax.annotation
> from the system bundle.


> That would work like normal, assuming no versioning or uses constraints to
the contrary it would just resolve from the system bundle if it is there in
the jdk or from the bundle if not.

regards,

Karl

>
> > On 2. Aug 2018, at 12:11, Karl Pauls <ka...@gmail.com> wrote:
> >
> > Would would be the problem with that? I wasn’t talking about a jpms
> module
> > - IMO, we can just create a bundle that contains and exports
> > javax.annotation and be done with it think.
> >
> > regards,
> >
> > Karl
> >
> > On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:
> >
> >>
> >>> However, I wanted to point out option b). IIRC, there is nothing
> >>> preventing us to just provide the package ourselves and then it would
> be
> >>> problem solved, no?
> >>
> >> Unfortunately not, due to potential split-packages:
> >> https://blog.codefx.org/java/jsr-305-java-9/ <
> >> https://blog.codefx.org/java/jsr-305-java-9/>
> >>>
> >>>
> >>> regards,
> >>>
> >>> Karl
> >>>
> >>> On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de>
> >> wrote:
> >>>
> >>>> On 2018-08-02 10:55, Stefan Seifert wrote:
> >>>>
> >>>>> ...
> >>>>> benefits:
> >>>>> - removes a blocker from achieving Java 9 compatibility
> >>>>>
> >>>>
> >>>> AFAICT, it's only Java 11 where there's an actual compat problem (but
> >> yes,
> >>>> that'll be the version we need to support soonish).
> >>>>
> >>>> ... > drawbacks:
> >>>>> - the jetbrains annotations include some more (mostly
> >> IntelliJ-specific)
> >>>>> annotations than only the nullable annotations
> >>>>> - the jetbrains annotations are no "standard annotations"
> >>>>> ...
> >>>>>
> >>>>
> >>>> Well, if there were "standard annotations" for this, we'd use them :-)
> >>>>
> >>>>> ...
> >>>>
> >>>> Best regards, Julian
> >>>>
> >>>
> >>>
> >>> --
> >>> Karl Pauls
> >>> karlpauls@gmail.com
> >>
> >>
> >
> > --
> > Karl Pauls
> > karlpauls@gmail.com
>
>

-- 
Karl Pauls
karlpauls@gmail.com

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Konrad Windszus <ko...@gmx.de>.
At Sling we use other classes from javax.annotation as well (compare with https://issues.apache.org/jira/browse/SLING-7135 <https://issues.apache.org/jira/browse/SLING-7135>). So most probably we have to rely on the official Oracle replacement and the question for me is how that behaves in the context of Java 8 which exports javax.annotation from the system bundle.

> On 2. Aug 2018, at 12:11, Karl Pauls <ka...@gmail.com> wrote:
> 
> Would would be the problem with that? I wasn’t talking about a jpms module
> - IMO, we can just create a bundle that contains and exports
> javax.annotation and be done with it think.
> 
> regards,
> 
> Karl
> 
> On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:
> 
>> 
>>> However, I wanted to point out option b). IIRC, there is nothing
>>> preventing us to just provide the package ourselves and then it would be
>>> problem solved, no?
>> 
>> Unfortunately not, due to potential split-packages:
>> https://blog.codefx.org/java/jsr-305-java-9/ <
>> https://blog.codefx.org/java/jsr-305-java-9/>
>>> 
>>> 
>>> regards,
>>> 
>>> Karl
>>> 
>>> On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de>
>> wrote:
>>> 
>>>> On 2018-08-02 10:55, Stefan Seifert wrote:
>>>> 
>>>>> ...
>>>>> benefits:
>>>>> - removes a blocker from achieving Java 9 compatibility
>>>>> 
>>>> 
>>>> AFAICT, it's only Java 11 where there's an actual compat problem (but
>> yes,
>>>> that'll be the version we need to support soonish).
>>>> 
>>>> ... > drawbacks:
>>>>> - the jetbrains annotations include some more (mostly
>> IntelliJ-specific)
>>>>> annotations than only the nullable annotations
>>>>> - the jetbrains annotations are no "standard annotations"
>>>>> ...
>>>>> 
>>>> 
>>>> Well, if there were "standard annotations" for this, we'd use them :-)
>>>> 
>>>>> ...
>>>> 
>>>> Best regards, Julian
>>>> 
>>> 
>>> 
>>> --
>>> Karl Pauls
>>> karlpauls@gmail.com
>> 
>> 
> 
> -- 
> Karl Pauls
> karlpauls@gmail.com


Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Karl Pauls <ka...@gmail.com>.
Yeah, I don’t disagree - just wanted to point out the options.

Granted, i’m not sure it is worth the effort at this time and i think there
might be some value in having a bundle that provides the export for other
cases where the bundles can’t be changed but I don’t feel strongly about it.

regards,

Karl

On Thursday, August 2, 2018, Carsten Ziegeler <cz...@apache.org> wrote:

> While that's true I think we are putting an unnecessary requirement on
> the runtime. Just because we use some annotations for build time checks
> out of a sudden at runtime you need an additional bundle.
>
> We have to run that script and rerelease everything, that's some work,
> but if we split it we can get over it quickly
>
> Regards
>
> Carsten
>
>
> Karl Pauls wrote
> > Would would be the problem with that? I wasn’t talking about a jpms
> module
> > - IMO, we can just create a bundle that contains and exports
> > javax.annotation and be done with it think.
> >
> > regards,
> >
> > Karl
> >
> > On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:
> >
> >>
> >>> However, I wanted to point out option b). IIRC, there is nothing
> >>> preventing us to just provide the package ourselves and then it would
> be
> >>> problem solved, no?
> >>
> >> Unfortunately not, due to potential split-packages:
> >> https://blog.codefx.org/java/jsr-305-java-9/ <
> >> https://blog.codefx.org/java/jsr-305-java-9/>
> >>>
> >>>
> >>> regards,
> >>>
> >>> Karl
> >>>
> >>> On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de>
> >> wrote:
> >>>
> >>>> On 2018-08-02 10:55, Stefan Seifert wrote:
> >>>>
> >>>>> ...
> >>>>> benefits:
> >>>>> - removes a blocker from achieving Java 9 compatibility
> >>>>>
> >>>>
> >>>> AFAICT, it's only Java 11 where there's an actual compat problem (but
> >> yes,
> >>>> that'll be the version we need to support soonish).
> >>>>
> >>>> ... > drawbacks:
> >>>>> - the jetbrains annotations include some more (mostly
> >> IntelliJ-specific)
> >>>>> annotations than only the nullable annotations
> >>>>> - the jetbrains annotations are no "standard annotations"
> >>>>> ...
> >>>>>
> >>>>
> >>>> Well, if there were "standard annotations" for this, we'd use them :-)
> >>>>
> >>>>> ...
> >>>>
> >>>> Best regards, Julian
> >>>>
> >>>
> >>>
> >>> --
> >>> Karl Pauls
> >>> karlpauls@gmail.com
> >>
> >>
> >
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
>


-- 
Karl Pauls
karlpauls@gmail.com

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Carsten Ziegeler <cz...@apache.org>.
While that's true I think we are putting an unnecessary requirement on
the runtime. Just because we use some annotations for build time checks
out of a sudden at runtime you need an additional bundle.

We have to run that script and rerelease everything, that's some work,
but if we split it we can get over it quickly

Regards

Carsten


Karl Pauls wrote
> Would would be the problem with that? I wasn’t talking about a jpms module
> - IMO, we can just create a bundle that contains and exports
> javax.annotation and be done with it think.
> 
> regards,
> 
> Karl
> 
> On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:
> 
>>
>>> However, I wanted to point out option b). IIRC, there is nothing
>>> preventing us to just provide the package ourselves and then it would be
>>> problem solved, no?
>>
>> Unfortunately not, due to potential split-packages:
>> https://blog.codefx.org/java/jsr-305-java-9/ <
>> https://blog.codefx.org/java/jsr-305-java-9/>
>>>
>>>
>>> regards,
>>>
>>> Karl
>>>
>>> On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de>
>> wrote:
>>>
>>>> On 2018-08-02 10:55, Stefan Seifert wrote:
>>>>
>>>>> ...
>>>>> benefits:
>>>>> - removes a blocker from achieving Java 9 compatibility
>>>>>
>>>>
>>>> AFAICT, it's only Java 11 where there's an actual compat problem (but
>> yes,
>>>> that'll be the version we need to support soonish).
>>>>
>>>> ... > drawbacks:
>>>>> - the jetbrains annotations include some more (mostly
>> IntelliJ-specific)
>>>>> annotations than only the nullable annotations
>>>>> - the jetbrains annotations are no "standard annotations"
>>>>> ...
>>>>>
>>>>
>>>> Well, if there were "standard annotations" for this, we'd use them :-)
>>>>
>>>>> ...
>>>>
>>>> Best regards, Julian
>>>>
>>>
>>>
>>> --
>>> Karl Pauls
>>> karlpauls@gmail.com
>>
>>
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Karl Pauls <ka...@gmail.com>.
Would would be the problem with that? I wasn’t talking about a jpms module
- IMO, we can just create a bundle that contains and exports
javax.annotation and be done with it think.

regards,

Karl

On Thursday, August 2, 2018, Konrad Windszus <ko...@gmx.de> wrote:

>
> > However, I wanted to point out option b). IIRC, there is nothing
> > preventing us to just provide the package ourselves and then it would be
> > problem solved, no?
>
> Unfortunately not, due to potential split-packages:
> https://blog.codefx.org/java/jsr-305-java-9/ <
> https://blog.codefx.org/java/jsr-305-java-9/>
> >
> >
> > regards,
> >
> > Karl
> >
> > On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de>
> wrote:
> >
> >> On 2018-08-02 10:55, Stefan Seifert wrote:
> >>
> >>> ...
> >>> benefits:
> >>> - removes a blocker from achieving Java 9 compatibility
> >>>
> >>
> >> AFAICT, it's only Java 11 where there's an actual compat problem (but
> yes,
> >> that'll be the version we need to support soonish).
> >>
> >> ... > drawbacks:
> >>> - the jetbrains annotations include some more (mostly
> IntelliJ-specific)
> >>> annotations than only the nullable annotations
> >>> - the jetbrains annotations are no "standard annotations"
> >>> ...
> >>>
> >>
> >> Well, if there were "standard annotations" for this, we'd use them :-)
> >>
> >>> ...
> >>
> >> Best regards, Julian
> >>
> >
> >
> > --
> > Karl Pauls
> > karlpauls@gmail.com
>
>

-- 
Karl Pauls
karlpauls@gmail.com

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Konrad Windszus <ko...@gmx.de>.
> However, I wanted to point out option b). IIRC, there is nothing
> preventing us to just provide the package ourselves and then it would be
> problem solved, no?

Unfortunately not, due to potential split-packages: https://blog.codefx.org/java/jsr-305-java-9/ <https://blog.codefx.org/java/jsr-305-java-9/>
> 
> 
> regards,
> 
> Karl
> 
> On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de> wrote:
> 
>> On 2018-08-02 10:55, Stefan Seifert wrote:
>> 
>>> ...
>>> benefits:
>>> - removes a blocker from achieving Java 9 compatibility
>>> 
>> 
>> AFAICT, it's only Java 11 where there's an actual compat problem (but yes,
>> that'll be the version we need to support soonish).
>> 
>> ... > drawbacks:
>>> - the jetbrains annotations include some more (mostly IntelliJ-specific)
>>> annotations than only the nullable annotations
>>> - the jetbrains annotations are no "standard annotations"
>>> ...
>>> 
>> 
>> Well, if there were "standard annotations" for this, we'd use them :-)
>> 
>>> ...
>> 
>> Best regards, Julian
>> 
> 
> 
> -- 
> Karl Pauls
> karlpauls@gmail.com


Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-02 12:03, Karl Pauls wrote:
> The alternatives would be to a) make the import optional or to b) provide a
> bundle that exports the javax.annotation package.
> ...

re a) - we could also completely suppress the import, right?

Best regards, Julian

[VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Karl Pauls <ka...@gmail.com>.
The alternatives would be to a) make the import optional or to b) provide a
bundle that exports the javax.annotation package.

Granted a) would need  a release of all bundles just like switching - so in
that case I agree we are better of to just switch to the jetbrains
annotations.

 However, I wanted to point out option b). IIRC, there is nothing
preventing us to just provide the package ourselves and then it would be
problem solved, no?


regards,

Karl

On Thursday, August 2, 2018, Julian Reschke <ju...@gmx.de> wrote:

> On 2018-08-02 10:55, Stefan Seifert wrote:
>
>> ...
>> benefits:
>> - removes a blocker from achieving Java 9 compatibility
>>
>
> AFAICT, it's only Java 11 where there's an actual compat problem (but yes,
> that'll be the version we need to support soonish).
>
> ... > drawbacks:
>> - the jetbrains annotations include some more (mostly IntelliJ-specific)
>> annotations than only the nullable annotations
>> - the jetbrains annotations are no "standard annotations"
>> ...
>>
>
> Well, if there were "standard annotations" for this, we'd use them :-)
>
> > ...
>
> Best regards, Julian
>


-- 
Karl Pauls
karlpauls@gmail.com

Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Julian Reschke <ju...@gmx.de>.
On 2018-08-02 10:55, Stefan Seifert wrote:
> ...
> benefits:
> - removes a blocker from achieving Java 9 compatibility

AFAICT, it's only Java 11 where there's an actual compat problem (but 
yes, that'll be the version we need to support soonish).

> ... > drawbacks:
> - the jetbrains annotations include some more (mostly IntelliJ-specific) annotations than only the nullable annotations
> - the jetbrains annotations are no "standard annotations"
> ...

Well, if there were "standard annotations" for this, we'd use them :-)

 > ...

Best regards, Julian

RE: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Stefan Seifert <ss...@pro-vision.de>.
+1


>-----Original Message-----
>From: Stefan Seifert [mailto:sseifert@pro-vision.de]
>Sent: Thursday, August 2, 2018 10:56 AM
>To: dev@sling.apache.org
>Subject: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations
>for all Sling Models
>
>as recently discussed in SLING-7312 and the mailing list the JSR-305
>annotations for null-analysis (javax.annotations) we are currently using
>break our compatibility with Java 9. the problem is that JSR-305 was never
>accepted and thus it's hard and troublesome to use them in Java 9 (see
>[1]). there are several alternatives for nullable annotations with good
>tool support, but some of them (e.g. findbugs/spotbugs annotations) use a
>license not fully compatible with the apache license (discussed in [2]).
>
>the jackrabbit/oak team has decided to switch to jetbrains annotations
>[3][4][5] and developed some tooling to ease the migration. although coming
>from the manufacturer of IntelliJ there is wide tool support for them e.g.
>in FindBugs/SpotBugs, Sonar and can be configured in Eclipse as well.
>
>i've created a ticket [6] to describe the steps we need to go and which
>sling modules are affected. this ticket is about to get a consensus that
>the jetbrains annotations are the way we want to go.
>
>benefits:
>- removes a blocker from achieving Java 9 compatibility
>- same annotations as used by jackrabbit/oak
>- tooling for migration available
>- jetbrains annotations use apache 2.0 license
>- wide-spread tooling support for jetbrains annotations (which would not be
>the case if we develop our own annotations)
>
>drawbacks:
>- the jetbrains annotations include some more (mostly IntelliJ-specific)
>annotations than only the nullable annotations
>- the jetbrains annotations are no "standard annotations"
>
>
>Please vote to approve switching to Jetbrains Annotations:
>
>  [ ] +1 Switch to Jetbrains Annotations
>  [ ]  0 Don't care
>  [ ] -1 Don't switch to Jetbrains Annotations
>
>
>stefan
>
>
>[1] https://blog.codefx.org/java/jsr-305-java-9/
>[2] https://issues.apache.org/jira/browse/JCR-4301
>[3] https://www.jetbrains.com/help/idea/nullable-and-notnull-
>annotations.html
>[4] http://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/
>[5] https://github.com/JetBrains/java-annotations
>[6] https://issues.apache.org/jira/browse/SLING-7798
>
>



Re: [VOTE] Switch from JSR-305 annotations to Jetbrains Annotations for all Sling Models

Posted by Carsten Ziegeler <cz...@apache.org>.
+1

And the benefit is really that these annotations have no runtime dependency

Regards

Carsten


Stefan Seifert wrote
> as recently discussed in SLING-7312 and the mailing list the JSR-305 annotations for null-analysis (javax.annotations) we are currently using break our compatibility with Java 9. the problem is that JSR-305 was never accepted and thus it's hard and troublesome to use them in Java 9 (see [1]). there are several alternatives for nullable annotations with good tool support, but some of them (e.g. findbugs/spotbugs annotations) use a license not fully compatible with the apache license (discussed in [2]).
> 
> the jackrabbit/oak team has decided to switch to jetbrains annotations [3][4][5] and developed some tooling to ease the migration. although coming from the manufacturer of IntelliJ there is wide tool support for them e.g. in FindBugs/SpotBugs, Sonar and can be configured in Eclipse as well.
> 
> i've created a ticket [6] to describe the steps we need to go and which sling modules are affected. this ticket is about to get a consensus that the jetbrains annotations are the way we want to go.
> 
> benefits:
> - removes a blocker from achieving Java 9 compatibility
> - same annotations as used by jackrabbit/oak
> - tooling for migration available
> - jetbrains annotations use apache 2.0 license
> - wide-spread tooling support for jetbrains annotations (which would not be the case if we develop our own annotations)
> 
> drawbacks:
> - the jetbrains annotations include some more (mostly IntelliJ-specific) annotations than only the nullable annotations
> - the jetbrains annotations are no "standard annotations"
> 
> 
> Please vote to approve switching to Jetbrains Annotations:
> 
>   [ ] +1 Switch to Jetbrains Annotations
>   [ ]  0 Don't care
>   [ ] -1 Don't switch to Jetbrains Annotations
> 
> 
> stefan
> 
> 
> [1] https://blog.codefx.org/java/jsr-305-java-9/
> [2] https://issues.apache.org/jira/browse/JCR-4301
> [3] https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
> [4] http://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/
> [5] https://github.com/JetBrains/java-annotations
> [6] https://issues.apache.org/jira/browse/SLING-7798
> 
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org