You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2021/10/27 06:27:43 UTC

[sling-org-apache-sling-api] 01/01: SLING-9850 clarify null annotations for ResourceResolver.map(...)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/SLING-9850-clarify-null-annotatios-for-RR-map
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-api.git

commit 430f2680cdba077512573ea59a803fd60e7e62c6
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Wed Oct 27 08:27:34 2021 +0200

    SLING-9850 clarify null annotations for ResourceResolver.map(...)
---
 src/main/java/org/apache/sling/api/resource/ResourceResolver.java | 6 +++---
 src/main/java/org/apache/sling/api/resource/package-info.java     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/api/resource/ResourceResolver.java b/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
index 73bc627..dd77998 100644
--- a/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
+++ b/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
@@ -292,7 +292,7 @@ public interface ResourceResolver extends Adaptable, Closeable {
      * be resolved via {@link #resolve(String)}. 
      *
      * @param resourcePath The path for which to return a mapped path.
-     * @return The mapped path.
+     * @return The mapped path or {@code resourcePath} in case no mapping is found.
      * @throws IllegalStateException if this resource resolver has already been
      *             {@link #close() closed}.
      * 
@@ -329,7 +329,7 @@ public interface ResourceResolver extends Adaptable, Closeable {
      * @param request The http servlet request object which may be used to apply
      *            more mapping functionality.
      * @param resourcePath The path for which to return a mapped path.
-     * @return The mapped URL.
+     * @return The mapped URL or {@code resourcePath} in case no mapping is found.
      * @throws IllegalStateException if this resource resolver has already been
      *             {@link #close() closed}.
      * @since 2.0.4 (Sling API Bundle 2.0.4)
@@ -338,7 +338,7 @@ public interface ResourceResolver extends Adaptable, Closeable {
      * @see <a href="https://tools.ietf.org/html/rfc3986#section-2.1">Percent-Encoding</a>
      * @see <a href="https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html">Mappings for Resource Resolution</a>
      */
-    @Nullable String map(@NotNull HttpServletRequest request, @NotNull String resourcePath);
+    @NotNull String map(@NotNull HttpServletRequest request, @NotNull String resourcePath);
 
     /**
      * Returns a {@link Resource} object for data located at the given path.
diff --git a/src/main/java/org/apache/sling/api/resource/package-info.java b/src/main/java/org/apache/sling/api/resource/package-info.java
index 7bd85e6..2c8f5ae 100644
--- a/src/main/java/org/apache/sling/api/resource/package-info.java
+++ b/src/main/java/org/apache/sling/api/resource/package-info.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version("2.12.2")
+@Version("2.12.3")
 package org.apache.sling.api.resource;
 
 import org.osgi.annotation.versioning.Version;