Revision: 10428
Author:   gwt.mirror...@gmail.com
Date:     Fri Jul  8 07:22:32 2011
Log:      Use erasure to handle wildcard types in RfValidator.
Restore FindRequest to 2.4 parameterization.
Patch by: bobv
Review by: rchandia

Review at http://gwt-code-reviews.appspot.com/1467814

http://code.google.com/p/google-web-toolkit/source/detail?r=10428

Modified:
/trunk/user/src/com/google/web/bindery/requestfactory/apt/ClientToDomainMapper.java /trunk/user/src/com/google/web/bindery/requestfactory/apt/TransportableTypeVisitor.java /trunk/user/src/com/google/web/bindery/requestfactory/apt/TypeSimplifier.java /trunk/user/src/com/google/web/bindery/requestfactory/shared/impl/FindRequest.java

=======================================
--- /trunk/user/src/com/google/web/bindery/requestfactory/apt/ClientToDomainMapper.java Fri Jul 8 03:40:53 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/apt/ClientToDomainMapper.java Fri Jul 8 07:22:32 2011
@@ -62,6 +62,12 @@
     if (state.types.isAssignable(x, state.entityProxyType)
         || state.types.isAssignable(x, state.valueProxyType)) {
       // FooProxy -> FooDomain
+      /*
+ * TODO(bobv): This if statement should be widened to baseProxy to support + * heterogenous collections of any proxy type. The BaseProxy interface + * would also need to be annotated with an @ProxyFor mapping. This can be + * done once RFIV is removed, since it only allows homogenous collections.
+       */
TypeElement domainType = state.getClientToDomainMap().get(state.types.asElement(x));
       if (domainType == null) {
         return defaultAction(x, state);
@@ -120,10 +126,7 @@
   @Override
   public TypeMirror visitWildcard(WildcardType x, State state) {
     // Convert <? extends FooProxy> to FooDomain
-    if (x.getExtendsBound() != null) {
-      return x.getExtendsBound().accept(this, state);
-    }
-    return defaultAction(x, state);
+    return state.types.erasure(x).accept(this, state);
   }

   /**
=======================================
--- /trunk/user/src/com/google/web/bindery/requestfactory/apt/TransportableTypeVisitor.java Fri Jul 8 03:40:53 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/apt/TransportableTypeVisitor.java Fri Jul 8 07:22:32 2011
@@ -105,7 +105,7 @@
   @Override
   public Boolean visitWildcard(WildcardType t, State state) {
     // Allow List<? extends FooProxy>
- return t.getExtendsBound() != null && t.getExtendsBound().accept(this, state);
+    return state.types.erasure(t).accept(this, state);
   }

   @Override
=======================================
--- /trunk/user/src/com/google/web/bindery/requestfactory/apt/TypeSimplifier.java Fri Jul 1 09:12:59 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/apt/TypeSimplifier.java Fri Jul 8 07:22:32 2011
@@ -102,10 +102,7 @@

   @Override
   public TypeMirror visitWildcard(WildcardType x, State state) {
-    if (x.getExtendsBound() != null) {
-      return x.getExtendsBound().accept(this, state);
-    }
-    return state.objectType;
+    return state.types.erasure(x).accept(this, state);
   }

   @Override
=======================================
--- /trunk/user/src/com/google/web/bindery/requestfactory/shared/impl/FindRequest.java Fri Jul 1 09:12:59 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/shared/impl/FindRequest.java Fri Jul 8 07:22:32 2011
@@ -31,5 +31,5 @@
   /**
* Use the implicit lookup in passing EntityProxy types to service methods.
    */
-  Request<EntityProxy> find(EntityProxyId<? extends EntityProxy> proxy);
-}
+  Request<EntityProxy> find(EntityProxyId<?> proxy);
+}

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to