[
https://issues.apache.org/jira/browse/SLING-4377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konrad Windszus updated SLING-4377:
-----------------------------------
Description:
Since consumers of the Sling API always have to keep in mind whether a
null-check is necessary it would be good to add JSR 305 annotations to the API.
See also http://www.mail-archive.com/[email protected]/msg42199.html.
At least Eclipse as well as Findbugs are supporting those and Oak Solr is using
those already (https://issues.apache.org/jira/browse/OAK-2303).
Only the following 3 annotations should be used:
# {{@Nonnull}}
# {{@CheckForNull}}
# {{@ParametersAreNonNullByDefault}}
Those are the only ones being supported by both Eclipse and Findbugs.
Nullable is basically ignored by Findbugs
(http://findbugs.sourceforge.net/manual/annotations.html) and should therefore
not be used. Eclipse can be configured so it can deal with CheckForNull as
well. Also Solr is only using {{@Nonnull}} and {{@CheckForNull}}.
was:
Since consumers of the Sling API always have to keep in mind whether a
null-check is necessary it would be good to add JSR 305 annotations to the API.
See also http://www.mail-archive.com/[email protected]/msg42199.html.
At least Eclipse as well as Findbugs are supporting those and Oak Solr is using
those already (https://issues.apache.org/jira/browse/OAK-2303).
Only the following 3 annotations should be used:
# {{@Nonnull}}
# {{@Nullable}}
# {{@ParametersAreNonNullByDefault}}
Those are the only ones being supported by both Eclipse and Findbugs.
> Add JSR305 annotations to Sling API
> -----------------------------------
>
> Key: SLING-4377
> URL: https://issues.apache.org/jira/browse/SLING-4377
> Project: Sling
> Issue Type: Improvement
> Components: API
> Reporter: Konrad Windszus
> Assignee: Konrad Windszus
>
> Since consumers of the Sling API always have to keep in mind whether a
> null-check is necessary it would be good to add JSR 305 annotations to the
> API.
> See also http://www.mail-archive.com/[email protected]/msg42199.html.
> At least Eclipse as well as Findbugs are supporting those and Oak Solr is
> using those already (https://issues.apache.org/jira/browse/OAK-2303).
> Only the following 3 annotations should be used:
> # {{@Nonnull}}
> # {{@CheckForNull}}
> # {{@ParametersAreNonNullByDefault}}
> Those are the only ones being supported by both Eclipse and Findbugs.
> Nullable is basically ignored by Findbugs
> (http://findbugs.sourceforge.net/manual/annotations.html) and should
> therefore not be used. Eclipse can be configured so it can deal with
> CheckForNull as well. Also Solr is only using {{@Nonnull}} and
> {{@CheckForNull}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)