Community
Participate
Working Groups
The abstract class org.eclipse.draw2d.EventDispatcher has a method (IFigure getFocusOwner();) which is at the same time abstract and package private. This forces all subclasses of EventDispatcher to reside in the same package as EventDispatcher itself, which is very inconvenient and doesn't seem to serve any purpose at all. I propose to make this public.
Come to think of it, why is EventDispatcher not an interface, anyway?
Making things worse, EventDispatcher has a protected abstract method that gets called from outside of EventDispatchers inheritance hierarchy (by client classes like Figure). Consider the following scenario: I'm writing a subclass of EventDispatcher that I put in a package callled org.eclipse.draw2d in my plugin project. My EventDispatcher subclass should delegate all method calls to a delegate event dispatcher (some subclass of EventDispatcher). But I cannot delegate EventDispatcher#updateCursor() because even though my event dispatcher subclass is in the same package as the EventDispatcher class itself, my event dispatcher and the delegate dispatcher are loaded by different class loaders, which according to the VM specs prohibits accessing protected methods / fields across classloader boundaries. So I get the following runtime error: (class: org/eclipse/draw2d/EventDispatcher3D, method: updateCursor signature: ()V) Bad access to protected data This makes it impossible to write any delegating event dispatcher. Now I have to subclass EventDomainDispatcher, which, if EventDispatcher were and interface (or had only public methods), would not be neccessary at all (and makes my code vulnerable to all problems that subclassing introduces).
Things are getting worse in current GEF 3.6 version as described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=306609 Jens
Will investigate for 3.6 M7.
We released 3.6 M7 today so moving unresolved bugs to 3.6 RC1. We need to re-access if we can complete these for Helios.
(In reply to comment #0) > The abstract class org.eclipse.draw2d.EventDispatcher has a method (IFigure > getFocusOwner();) which is at the same time abstract and package private. This > forces all subclasses of EventDispatcher to reside in the same package as > EventDispatcher itself, which is very inconvenient and doesn't seem to serve > any purpose at all. > > I propose to make this public. This method is now public. See Bug 241767 .