Implementation question [message #305553] |
Thu, 06 July 2006 03:33 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.10612 seconds