Unhandled event loop exception

February 21, 2008

Lot of people wonder what the famous Unhandled event loop exception is !!!???

This is no more than an uncaught Exception occurring with in the Eclipse workbench Main thread (or the UI thread, it’s the same).

When writing Eclipse plugins we often write code that will be executed within the Main thread. For example when contributing a new hello world button within the main Eclipse toolbar we must implement a given interface with a run() method.

In this method we write the code responsible to display to the user the “Hello world message”. If this code throws a new Exception without catching it then the Exception is forwarded to the caller. This caller is the Eclipse code but not our !!!!

In this Eclipse code the Exception is forwarded up to the Workbench.runEventLoop(IExceptionHandler, Display) method that catch it and log a new Unhandled event loop exception Error message. This message also contains our source Exception displayed as Reason :

When you see an Unhandled event loop exception , don’t worry and just look for the reason, it’s often a silly mistake :o)


Java Fields Visibility / Public - Private - Protected ….

February 14, 2008

For a long time, my understanding of Java fields visibility was wrong !!!

Here are the right visibilities for public, private, protected and package fields

private : can be accessed only from the class declaring the field

public : can be accessed from everywhere

package (when no visibility is specified) : can be accessed from every class within the same package

protected : can be accessed from any subclass OR from any class within the same package (protected = package + subclasses)


Eclipse Profiling / Memory Analyzer Part 3

February 5, 2008

Hi,

This blog was started 3 weeks ago and only contains 9 posts today. Most of the traffic on the blog was generated by the two posts about “Profile Your Eclipse Plugins with SAP Memory Analyzer” here and here.

Eclipse’s plugins profiling seems to be a real question for a lot of us !!! This new tool help us to quickly identify memory leaks in our applications but what about time performances ??

How do you profile your plugins time performances ?? I would be intersted in any suggestions on this topi so pelase let me know.

Regards

Manu