You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2018/06/11 15:45:00 UTC

[jira] [Created] (SLING-7723) XSS API is using other JSR-305 annotations than the rest of Sling

Konrad Windszus created SLING-7723:
--------------------------------------

             Summary: XSS API is using other JSR-305 annotations than the rest of Sling
                 Key: SLING-7723
                 URL: https://issues.apache.org/jira/browse/SLING-7723
             Project: Sling
          Issue Type: Improvement
          Components: XSS Protection API
    Affects Versions: XSS Protection API 2.0.6
            Reporter: Konrad Windszus


According to https://sling.apache.org/documentation/development/jsr-305.html only two different annotations are supposed to be used:
{code}
javax.annotation.CheckForNull
javax.annotation.Nonnull
{code}

The {{XSSAPI}} uses though 
{code}
javax.annotation.Nullable
javax.annotation.Nonnull
{code}

Since it is trickier to setup the IDE to support both {{Nullable}} and {{CheckForNull}} and also FindBugs is only supporting the latter, I would recommend to switch to {{CheckForNull}} for return values which might be {{null}}. Every method argument which is not explicitly marked as {{Nonnull}} is always considered {{Nullable}} by every tool! 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)