Skip to content
Browse files

improved type check for map key

  • Loading branch information...
1 parent 7c0e0cd commit ce309f76a29d6131f83f4c5ddc321985f30ba707 Stephan Beutel committed Apr 10, 2012
View
5 restygwt/src/main/java/org/fusesource/restygwt/rebind/JsonEncoderDecoderInstanceLocator.java
@@ -206,8 +206,9 @@ private String encodeDecodeExpression(JType type, String expression,
if (types.length != 2) {
error("Map must define two and only two type parameters");
}
- if (isCollectionType(types[0])) {
- error("Map key can't be a collection");
+ if (isCollectionType(types[0])
+ || !builtInEncoderDecoders.containsKey(types[0])) {
+ error("Map key can't be a collection or object");
}
String keyEncoderDecoder = getEncoderDecoder(types[0], logger);
encoderDecoder = getEncoderDecoder(types[1], logger);

0 comments on commit ce309f7

Please sign in to comment.
Something went wrong with that request. Please try again.