You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by gg...@apache.org on 2023/06/23 18:02:53 UTC

[juneau] 04/04: [juneau-rest-server] Reuse String#isEmpty() instead of custom length check

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git

commit 9af471d9e67063641a5a1e57edc43d9c5f4a2467
Author: Gary Gregory <gg...@rocketsoftware.com>
AuthorDate: Fri Jun 23 14:02:22 2023 -0400

    [juneau-rest-server] Reuse String#isEmpty() instead of custom length
    check
---
 .../src/main/java/org/apache/juneau/rest/util/RestUtils.java            | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
index e04cddb9e..f6dfe54db 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
@@ -392,7 +392,7 @@ public final class RestUtils {
 	public static String trimContextPath(String contextPath, String path) {
 		if (path == null)
 			return null;
-		if (path.length() == 0 || path.equals("/") || contextPath.length() == 0 || contextPath.equals("/"))
+		if (path.isEmpty() || path.equals("/") || contextPath.isEmpty() || contextPath.equals("/"))
 			return path;
 		String op = path;
 		if (path.charAt(0) == '/')