[ https://issues.apache.org/jira/browse/SLING-4377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14324032#comment-14324032 ]
ASF GitHub Bot commented on SLING-4377: --------------------------------------- GitHub user kwin opened a pull request: https://github.com/apache/sling/pull/64 SLING-4377 add null check annotations (JSR 305) You can merge this pull request into a Git repository by running: $ git pull https://github.com/kwin/sling SLING-4377-cleaned-up Alternatively you can review and apply these changes as the patch at: https://github.com/apache/sling/pull/64.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #64 ---- commit f2bcadcf62278db9eded0c00520e601889c1b8a7 Author: Konrad Windszus <konrad.winds...@netcentric.biz> Date: 2015-02-02T09:47:56Z SLING-4377 add JSR 305 null annotations ---- > Add JSR305 nullness 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/dev@sling.apache.org/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 2 annotations should be used: > # {{@Nonnull}}, for return values which are not supposed to be {{null}} or > parameters which must not be {{null}}. > # {{@CheckForNull}}, for return values wich may be null {{null}}. > Those are the only ones being supported by both Eclipse and Findbugs (compare > with http://sourceforge.net/p/findbugs/bugs/1355/) > {{@Nullable}} is basically ignored by Findbugs > (http://findbugs.sourceforge.net/manual/annotations.html) and should > therefore not be used. The package annotation for the default handling should > also not be used (because either {{@Nullable}} or {{@CheckForNull}} is > ignored by Eclipse then. -- This message was sent by Atlassian JIRA (v6.3.4#6332)