My favorites | Sign in
Google
                
New issue | Search
for
| Advanced search | Search tips
Issue 1163: REGRESSION: 1.4.10RC RPC: using interfaces as parameters of serializable types confused the RPC sanity checking
1 person starred this issue and may be notified of changes. Back to list
 
Reported by sandymac, Jun 04, 2007
Found in GWT Release:
1.4.10

Detailed description:
Two closely related problems.

1. Using an interface with a sub-interface as a RPC method parameter or
return type cause RPC sanity checking to think that there is a subtype
without a default constructor or no-arg ctor. eg:

interface A extends IsSerializable { ...
interface B extends A { ...

While interface B doesn't have a default constructor, that is a restriction
of an interface.

2. If said interface is used more than once in a RemoteService than the
warning issued for above becomes an ERROR preventing the application from
compiling.


Attached is an example project that demonstrates these issues.


Workaround if you have one:
Don't use interfaces in RemoteServices.

Links to the relevant GWT Developer Forum posts:
http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_frm/thread/61dfd059986045a0

GWTInterfacesAndRpc.zip
7.2 KB Download
Comment 1 by gwt.team.bruce, Jun 04, 2007
Sounds definitely like a mistake -- thanks sandymac!
Labels: -Priority-Medium Priority-Critical Category-RPC Milestone-1_4_RC2
Comment 2 by gwt.team.bruce, Jun 04, 2007
(No comment was entered for this change.)
Owner: gwt.team.mmendez
Cc: gwt.team.bruce gwt.team.jgw gwt.team.scottb
Comment 3 by gwt.team.mmendez, Jun 25, 2007
(No comment was entered for this change.)
Status: Started
Comment 4 by gwt.team.mmendez, Jun 28, 2007
The attached patch fixes issues 1161 and 1163.  Seemed like a good idea to put them
together since they impact the same file.

 Issue 1161 : 
We only checked for native methods if the class was automatically serializable. 
Since all of our JRE classes with native methods use custom field serializers we
never saw the native method warning.  When external developers added auto
serializable types to the JRE they did get warnings.  This patch will check any
serializable types for native methods.  The check is skipped if the type is part of
the JRE emulation.  We assume that all types whose package names begin with "java."
are not part of our JRE.    This does not account for javax and org.* packages which
are part of the real JRE.

 Issue 1163 :
There were a few problems with this code.  First, when generating a log message we
did not store whether or not it was a warning or an error.  If the type was seen
multiple times, it was possible that what was previously a warning would be treated
as an error.

Second, abstract classes that did not have any instantiable subtypes would be
considered an error.

Third, I removed several warnings about assignment to parameters and member
visibility causing synthetic access methods to be generated.
issues_1161_1163-r1205.patch
27.6 KB Download
Status: ReviewPending
Labels: ReviewBy-scottb
Comment 5 by gwt.team.mmendez, Jun 28, 2007
(No comment was entered for this change.)
Status: Started
Labels: -ReviewBy-scottb
Comment 6 by gwt.team.mmendez, Jun 28, 2007
Please review this latest patch.  It addresses  issue 1129 , also removed some test
code which was no longer necessary.

The fix is that if we are in a manually serialized type that uses Object or Object[]
we will consider all serializable subtypes of Object.  Without being able to deal
with arrays dynamically and without giving additional information to CFS this is the
best that we can do.  We should be able to handle this correctly in RPC v2.
issues_1129_1161_1163-r1205.patch
42.2 KB Download
Status: ReviewPending
Comment 7 by gwt.team.mmendez, Jun 28, 2007
(No comment was entered for this change.)
Labels: ReviewBy-scottb
Comment 8 by gwt.team.scottb, Jun 28, 2007
I'm not clear on what UnserializableClass with a custom serializer actually means or
tests, but otherwise everything on the test end looks good.. glad to see the
workaround is no longer needed.

As for SerializableTypeOracleBuilder:
227: This would seem to make unserializable a type which had generated only warnings;
is this the intent?
669: I'm not clear why this line was added.
654(old rev): Not clear on why this was removed.

General:
- I notice not all warnings logged become warned issues attached to that type; is
this the intent?
- I see a few lines needing format (whitespaces)

Otherwise, LGTM.

Comment 9 by gwt.team.mmendez, Jul 10, 2007
Committed as r1228.
Status: FixedNotReleased
Comment 10 by gwt.team.scottb, Aug 20, 2007
1.4 RC2 now released.
Status: Fixed
Comment 11 by sumitcha...@google.com, Apr 28, 2008
 
Owner: mmendez
Comment 12 by br...@google.com, Apr 29, 2008
 
Comment 13 by br...@google.com, Apr 29, 2008
 
Comment 14 by br...@google.com, Apr 29, 2008
 
Cc: br...@google.com
Comment 15 by br...@google.com, Apr 29, 2008
 
Cc: -gwt.team.bruce
Comment 16 by scottb@google.com, Apr 29, 2008
 
Comment 17 by scottb@google.com, Apr 29, 2008
 
Cc: -gwt.team.scottb sco...@google.com
Comment 18 by jgw+personal@google.com, Apr 29, 2008
 
Cc: -gwt.team.jgw j...@google.com
Comment 19 by sumitcha...@google.com, May 01, 2008
 
Comment 20 by sumitcha...@google.com, May 02, 2008
 
Comment 21 by sumitcha...@google.com, May 02, 2008
 
Sign in to add a comment