You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by an...@apache.org on 2021/05/19 05:59:52 UTC
[sling-org-apache-sling-feature-cpconverter] 01/01: SLING-10388 :
RepoPath.getParent returns null for top-level paths (nullability
annotations)
This is an automated email from the ASF dual-hosted git repository.
angela pushed a commit to branch SLING-10388
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git
commit 1d5496c67dc20eee7858dd8d816669458446c591
Author: angela <an...@adobe.com>
AuthorDate: Wed May 19 07:59:34 2021 +0200
SLING-10388 : RepoPath.getParent returns null for top-level paths (nullability annotations)
---
.../java/org/apache/sling/feature/cpconverter/shared/RepoPath.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/sling/feature/cpconverter/shared/RepoPath.java b/src/main/java/org/apache/sling/feature/cpconverter/shared/RepoPath.java
index 999ce45..0335847 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/shared/RepoPath.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/shared/RepoPath.java
@@ -26,7 +26,8 @@ import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
-/** A Repo Path represents a path in the repository, for example when used in
+/**
+ * A Repo Path represents a path in the repository, for example when used in
* a repoinit section.
*
* @see
@@ -87,7 +88,7 @@ public class RepoPath implements Comparable<RepoPath>{
return new RepoPath(parentPath);
}
- public List<String> getSegments() {
+ public @NotNull List<String> getSegments() {
return path;
}
@@ -97,7 +98,7 @@ public class RepoPath implements Comparable<RepoPath>{
* @param otherPath The other path to check against.
* @return If it starts with the other path or not.
*/
- public boolean startsWith(RepoPath otherPath) {
+ public boolean startsWith(@Nullable RepoPath otherPath) {
if (otherPath == null || isRepositoryPath || otherPath.isRepositoryPath) {
return false;
}