Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-5610

ResourceUtil.getValueMap() contains a wrong @Nonnull annotation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: API 2.9.0
    • Fix Version/s: API 2.12.0
    • Component/s: API
    • Labels:
      None

      Description

      org.apache.sling.api.resource.ResourceUtil.getValueMap(res) performs a null check as first action (if ( res == null ) {). Also, the javadoc states that this method is null safe.

      But the method contains a @Nonnull annotation for the res parameter (@Nonnull final Resource res) which forces the calling methods to do an additional null check, even if the method handles it internally.

      I suggest to remove the annotation for the parameter.

        Attachments

          Activity

            People

            • Assignee:
              kwin Konrad Windszus
              Reporter:
              dominik.lienemann Dominik Lienemann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: