This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch trunk
in repository
https://gitbox.apache.org/repos/asf/ofbiz-framework.gitThe following commit(s) were added to refs/heads/trunk by this push:
new f2632b9 Fixed: Sorting of lists generates undesired results (OFBIZ-8302)
f2632b9 is described below
commit f2632b90c5cab5b4733016a6a264c031822bb0de
Author: Jacques Le Roux <
[hidden email]>
AuthorDate: Sun Nov 1 10:47:31 2020 +0100
Fixed: Sorting of lists generates undesired results (OFBIZ-8302)
Fixes an issue reported by UtilHttpTest::emptyParameterMap
More to come for MacroFormRendererTest::renderSortFieldUsesQueryString
Both put in with "MacroFormRenderer refactoring" (OFBIZ-11456)
---
framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java | 2 +-
.../base/src/test/java/org/apache/ofbiz/base/util/UtilHttpTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
index 570569b..721b726 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
@@ -169,7 +169,7 @@ public final class UtilHttp {
// Handles encoded queryStrings
String requestURI = req.getRequestURI();
- if (params.isEmpty() && !requestURI.isEmpty()) {
+ if (params.isEmpty() && null != requestURI) {
try {
List<NameValuePair> nameValuePairs = URLEncodedUtils.parse(new URI(URLDecoder.decode(requestURI, "UTF-8")),
Charset.forName("UTF-8"));
diff --git a/framework/base/src/test/java/org/apache/ofbiz/base/util/UtilHttpTest.java b/framework/base/src/test/java/org/apache/ofbiz/base/util/UtilHttpTest.java
index 8ef5e30..2842dbd 100644
--- a/framework/base/src/test/java/org/apache/ofbiz/base/util/UtilHttpTest.java
+++ b/framework/base/src/test/java/org/apache/ofbiz/base/util/UtilHttpTest.java
@@ -19,6 +19,7 @@
package org.apache.ofbiz.base.util;
import static org.apache.ofbiz.base.util.UtilHttp.getPathInfoOnlyParameterMap;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.anEmptyMap;
import static org.hamcrest.Matchers.contains;
@@ -28,7 +29,6 @@ import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertNull;
-import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.when;
import java.sql.Timestamp;