You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2020/08/21 12:04:44 UTC
[sling-org-apache-sling-resourceresolver] 02/02: SLING-9676 -
Improve Javadoc for MapEntriesHandler
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git
commit 4dcf7d2b3b6b60cdb62e2f43123e47e9eb0e1721
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Aug 21 10:10:25 2020 +0200
SLING-9676 - Improve Javadoc for MapEntriesHandler
Add null annotations to MapEntry.replace
---
.../java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
index af139bb..67553d8 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
@@ -27,6 +27,8 @@ import java.util.regex.Pattern;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.resourceresolver.impl.ResourceResolverImpl;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -273,7 +275,7 @@ public class MapEntry implements Comparable<MapEntry> {
* @param value the value to replace
* @return a replaced value of <code>null</code> if the value does not match
*/
- public String[] replace(final String value) {
+ public @Nullable String[] replace(final @NotNull String value) {
final Matcher m = urlPattern.matcher(value);
if (m.find()) {
final String[] redirects = getRedirect();