Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Implementation question
Implementation question [message #305553] Thu, 06 July 2006 03:33
Eclipse UserFriend
Hello!

I was just browsing through the Plugin class's source code and came
along the following passage:

<snip>
// Performance: isolate PreferenceForwarder into an inner class so that
it mere presence
// won't force the PreferenceForwarder class to be loaded (which
triggers Preferences plugin
// activation).
final Bundle bundleCopy = bundle;
final Preferences[] preferencesCopy = new Preferences[1];
Runnable innerCall = new Runnable() {
public void run() {
preferencesCopy[0] = new
org.eclipse.core.internal.preferences.legacy.PreferenceForwa rder(this,
bundleCopy.getSymbolicName());
}
};
innerCall.run();
preferences = preferencesCopy[0];
</snip>

Now I have three questions:

1. Why is the Bundle reference copied to a local variable?
2. Why is a Runnable used to get the reference to create
the PreferenceForwarder instance?
3. Why is that instance passed to the caller via an array?

Thanks for any clarifications.

Christian
Previous Topic:Plugin to react to track mouse movement
Next Topic:Unsolvable error while exporting plugins
Goto Forum:
  


Current Time: Tue Jul 22 21:30:40 EDT 2025

Powered by FUDForum. Page generated in 0.44299 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top