Automatically exported from code.google.com/p/rocket-gwt
0
stars
0
forks
source link
Rocket serialization compiler does not allow for List interface to be used. I suspect it doesn't allow any of the collection interfaces, such as Map, Set, etc. #60
What steps will reproduce the problem?
1. Create a class like the following:
public class TestListInRocket implements Serializable {
private static final long serialVersionUID = 1L;
protected List<Integer> testList = new ArrayList<Integer>();
public TestListInRocket() {
}
public List<Integer> getTestList() {
return testList;
}
public void setTestList(List<Integer> testList) {
this.testList.clear();
this.testList.addAll(testList);
}
}
2. Add the following to your serialization factory interface.
@serialization-listElementType java.land.Integer
@serialization-readableTypes
com.gwtblocks.client.serialization.rocket.TestListInRocket
@serialization-writableTypes
com.gwtblocks.client.serialization.rocket.TestListInRocket
3. Try to compile the code with gwt and you get compilation errors. If I
change the List<Integer> definition to use a specific type of list
instead, such as ArrayList<Integer>, then it compiles just fine.
What is the expected output? What do you see instead?
I expect the compiler to not have any problems compiling the code.
Instead I get the following errors:
Computing all possible rebind results
for 'com.gwtblocks.client.serialization.rocket.RocketSerializationFactory'
Rebinding
com.gwtblocks.client.serialization.rocket.RocketSerializationFactory
Invoking <generate-with
class='rocket.serialization.rebind.SerializationFactoryGenerator'/>
Recieved
type "com.gwtblocks.client.serialization.rocket.RocketSerializationFactory"
.
Attempting to load and merge all blacklists (unsorted).
Finding existing ObjectReaders...
Finding existing ObjectWriters...
Finding all serializable types reachable from class
com.gwtblocks.client.serialization.rocket.TestListInRocket
com.gwtblocks.client.serialization.rocket.TestListInRocket
Field: testList
java.util.Arrays.ArrayList
Field: array
[ERROR] Unexpected problem whilst running
generator for
type "com.gwtblocks.client.serialization.rocket.RocketSerializationFactory"
.
java.lang.AssertionError: Unable to find array component type "E extends
java.lang.Object".
at rocket.util.client.Checker.fail(Checker.java:41)
at rocket.util.client.Checker.handleNull(Checker.java:60)
at rocket.util.client.Checker.notNull(Checker.java:55)
at
rocket.generator.rebind.gwt.TypeOracleGeneratorContext.createType
(TypeOracleGeneratorContext.java:224)
at rocket.generator.rebind.GeneratorContextImpl.findType
(GeneratorContextImpl.java:213)
at rocket.generator.rebind.GeneratorContextImpl.getType
(GeneratorContextImpl.java:247)
at rocket.generator.rebind.gwt.TypeOracleGeneratorContext.getType
(TypeOracleGeneratorContext.java:258)
at rocket.generator.rebind.gwt.JFieldFieldAdapter.createType
(JFieldFieldAdapter.java:82)
at rocket.generator.rebind.field.AbstractField.getType
(AbstractField.java:53)
at
rocket.serialization.rebind.SerializationFactoryGenerator$4.visitField
(SerializationFactoryGenerator.java:598)
at
rocket.generator.rebind.visitor.ReachableTypesVisitor.visitFields
(ReachableTypesVisitor.java:221)
at
rocket.serialization.rebind.SerializationFactoryGenerator$4.visitFields
(SerializationFactoryGenerator.java:570)
at
rocket.generator.rebind.visitor.ReachableTypesVisitor.processType
(ReachableTypesVisitor.java:122)
at rocket.generator.rebind.visitor.ReachableTypesVisitor.visitType
(ReachableTypesVisitor.java:83)
at
What version of the product are you using? On what operating system?
0.56 on Windows XP
Please provide any additional information below.
Original issue reported on code.google.com by fvil...@gmail.com on 23 Feb 2009 at 7:49
Original issue reported on code.google.com by
fvil...@gmail.com
on 23 Feb 2009 at 7:49