cziegeler commented on code in PR #57: URL: https://github.com/apache/sling-org-apache-sling-api/pull/57#discussion_r2053724464
########## src/main/java/org/apache/sling/api/resource/ResourceUtil.java: ########## @@ -271,12 +271,19 @@ public static String getParent(final String path, final int level) { * @throws NullPointerException If <code>path</code> is <code>null</code>. */ public static @NotNull String getName(@NotNull String path) { + if (path == null) { + throw new NullPointerException("provided path is null"); + } if ("/".equals(path)) { return ""; } // normalize path (remove . and ..) path = normalize(path); + if (path == null) { + throw new IllegalArgumentException( + String.format("normalized path '%s' resolves to a path higher than root", path)); Review Comment: path is already null when the exception message is created -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org