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

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ca2c6815881c9617797566c965ef120d8ca5e8be
Author: Otavio Rodolfo Piske <angusyo...@gmail.com>
AuthorDate: Wed May 24 15:24:03 2023 +0200

    (chores) camel-util: return an empty map if there's no parameters
---
 core/camel-util/src/main/java/org/apache/camel/util/URISupport.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/core/camel-util/src/main/java/org/apache/camel/util/URISupport.java 
b/core/camel-util/src/main/java/org/apache/camel/util/URISupport.java
index 3a0a124d881..06dd4d72f9b 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/URISupport.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/URISupport.java
@@ -24,6 +24,7 @@ import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -210,7 +211,7 @@ public final class URISupport {
     public static Map<String, Object> parseQuery(String uri, boolean useRaw, 
boolean lenient) throws URISyntaxException {
         if (uri == null || uri.isEmpty()) {
             // return an empty map
-            return new LinkedHashMap<>(0);
+            return Collections.emptyMap();
         }
 
         // must check for trailing & as the uri.split("&") will ignore those

Reply via email to