diff options
author | Leif Åstrand <leif@vaadin.com> | 2015-03-14 15:45:22 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-04-27 13:18:22 +0300 |
commit | f8404b9be9d8f599ae62d0be22aab3e25142796f (patch) | |
tree | 9225b42dceed06b5d4ca601bfe2d5b3063ba4f3b /server | |
parent | b5cf10682069780d0cbc05f102c2cf575b5c91cd (diff) | |
download | vaadin-framework-f8404b9be9d8f599ae62d0be22aab3e25142796f.tar.gz vaadin-framework-f8404b9be9d8f599ae62d0be22aab3e25142796f.zip |
Remove broken custom String[] serialization (#17146)
Change-Id: If40b6c4e979e4258a22a7d2d1af0532d3e8f11bc
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/JsonCodec.java | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/server/src/com/vaadin/server/JsonCodec.java b/server/src/com/vaadin/server/JsonCodec.java index fc95accd6e..8b685bb046 100644 --- a/server/src/com/vaadin/server/JsonCodec.java +++ b/server/src/com/vaadin/server/JsonCodec.java @@ -417,7 +417,7 @@ public class JsonCodec implements Serializable { connectorTracker); } else if (JsonConstants.VTYPE_STRINGARRAY.equals(transportType)) { - return decodeStringArray((JsonArray) encodedJsonValue); + return decodeArray(String.class, (JsonArray) encodedJsonValue, null); } // Special Vaadin types @@ -573,15 +573,6 @@ public class JsonCodec implements Serializable { return Enum.valueOf(cls, value.getString()); } - private static String[] decodeStringArray(JsonArray jsonArray) { - int length = jsonArray.length(); - List<String> tokens = new ArrayList<String>(length); - for (int i = 0; i < length; ++i) { - tokens.add(jsonArray.getString(i)); - } - return tokens.toArray(new String[tokens.size()]); - } - private static Object[] decodeObjectArray(Type targetType, JsonArray jsonArray, ConnectorTracker connectorTracker) { List<Object> list = decodeList(List.class, true, jsonArray, @@ -659,8 +650,6 @@ public class JsonCodec implements Serializable { toReturn = Json.create(((Number) value).doubleValue()); } else if (value instanceof Character) { toReturn = Json.create(Character.toString((Character) value)); - } else if (value instanceof String[]) { - toReturn = toJsonArray((String[]) value); } else if (value instanceof Collection) { toReturn = encodeCollection(valueType, (Collection<?>) value, connectorTracker); @@ -997,13 +986,4 @@ public class JsonCodec implements Serializable { JSONSerializer serializer = customSerializers.get(value.getClass()); return serializer.serialize(value, connectorTracker); } - - private static JsonArray toJsonArray(String[] array) { - JsonArray jsonArray = Json.createArray(); - for (int i = 0; i < array.length; ++i) { - jsonArray.set(i, array[i]); - } - return jsonArray; - } - } |