Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351175 - Listener interfaces should be marked as Serializeable
Summary: Listener interfaces should be marked as Serializeable
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.5 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 342407
  Show dependency tree
 
Reported: 2011-07-05 08:32 EDT by Rüdiger Herrmann CLA
Modified: 2011-07-10 09:40 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Herrmann CLA 2011-07-05 08:32:52 EDT
Currently the listener interfaces from SWT (SelectionListener, ControlListener, etc.) do not implement Serializable. This makes things harder for applications that require their sessions to be serializable in order to provide transparent session failover. Each listener must be made Serializable in the application code. Unless the application programmer provides his/her own _serializable listeners_, anonymous listeners aren't possible any more.
Instead of writing anonymous classes like so:
  button.addSelectionListener( new SelectionListener() {
    ... 
  } );
application programmers would have to create a new interface:
  interface SerializableSelectionListener extends SelectionListener, Serializable {
  }
and then write
  button.addSelectionListener( new SerializableSelectionListener() {
    ... 
  } );

From a clustered-application-programmers point of view it would be convenient if RWT would provide serializable listeners out of the box. 
Those that aren't interested in serializable listeners would get compiler warnings like
  The serializable class XXX does not declare a static final serialVersionUID field of type long
if they stay with the default compiler settings.  

After several discussions I tend to take the 'RWT comes with serializable listeners' approach. Any other opinions?
Comment 1 Rüdiger Herrmann CLA 2011-07-09 07:03:59 EDT
org.eclipse.swt.widgets.Listener now implements Serializable
Comment 2 Rüdiger Herrmann CLA 2011-07-10 09:40:18 EDT
SWTEventListener now implements Serializable
Sorry for the compiler warnings, they will be fixed with bug 351641.