summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-07-27 13:08:04 +0300
committerLeif Åstrand <leif@vaadin.com>2012-07-27 13:08:04 +0300
commit08e91123e2879cc84a8c0c3cfe6a7d1d3c8afbf6 (patch)
tree1dce917ce8577c24e119fa49d2b8756e69d1510f
parent820d0811a00ff35092775d5b2c0eae9561640c7b (diff)
downloadvaadin-framework-08e91123e2879cc84a8c0c3cfe6a7d1d3c8afbf6.tar.gz
vaadin-framework-08e91123e2879cc84a8c0c3cfe6a7d1d3c8afbf6.zip
Improve server-side error when serializing wildcard types (#8862)
-rw-r--r--src/com/vaadin/terminal/gwt/server/JsonCodec.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/JsonCodec.java b/src/com/vaadin/terminal/gwt/server/JsonCodec.java
index 8091a1d205..df596dba45 100644
--- a/src/com/vaadin/terminal/gwt/server/JsonCodec.java
+++ b/src/com/vaadin/terminal/gwt/server/JsonCodec.java
@@ -14,6 +14,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.lang.reflect.WildcardType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -522,6 +523,11 @@ public class JsonCodec implements Serializable {
throw new IllegalArgumentException("type must be defined");
}
+ if (valueType instanceof WildcardType) {
+ throw new IllegalStateException(
+ "Can not serialize type with wildcard: " + valueType);
+ }
+
if (null == value) {
return encodeNull();
}