<?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: On the Violation of Java Access Control</title>
	<atom:link href="http://stuffthathappens.com/blog/2007/10/11/on-the-violation-of-java-access-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuffthathappens.com/blog/2007/10/11/on-the-violation-of-java-access-control/</link>
	<description>Technology and Geek Stuff by Eric Burke</description>
	<lastBuildDate>Thu, 04 Nov 2010 22:37:00 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: It&#8217;s Just a Bunch of Stuff That Happens &#187; Blog Archive &#187; You CAN Change Final Fields</title>
		<link>http://stuffthathappens.com/blog/2007/10/11/on-the-violation-of-java-access-control/comment-page-1/#comment-303</link>
		<dc:creator>It&#8217;s Just a Bunch of Stuff That Happens &#187; Blog Archive &#187; You CAN Change Final Fields</dc:creator>
		<pubDate>Sun, 14 Oct 2007 01:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/2007/10/11/on-the-violation-of-java-access-control/#comment-303</guid>
		<description>[...] On the Violation of Java Access Control       Oct [...]</description>
		<content:encoded><![CDATA[<p>[...] On the Violation of Java Access Control       Oct [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Vernum</title>
		<link>http://stuffthathappens.com/blog/2007/10/11/on-the-violation-of-java-access-control/comment-page-1/#comment-298</link>
		<dc:creator>Tim Vernum</dc:creator>
		<pubDate>Sat, 13 Oct 2007 14:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/2007/10/11/on-the-violation-of-java-access-control/#comment-298</guid>
		<description>I think you&#039;re actually falling into an optimisation trap, not an access control trap.
Try calling:
   System.out.println(&quot;Age field is &quot; + ageField.get(caveman));
And you should find it is 100.

The reason your code prints 10 is most likely due to the compiler optimising the implementation of getAge(). Because age is final, and has a single fixed value (10), it is possible for the compiler to optimise the implementation of &quot;getAge()&quot; to &quot;return 10;&quot;</description>
		<content:encoded><![CDATA[<p>I think you&#8217;re actually falling into an optimisation trap, not an access control trap.<br />
Try calling:<br />
   System.out.println(&#8221;Age field is &#8221; + ageField.get(caveman));<br />
And you should find it is 100.</p>
<p>The reason your code prints 10 is most likely due to the compiler optimising the implementation of getAge(). Because age is final, and has a single fixed value (10), it is possible for the compiler to optimise the implementation of &#8220;getAge()&#8221; to &#8220;return 10;&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Miler</title>
		<link>http://stuffthathappens.com/blog/2007/10/11/on-the-violation-of-java-access-control/comment-page-1/#comment-291</link>
		<dc:creator>Alex Miler</dc:creator>
		<pubDate>Fri, 12 Oct 2007 14:25:10 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/2007/10/11/on-the-violation-of-java-access-control/#comment-291</guid>
		<description>Or of course, you can just modify the byte code when the class is loaded so the field is no longer final.... :)  Trivial to do with ASM.</description>
		<content:encoded><![CDATA[<p>Or of course, you can just modify the byte code when the class is loaded so the field is no longer final&#8230;. <img src='http://stuffthathappens.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Trivial to do with ASM.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.221 seconds -->

