From 4c9fedc2636d21afe6c6df47d244688054885c03 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 31 Jul 2012 10:43:20 +0000 Subject: [PATCH] Correctly decode maps and arrays with "" as the last value (#9188) svn changeset:24038/svn branch:6.8 --- .../terminal/gwt/server/AbstractCommunicationManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index ae2cacdd38..827785bd33 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1609,8 +1609,8 @@ public abstract class AbstractCommunicationManager implements } private Object convertMap(String strValue) { - String[] parts = strValue - .split(String.valueOf(VAR_ARRAYITEM_SEPARATOR)); + String[] parts = strValue.split( + String.valueOf(VAR_ARRAYITEM_SEPARATOR), -1); HashMap map = new HashMap(); for (int i = 0; i < parts.length; i += 2) { String key = parts[i]; @@ -1650,7 +1650,8 @@ public abstract class AbstractCommunicationManager implements } private Object convertArray(String strValue) { - String[] val = strValue.split(String.valueOf(VAR_ARRAYITEM_SEPARATOR)); + String[] val = strValue.split(String.valueOf(VAR_ARRAYITEM_SEPARATOR), + -1); if (val.length == 0 || (val.length == 1 && val[0].length() == 0)) { return new Object[0]; } -- 2.39.5