On Tuesday, August 22, 2006 at 2:32:24 AM UTC+2, StudyBlue wrote:
Casting 'non-serializable' objects to 'serializable' objects alone is
1. According to the serialization documentation for the GWT,
java.util.Date is serializable.
webtoolkit/documentation/com. google.gwt.doc.DeveloperGuide. RemoteProcedureCalls. SerializableTypes.html
2. According to the java docs, java.sql.Date is a subclass of
3. According to you-can-look-it-up-yourself you can validly cast a
subclass to the type of the superclass.
Intuitively, you should be able to send java.sql.Dates across the RPC
boundary simply by casting them. Unfortunately, the reflection calls
appear to look for the most specific type possible, not necessarily
whatever it was cast to last. (Maybe that's intended. Maybe I'm
totally off on my blind guess for what's causing this.) No matter how
I cast I java.sql.Date to java.util.Date, the call would always throw
an exception claiming I was trying to send a java.sql.Date. Eventually
I got fed up with that and created a new java.util.Date from the
java.sql.Date's getTime() method. Creating an entirely new object
solved the problem, but I'm assuming that's taking more time and
processing than a simple cast. If there's any way to make a sufficient
cast, I'd love to hear it.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/f971938a-06f4-403f-b737-161835da1bf8o%40googlegroups.com.