<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Avoid useless Plugin Initialization and/or Class Loading</title>
	<atom:link href="http://ahtik.com/blog/2007/12/19/avoiding-useless-plugin-initialization-andor-class-loading/feed/" rel="self" type="application/rss+xml" />
	<link>http://ahtik.com/blog/2007/12/19/avoiding-useless-plugin-initialization-andor-class-loading/</link>
	<description>blog</description>
	<lastBuildDate>Tue, 31 Jan 2012 22:08:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Ahti</title>
		<link>http://ahtik.com/blog/2007/12/19/avoiding-useless-plugin-initialization-andor-class-loading/comment-page-1/#comment-106</link>
		<dc:creator>Ahti</dc:creator>
		<pubDate>Thu, 20 Dec 2007 09:47:55 +0000</pubDate>
		<guid isPermaLink="false">http://ahtik.com/blog/2007/12/19/avoiding-useless-plugin-initialization-andor-class-loading/#comment-106</guid>
		<description>Sometimes respective source code like eclipse runtime is so trustworthy that one stops thinking if it&#039;s really correct :P</description>
		<content:encoded><![CDATA[<p>Sometimes respective source code like eclipse runtime is so trustworthy that one stops thinking if it&#8217;s really correct <img src='http://ahtik.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahti</title>
		<link>http://ahtik.com/blog/2007/12/19/avoiding-useless-plugin-initialization-andor-class-loading/comment-page-1/#comment-107</link>
		<dc:creator>Ahti</dc:creator>
		<pubDate>Thu, 20 Dec 2007 09:43:05 +0000</pubDate>
		<guid isPermaLink="false">http://ahtik.com/blog/2007/12/19/avoiding-useless-plugin-initialization-andor-class-loading/#comment-107</guid>
		<description>Mark: Haha! How embarrassing, you were right :)

Plugin source code has a comment regarding this and it was clearly misleading:
// Performance: isolate PreferenceForwarder into
// an inner class so that it mere presence
// won&#039;t force the PreferenceForwarder class
// to be loaded (which triggers Preferences
// plugin activation).

True, of course it makes sense that class load happens only when it&#039;s actually needed.

Now I don&#039;t see any reason why this Runnable is in #getPluginPreferences after all.</description>
		<content:encoded><![CDATA[<p>Mark: Haha! How embarrassing, you were right <img src='http://ahtik.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Plugin source code has a comment regarding this and it was clearly misleading:<br />
// Performance: isolate PreferenceForwarder into<br />
// an inner class so that it mere presence<br />
// won&#8217;t force the PreferenceForwarder class<br />
// to be loaded (which triggers Preferences<br />
// plugin activation).</p>
<p>True, of course it makes sense that class load happens only when it&#8217;s actually needed.</p>
<p>Now I don&#8217;t see any reason why this Runnable is in #getPluginPreferences after all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Hibberd</title>
		<link>http://ahtik.com/blog/2007/12/19/avoiding-useless-plugin-initialization-andor-class-loading/comment-page-1/#comment-108</link>
		<dc:creator>Mark Hibberd</dc:creator>
		<pubDate>Wed, 19 Dec 2007 19:03:47 +0000</pubDate>
		<guid isPermaLink="false">http://ahtik.com/blog/2007/12/19/avoiding-useless-plugin-initialization-andor-class-loading/#comment-108</guid>
		<description>In what circumstances do you think that PreferenceForwarder will load from the first example
&lt;code&gt;
if (isConfigurable()) {
  Bundle bundleCopy = bundle;
  Preferences[] preferencesCopy = new Preferences[1];
  preferencesCopy[0] = new org.eclipse.core.internal.
			preferences.legacy.PreferenceForwarder(
			this, bundleCopy.getSymbolicName());
  return preferencesCopy;
}
return null;
&lt;/code&gt;

My understanding is that classloading on most JVMs is so lazy that it will only happen if the condition is                           evaluated to true. A few tests on different JVMs (Sun 1.4.2, 5, 6 and IBM 1.4.2, 6) with -verbose:class confirmed this behavior for me.

It is not a big deal, but I am a little concerned with adding complexity (although not that much) for no reason.</description>
		<content:encoded><![CDATA[<p>In what circumstances do you think that PreferenceForwarder will load from the first example<br />
<code><br />
if (isConfigurable()) {<br />
  Bundle bundleCopy = bundle;<br />
  Preferences[] preferencesCopy = new Preferences[1];<br />
  preferencesCopy[0] = new org.eclipse.core.internal.<br />
			preferences.legacy.PreferenceForwarder(<br />
			this, bundleCopy.getSymbolicName());<br />
  return preferencesCopy;<br />
}<br />
return null;<br />
</code></p>
<p>My understanding is that classloading on most JVMs is so lazy that it will only happen if the condition is                           evaluated to true. A few tests on different JVMs (Sun 1.4.2, 5, 6 and IBM 1.4.2, 6) with -verbose:class confirmed this behavior for me.</p>
<p>It is not a big deal, but I am a little concerned with adding complexity (although not that much) for no reason.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

