aino-komal / mvp4g

Automatically exported from code.google.com/p/mvp4g
0 stars 0 forks source link

problem passing array between modules (via parent) #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. parent module with 2 child modules
2. child1 raises an event carrying an array
3. the event from child1 is propagated to child2 through the parent 
(forwardToParent=true on child1 event, modulesToLoad=child2 on parent event)
4. child2 handles the event.

What is the expected output? What do you see instead?
the data does not arrive to child2 as expected, instead exceptions are thrown 
(cast exception when data is present, index access exception for empty array, 
NPE for null). If I change the data type to "Object" instead of array on the 
event busses, the data does go through correctly

What version of the product are you using? On what operating system?
gwt 2.2, mvp 1.3.1, OSX SL

Original issue reported on code.google.com by Tomer.Do...@gmail.com on 23 Apr 2011 at 8:07

GoogleCodeExporter commented 9 years ago
The error comes from varargs (Object...) that Mvp4g uses. I will have to see 
what is the best solution, either remove varargs and use regular Object[] or 
add some casting.

The best workaround for now is to use an list instead of a table or to add a 
fake first parameter to your event's method. Instead of:
void onEvent(String[] params);
you can have:
void onEvent(String fake, String[] params);

Original comment by plcoir...@gmail.com on 26 Apr 2011 at 12:41

GoogleCodeExporter commented 9 years ago
Fixed in the last 1.4.0 snapshot

Original comment by plcoir...@gmail.com on 12 Jun 2011 at 6:28