Reviewers: rdayal,

Description:
Fix issue 5658: PlaceHistoryGeneratorContext now examines
PlaceTokenizers' hierarchy.


Please review this at https://gwt-code-reviews.appspot.com/1674804/

Affected files:
  M user/src/com/google/gwt/place/rebind/PlaceHistoryGeneratorContext.java
M user/test/com/google/gwt/place/rebind/PlaceHistoryGeneratorContextTest.java
  M user/test/com/google/gwt/place/testplaces/Tokenizer4.java


Index: user/src/com/google/gwt/place/rebind/PlaceHistoryGeneratorContext.java diff --git a/user/src/com/google/gwt/place/rebind/PlaceHistoryGeneratorContext.java b/user/src/com/google/gwt/place/rebind/PlaceHistoryGeneratorContext.java index 4cdd5fa83b299d94bc087ff24209e40ff8412f59..97def441c0c762fc4c91102efdba4f96c3bcec6a 100644
--- a/user/src/com/google/gwt/place/rebind/PlaceHistoryGeneratorContext.java
+++ b/user/src/com/google/gwt/place/rebind/PlaceHistoryGeneratorContext.java
@@ -240,7 +240,7 @@ class PlaceHistoryGeneratorContext {
       implementedInterfaces.add(isInterface);
     }

- implementedInterfaces.addAll(Arrays.asList(tokenizerType.getImplementedInterfaces())); + implementedInterfaces.addAll(tokenizerType.getFlattenedSupertypeHierarchy());

     JClassType rtn = placeTypeForInterfaces(implementedInterfaces);
     if (rtn == null) {
@@ -343,4 +343,4 @@ class PlaceHistoryGeneratorContext {
     }
     return rtn;
   }
-}
\ No newline at end of file
+}
Index: user/test/com/google/gwt/place/rebind/PlaceHistoryGeneratorContextTest.java diff --git a/user/test/com/google/gwt/place/rebind/PlaceHistoryGeneratorContextTest.java b/user/test/com/google/gwt/place/rebind/PlaceHistoryGeneratorContextTest.java index 623fa5d08beb83519273ed26628ccc458637c1de..37a8c72a63925c13deb147929452547f198e72d1 100644 --- a/user/test/com/google/gwt/place/rebind/PlaceHistoryGeneratorContextTest.java +++ b/user/test/com/google/gwt/place/rebind/PlaceHistoryGeneratorContextTest.java
@@ -35,6 +35,7 @@ import com.google.gwt.place.shared.Prefix;
 import com.google.gwt.place.shared.WithTokenizers;
 import com.google.gwt.place.testplacemappers.NoFactory;
 import com.google.gwt.place.testplacemappers.WithFactory;
+import com.google.gwt.place.testplaces.AbstractTokenizer;
 import com.google.gwt.place.testplaces.Place1;
 import com.google.gwt.place.testplaces.Place2;
 import com.google.gwt.place.testplaces.Place3;
@@ -85,6 +86,7 @@ public class PlaceHistoryGeneratorContextTest extends TestCase {
     rtn.add(new RealJavaResource(Place3.class));
     rtn.add(new RealJavaResource(Place4.class));
     rtn.add(new RealJavaResource(Place6.class));
+    rtn.add(new RealJavaResource(AbstractTokenizer.class));
     rtn.add(new RealJavaResource(Tokenizer2.class));
     rtn.add(new RealJavaResource(Tokenizer3.class));
     rtn.add(new RealJavaResource(Tokenizer4.class));
Index: user/test/com/google/gwt/place/testplaces/Tokenizer4.java
diff --git a/user/test/com/google/gwt/place/testplaces/Tokenizer4.java b/user/test/com/google/gwt/place/testplaces/Tokenizer4.java index 7f416350c11210378860ff6b38d4fb823bf405b5..eba0d0b47efb116db09d6dea364197c8433a5968 100644
--- a/user/test/com/google/gwt/place/testplaces/Tokenizer4.java
+++ b/user/test/com/google/gwt/place/testplaces/Tokenizer4.java
@@ -15,17 +15,11 @@
  */
 package com.google.gwt.place.testplaces;

-import com.google.gwt.place.shared.PlaceTokenizer;
-
 /**
* Used by tests of {@link com.google.gwt.place.rebind.PlaceHistoryMapperGenerator}.
  */
-public class Tokenizer4 implements PlaceTokenizer<Place4> {
+public class Tokenizer4 extends AbstractTokenizer<Place4> {
   public Place4 getPlace(String token) {
     return new Place4(token);
   }
-
-  public String getToken(Place4 place) {
-    return place.content;
-  }
 }


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

Reply via email to