Optimizing addRegistryChangeListener

One of the things I have noticed in many Eclipse plugins is the use of the registry change listener implementation. This will be more common as plugins move to support dynamic extensions.

I admit I was at fault also and after some debugging I figure this would be some good information to share with all. If you do not specify a namespace on the call your callback method will get called on every registry changed.

reg.addRegistryChangeListener(this);

Should be:

reg.addRegistryChangeListener(this, PLUGIN_ID);

Now your plugin will only get called when there are changes in your namespace.

1 thought on “Optimizing addRegistryChangeListener

  1. Pingback: namespace extensions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.