<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-37306137.comments</id><updated>2009-10-29T16:08:16.933+01:00</updated><title type="text">From Java to Java EE &lt;small&gt;(through C# .NET)&lt;/small&gt;</title><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.bielu.com/feeds/comments/default" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/comments/default?start-index=26&amp;max-results=25" /><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>139</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/FromJavaToJavaEe/Comments" type="application/atom+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry><id>tag:blogger.com,1999:blog-37306137.post-4239008475758750126</id><published>2009-10-29T14:54:10.030+01:00</published><updated>2009-10-29T14:54:10.030+01:00</updated><title type="text">You assume yourself writes every line of the appli...</title><content type="html">You assume yourself writes every line of the application.&lt;br /&gt;&lt;br /&gt;What if different layers are written by different developers. Don&amp;#39;t you need to test each component as one single unit?&lt;br /&gt;&lt;br /&gt;Actually, I felt the same about the &amp;quot;waste code&amp;quot; and this is what brought me to your blog. But on the other hand, it seems to me that you are talking about some mix between UNIT and INTEGRATION test.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/5142571111936741811/comments/default/4239008475758750126" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/5142571111936741811/comments/default/4239008475758750126" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2008/09/can-unit-testing-be-waste.html?showComment=1256824450030#c4239008475758750126" title="" /><author><name>Kenneth Xu</name><uri>http://www.blogger.com/profile/12023692143986674116</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2008/09/can-unit-testing-be-waste.html" ref="tag:blogger.com,1999:blog-37306137.post-5142571111936741811" source="http://www.blogger.com/feeds/37306137/posts/default/5142571111936741811" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-3473069707098352473</id><published>2009-08-04T22:18:42.303+02:00</published><updated>2009-08-04T22:18:42.303+02:00</updated><title type="text">I hate UML. Its stupid and people that love it too...</title><content type="html">I hate UML. Its stupid and people that love it too much act like assholes.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/1239278012814109749/comments/default/3473069707098352473" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/1239278012814109749/comments/default/3473069707098352473" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2007/12/uml-is-useless-not-to-say-sucks.html?showComment=1249417122303#c3473069707098352473" title="" /><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2007/12/uml-is-useless-not-to-say-sucks.html" ref="tag:blogger.com,1999:blog-37306137.post-1239278012814109749" source="http://www.blogger.com/feeds/37306137/posts/default/1239278012814109749" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7572622792063966196</id><published>2009-07-20T12:54:04.573+02:00</published><updated>2009-07-20T12:54:04.573+02:00</updated><title type="text">Thanks Artem!</title><content type="html">Thanks Artem!</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/2303749315530640847/comments/default/7572622792063966196" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/2303749315530640847/comments/default/7572622792063966196" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/07/scrum-presentation-for-riviera-jug.html?showComment=1248087244573#c7572622792063966196" title="" /><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="00313775433780294050" /></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/07/scrum-presentation-for-riviera-jug.html" ref="tag:blogger.com,1999:blog-37306137.post-2303749315530640847" source="http://www.blogger.com/feeds/37306137/posts/default/2303749315530640847" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-5087061287640491385</id><published>2009-07-20T12:23:08.081+02:00</published><updated>2009-07-20T12:23:08.081+02:00</updated><title type="text">Nice presentation. Good luck with establishng the ...</title><content type="html">Nice presentation. Good luck with establishng the local group!</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/2303749315530640847/comments/default/5087061287640491385" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/2303749315530640847/comments/default/5087061287640491385" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/07/scrum-presentation-for-riviera-jug.html?showComment=1248085388081#c5087061287640491385" title="" /><author><name>Artem Marchenko</name><uri>http://agilesoftwaredevelopment.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/07/scrum-presentation-for-riviera-jug.html" ref="tag:blogger.com,1999:blog-37306137.post-2303749315530640847" source="http://www.blogger.com/feeds/37306137/posts/default/2303749315530640847" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7832354147241310365</id><published>2009-06-26T01:48:38.483+02:00</published><updated>2009-06-26T01:48:38.483+02:00</updated><title type="text">Hi Przemysław,

Nice work.  I'm looking around for...</title><content type="html">Hi Przemysław,&lt;br /&gt;&lt;br /&gt;Nice work.  I&amp;#39;m looking around for JFreechar with Ajax.  Would you mind sharing the details of your implementation? and may be source code?  &lt;br /&gt;&lt;br /&gt;Take care.&lt;br /&gt;s</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/545858487618023904/comments/default/7832354147241310365" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/545858487618023904/comments/default/7832354147241310365" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2007/07/playing-with-jfreechart-and-ajax.html?showComment=1245973718483#c7832354147241310365" title="" /><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2007/07/playing-with-jfreechart-and-ajax.html" ref="tag:blogger.com,1999:blog-37306137.post-545858487618023904" source="http://www.blogger.com/feeds/37306137/posts/default/545858487618023904" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7238318796371890340</id><published>2009-06-16T17:39:58.106+02:00</published><updated>2009-06-16T17:39:58.106+02:00</updated><title type="text">I can't say I've ever been writing Transact-Sql or...</title><content type="html">I can&amp;#39;t say I&amp;#39;ve ever been writing Transact-Sql or PL/SQL and felt the need to use the Decorator pattern or anything else really OO. My feeling has always been that OO and databases don&amp;#39;t mix. The relational model is, I think, too sophisticated to ever being manipulated in an OO way. Look at Microsoft Linq (language-integrated query), for example. It&amp;#39;s not OO so much as it is functional and generic, and these are two paradigms that are completely independent of OO. In fact, generics were basically a rebellion against OO. &lt;br /&gt;Of course, I have worked on projects where we claimed to use OO and we also had a database, but there was always a great deal of awkwardness at the seams, and this is one reason I&amp;#39;ve never really embraced the concept of OO.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/7238318796371890340" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/7238318796371890340" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html?showComment=1245166798106#c7238318796371890340" title="" /><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html" ref="tag:blogger.com,1999:blog-37306137.post-8371336367696894319" source="http://www.blogger.com/feeds/37306137/posts/default/8371336367696894319" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-6125386451620014753</id><published>2009-06-10T12:54:38.644+02:00</published><updated>2009-06-10T12:54:38.644+02:00</updated><title type="text">Awesome :-)</title><content type="html">Awesome :-)</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/2012982946908859391/comments/default/6125386451620014753" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/2012982946908859391/comments/default/6125386451620014753" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/06/vendor-client-relationship-in-real.html?showComment=1244631278644#c6125386451620014753" title="" /><author><name>Slawomir Ginter</name><uri>http://www.blogger.com/profile/11380966944243353645</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/06/vendor-client-relationship-in-real.html" ref="tag:blogger.com,1999:blog-37306137.post-2012982946908859391" source="http://www.blogger.com/feeds/37306137/posts/default/2012982946908859391" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-5466816860221314955</id><published>2009-05-22T14:27:40.439+02:00</published><updated>2009-05-22T14:27:40.439+02:00</updated><title type="text">Hi,

I have checked you Web EMS Admin tool and I t...</title><content type="html">Hi,&lt;br /&gt;&lt;br /&gt;I have checked you Web EMS Admin tool and I think it's great. I'm one of those who are fed up (extremely) with the console-base admin tool that comes with EMS.&lt;br /&gt;&lt;br /&gt;I was wondering what other features does the tool have, what other commands are implemented and if it's available to use and/or download. Alternatively I would appreciate if you could provide access to the full version to evaluate it's capabilities.&lt;br /&gt;&lt;br /&gt;Great job. Thanks in advance.&lt;br /&gt;&lt;br /&gt;Eduardo Sanchez-Ros</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/4714062282944162196/comments/default/5466816860221314955" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/4714062282944162196/comments/default/5466816860221314955" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2007/05/javabielucom.html?showComment=1242995260439#c5466816860221314955" title="" /><author><name>Eduardo Sanchez-Ros</name><uri>http://www.blogger.com/profile/10220436423429107239</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2007/05/javabielucom.html" ref="tag:blogger.com,1999:blog-37306137.post-4714062282944162196" source="http://www.blogger.com/feeds/37306137/posts/default/4714062282944162196" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7443281809849312180</id><published>2009-05-21T12:07:12.097+02:00</published><updated>2009-05-21T12:07:12.097+02:00</updated><title type="text">Knowing tools is not the main thing a professional...</title><content type="html">Knowing tools is not the main thing a professional needs, but I never saw a professional who wouldn't know his tools and wouldn't have his very own set of tools he masters.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/202765341607024941/comments/default/7443281809849312180" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/202765341607024941/comments/default/7443281809849312180" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/05/sysinternals-process-explorer-saved-my.html?showComment=1242900432097#c7443281809849312180" title="" /><author><name>Artem Marchenkp</name><uri>http://agilesoftwaredevelopment.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/05/sysinternals-process-explorer-saved-my.html" ref="tag:blogger.com,1999:blog-37306137.post-202765341607024941" source="http://www.blogger.com/feeds/37306137/posts/default/202765341607024941" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-5156737326497242088</id><published>2009-05-08T11:23:00.000+02:00</published><updated>2009-05-08T11:23:00.000+02:00</updated><title type="text">What brilliant solution!

Many thanks ;)</title><content type="html">What brilliant solution!&lt;br /&gt;&lt;br /&gt;Many thanks ;)</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8180630122759411133/comments/default/5156737326497242088" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8180630122759411133/comments/default/5156737326497242088" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2008/09/solution-to-struts2-upload-file-error.html?showComment=1241774580000#c5156737326497242088" title="" /><author><name>Pequeño</name><uri>http://www.blogger.com/profile/07847356822758909431</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2008/09/solution-to-struts2-upload-file-error.html" ref="tag:blogger.com,1999:blog-37306137.post-8180630122759411133" source="http://www.blogger.com/feeds/37306137/posts/default/8180630122759411133" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7000045546958512851</id><published>2009-04-19T22:39:00.000+02:00</published><updated>2009-04-19T22:39:00.000+02:00</updated><title type="text">There is a difference between creating new thread ...</title><content type="html">There is a difference between creating new thread and letting thread pool to handle the runnable. In first case, you are invoking explicit memory synchronization barrier, in second it is not really guaranteed (might be implementation dependent I think).&lt;br /&gt;&lt;br /&gt;In Sun JDK implementation, I think it will work even with executor pool. Worker class is doing the runLock.lock(); before execution of actual Runnable starts (so it is loading state from common memory). Caller thread on the other hand is synchronizing in submit, which is calling execute, which is calling addIfUnderCorePoolSize, which will flush there with unlock before using the thread to run the runnable OR offering it to blocking queue from which Worker thread will retrieve it, also creating synchronization point.&lt;br /&gt;&lt;br /&gt;I'm not sure if this is possible to create Executor service which would allow for different behaviour and still be compatible with all the specs - but it is also not clearly specified that memory is synchronized before passing data to  worker threads. In such case, it is always better to stay on the safe side. In fact, it is always better to stay on the safe side, even in example you gave here, because it reduces amount of magic dependencies in code and allows nasty surprises when code is later refactored by somebody else. Plus final fields make things easier to understand even in single threaded code ;)&lt;br /&gt;&lt;br /&gt;Easiest example of need for final is  non-synchronized static variable which is pointing to some singleton-like data. If you don't care about possible multiple initializations, you can do lazy initialization of it from calling thread if needed. In such case, some other thread running 'later' might see null and will initialize it again - but it is not an issue. What it the issue is that if you use non-final fields in it, it can see a reference to the 'singleton', but still half-initialized/null contents, even if you initialized it fully before assigning to static variable.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/7000045546958512851" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/7000045546958512851" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240173540000#c7000045546958512851" title="" /><author><name>abies</name><uri>http://www.blogger.com/profile/01153887805003519136</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-2837880874577677479</id><published>2009-04-19T21:31:00.000+02:00</published><updated>2009-04-19T21:31:00.000+02:00</updated><title type="text">"@Shantany &amp; Ram - you're partially right :) I for...</title><content type="html">&amp;quot;@Shantany &amp;amp; Ram - you&amp;#39;re partially right :) I forgot to add very important detail that it&amp;#39;s safe only fore reads i.e. when we assume map.put(...) statement will never occur.&amp;quot;&lt;br /&gt;&lt;br /&gt;If you never intended to make your map modifiable, the example makes absolutely no sense. I agree with abby that there was not a problem to begin with that you are trying to solve with your immutable class.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/2837880874577677479" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/2837880874577677479" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240169460000#c2837880874577677479" title="" /><author><name>Ram</name><uri>http://www.blogger.com/profile/11046038651474815049</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-876962790012628877</id><published>2009-04-18T23:15:00.000+02:00</published><updated>2009-04-18T23:15:00.000+02:00</updated><title type="text">abies is entirely correct. The JLS specifies that ...</title><content type="html">abies is entirely correct. The JLS specifies that on Thread.start() happens before any other action on that thread. Thus, with or without final in, the new Thread will see the correct data for SomeClass. Since SomeClass and the Thread are constructed on the Main thread before the call to start() happens, then I would be interested to know how you think a NullPointerException can happen on the newly spawned Thread.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/876962790012628877" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/876962790012628877" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240089300000#c876962790012628877" title="" /><author><name>Mike K</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7188449407308312116</id><published>2009-04-18T19:36:00.000+02:00</published><updated>2009-04-18T19:36:00.000+02:00</updated><title type="text">You sound resonable and this is the reason why I h...</title><content type="html">You sound resonable and this is the reason why I have to confront your opinion with this comment: http://java2jee.blogspot.com/2008/11/java-concurrency-is-easy-combining.html?showComment=1226948760000#c4144762493589566546&lt;br /&gt;&lt;br /&gt;Any ideas? Does it make a difference when you create new thread and when you submit your task to the executore service?</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/7188449407308312116" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/7188449407308312116" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240076160000#c7188449407308312116" title="" /><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="00313775433780294050" /></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-3244107302673874379</id><published>2009-04-18T13:25:00.000+02:00</published><updated>2009-04-18T13:25:00.000+02:00</updated><title type="text">Sorry to be nitpicking, but multithreading program...</title><content type="html">Sorry to be nitpicking, but multithreading programming is about details:&lt;br /&gt;&lt;br /&gt;"Look - in the code I provided I create new thread together with creating the object of SimpleClass."&lt;br /&gt;&lt;br /&gt;No, you are creating new thread after SimpleClass has finished initialization. Even that doesn't matter so much, as it is the 'start' method which is really spawning a new execution thread, which is called even after Thread constructor.&lt;br /&gt;&lt;br /&gt;From &lt;br /&gt;http://gee.cs.oswego.edu/dl/cpj/jmm.html&lt;br /&gt;&lt;br /&gt;"Thread.start has the same memory effects as a lock release by the thread calling start, followed by a lock acquire by the started thread."&lt;br /&gt;&lt;br /&gt;On lock release, thread view of data is flushed to common memory. On lock acquire, thread view of data is synced from common memory. This means, that anything put in code of calling thread before .start is called will be fully visible to new thread. As SimpleClass is fully finishes initialization even without final keyword, it will be visible to spawned thread.&lt;br /&gt;&lt;br /&gt;Only tricky part with thread creation is if you spawn a new thread from constructor of the object and let 'this' pointer escape to the new thread. In such case, you are out of luck even if final keyword is used.&lt;br /&gt;&lt;br /&gt;I think that&lt;br /&gt;http://moonbase.rydia.net/mental/blog/programming/java/the-java-memory-model-for-programmers&lt;br /&gt;got it right in the small table in the middle of the post. You can see there&lt;br /&gt;Writes up to and including… &lt;br /&gt;    a call to Thread.start&lt;br /&gt;...are made visible to…&lt;br /&gt;    the newly started thread.&lt;br /&gt;&lt;br /&gt;You may want to browse the rest of the cases to get better understanding of the relations between threads.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/3244107302673874379" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/3244107302673874379" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240053900000#c3244107302673874379" title="" /><author><name>abies</name><uri>http://www.blogger.com/profile/01153887805003519136</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-6788002255109447200</id><published>2009-04-18T12:19:00.000+02:00</published><updated>2009-04-18T12:19:00.000+02:00</updated><title type="text">ERRATA: when we assume map.put(...) statement will...</title><content type="html">ERRATA: when we assume map.put(...) statement will never occur AFTER the object is created. On the other hand preProcessMap() can do whathever reads and writes it likes because until the constructor is finished final fields are safe to modify.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/6788002255109447200" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/6788002255109447200" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240049940000#c6788002255109447200" title="" /><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="00313775433780294050" /></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-6747102478710441736</id><published>2009-04-18T11:30:00.000+02:00</published><updated>2009-04-18T11:30:00.000+02:00</updated><title type="text">@Shantany &amp; Ram - you're partially right :) I forg...</title><content type="html">@Shantany &amp;amp; Ram - you&amp;#39;re partially right :) I forgot to add very important detail that it&amp;#39;s safe only fore reads i.e. when we assume map.put(...) statement will never occur.&lt;br /&gt;&lt;br /&gt;@abies - synchronization of start() method only guarantees that &amp;quot;It is never legal to start a thread more than once.&amp;quot; not that the initialization of the object in another thread will finishe before starting this thread. Look - in the code I provided I create new thread together with creating the object of SimpleClass. You cannot be sure what will be done first because the second thread is being created.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/6747102478710441736" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/6747102478710441736" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240047000000#c6747102478710441736" title="" /><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="00313775433780294050" /></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-2271934765467324210</id><published>2009-04-18T08:38:00.000+02:00</published><updated>2009-04-18T08:38:00.000+02:00</updated><title type="text">Thread.start is synchronized. Before that new thre...</title><content type="html">Thread.start is synchronized. Before that new thread is not existing, so it cannot have a copy of old memory from before that moment.&lt;br /&gt;&lt;br /&gt;I think that your particular example will work perfectly well without final keyword.&lt;br /&gt;&lt;br /&gt;Which clearly shows that concurrency is NOT easy ;)</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/2271934765467324210" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/2271934765467324210" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240036680000#c2271934765467324210" title="" /><author><name>abies</name><uri>http://www.blogger.com/profile/01153887805003519136</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-5986078445477368630</id><published>2009-04-18T07:47:00.000+02:00</published><updated>2009-04-18T07:47:00.000+02:00</updated><title type="text">Agree with Shantanu, it is too simplistic to assum...</title><content type="html">Agree with Shantanu, it is too simplistic to assume final is be all and end all for being thread safe. &lt;br /&gt;&lt;br /&gt;It will be safer to say synchronized is what makes things thread safe. &lt;br /&gt;&lt;br /&gt;Of course that comes with a cost. We can reduce the cost by reducing the scope of synchronization through some strategies. &lt;br /&gt;&lt;br /&gt;Using the appropriate concurrent utils in jdk5+ is one way to achieve this. &lt;br /&gt;&lt;br /&gt;Using thread local variables is another. &lt;br /&gt;&lt;br /&gt;Limiting all modifications of shared object to a dedicated thread is yet another. &lt;br /&gt;&lt;br /&gt;Ensuring every thread has its own copy of data to work on is yet another - maybe this is truly what you wanted to get at here. &lt;br /&gt;&lt;br /&gt;Remember that a completely immutable object is not very useful for most processing purposes.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/5986078445477368630" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/5986078445477368630" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240033620000#c5986078445477368630" title="" /><author><name>Ram</name><uri>http://www.blogger.com/profile/11046038651474815049</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-6232682868065365877</id><published>2009-04-18T05:50:00.000+02:00</published><updated>2009-04-18T05:50:00.000+02:00</updated><title type="text">This one is a really bad example. What if you acci...</title><content type="html">This one is a really bad example. What if you accidentally write a map.put(...) statement in the code somewhere? Or what if a maintenance programmer does that?&lt;br /&gt;&lt;br /&gt;final is fine for primitives. But for objects you need immutable data types (e.g. Collections.unmodifiableMap(...)).</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/6232682868065365877" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/6286527861871001503/comments/default/6232682868065365877" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html?showComment=1240026600000#c6232682868065365877" title="" /><author><name>Shantanu Kumar</name><uri>http://www.blogger.com/profile/05850495396182844220</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/04/java-concurrency-is-easy-power-of-final.html" ref="tag:blogger.com,1999:blog-37306137.post-6286527861871001503" source="http://www.blogger.com/feeds/37306137/posts/default/6286527861871001503" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-5391230841752662559</id><published>2009-03-26T15:11:00.000+01:00</published><updated>2009-03-26T15:11:00.000+01:00</updated><title type="text">I agree.  (I feel the same frustration when buildi...</title><content type="html">I agree.  (I feel the same frustration when building web pages and trying to code presentation logic via nested tags -- no matter how rich in features the tag library may be.  Fortunately, some newer web frameworks let you code your presentation logic in plain old Java.  I just wish they were part of the standard tool set.)&lt;BR/&gt;&lt;BR/&gt;I wonder whether Oracle's subset of Java retained the object-oriented capability.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/5391230841752662559" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/5391230841752662559" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html?showComment=1238076660000#c5391230841752662559" title="" /><author><name>Frank Silbermann</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html" ref="tag:blogger.com,1999:blog-37306137.post-8371336367696894319" source="http://www.blogger.com/feeds/37306137/posts/default/8371336367696894319" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-8569839499565788195</id><published>2009-03-26T09:32:00.000+01:00</published><updated>2009-03-26T09:32:00.000+01:00</updated><title type="text">@first anonymous commenterI'm very glad that datab...</title><content type="html">@first anonymous commenter&lt;BR/&gt;I'm very glad that databases have a language of sorts, like T-SQL, that allows me to perform some manipulations before retrieving the code. All kinds of complex gathering, sorting and filtering are very inefficient if you first have to retrieve all the data for that. &lt;BR/&gt;&lt;BR/&gt;Of course, premature optimization is the root of all evil. We have written applications that serve thousands of clients a day, that do not use any stored procedures (or any caching for what that matters). However, saying that an RDBMS should not provide 'ifs' and 'fors' is just ignorant.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/8569839499565788195" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/8569839499565788195" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html?showComment=1238056320000#c8569839499565788195" title="" /><author><name>confusion</name><uri>http://confusion.myopenid.com/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html" ref="tag:blogger.com,1999:blog-37306137.post-8371336367696894319" source="http://www.blogger.com/feeds/37306137/posts/default/8371336367696894319" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-8005826991290061532</id><published>2009-03-26T09:06:00.000+01:00</published><updated>2009-03-26T09:06:00.000+01:00</updated><title type="text">You've got an excellent point. But I didn't really...</title><content type="html">You've got an excellent point. But I didn't really mean SQL language but the language for stored procedures i.e. writing business logic on top of the underlying data.&lt;BR/&gt;&lt;BR/&gt;As you pointed out (I totally agree with you) this language is meant to gather data. That would be fine but if DB providers allow developers to put business logic directly on DB servers the languages they provide should be better - that was my point.&lt;BR/&gt;&lt;BR/&gt;Just to be clear - I'm generally big anti-fan of stored procedures but anyway I'm open enough to see their usage in some particular cases.&lt;BR/&gt;&lt;BR/&gt;Cheers!</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/8005826991290061532" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/8005826991290061532" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html?showComment=1238054760000#c8005826991290061532" title="" /><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="00313775433780294050" /></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html" ref="tag:blogger.com,1999:blog-37306137.post-8371336367696894319" source="http://www.blogger.com/feeds/37306137/posts/default/8371336367696894319" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-4881657546005715113</id><published>2009-03-26T07:53:00.000+01:00</published><updated>2009-03-26T07:53:00.000+01:00</updated><title type="text">SQL means Structured Query Language, it should nei...</title><content type="html">SQL means Structured Query Language, it should neither have &lt;I&gt;ifs&lt;/I&gt; or &lt;I&gt;fors&lt;/I&gt; because this language is meant to gather data, process them and then pass this result to a real programming language when something else needs to be done.&lt;BR/&gt;&lt;BR/&gt;But some company never seems to have understand that and I have seen tons of business rules written in SQL that should have been written somewhere else.</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/4881657546005715113" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/8371336367696894319/comments/default/4881657546005715113" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html?showComment=1238050380000#c4881657546005715113" title="" /><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2009/03/why-object-oriented-languages-rock.html" ref="tag:blogger.com,1999:blog-37306137.post-8371336367696894319" source="http://www.blogger.com/feeds/37306137/posts/default/8371336367696894319" type="text/html" /></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-1721768987350352781</id><published>2009-02-17T08:36:00.000+01:00</published><updated>2009-02-17T08:36:00.000+01:00</updated><title type="text">I would like to share with "Urbi et Orbi" another ...</title><content type="html">I would like to share with "Urbi et Orbi" another important thing I've just realized: 2*2 = 4!!!!</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/7785329299781449246/comments/default/1721768987350352781" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/37306137/7785329299781449246/comments/default/1721768987350352781" /><link rel="alternate" type="text/html" href="http://blog.bielu.com/2008/12/java-concurrency-is-easy-synchronized.html?showComment=1234856160000#c1721768987350352781" title="" /><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr="http://purl.org/syndication/thread/1.0" href="http://blog.bielu.com/2008/12/java-concurrency-is-easy-synchronized.html" ref="tag:blogger.com,1999:blog-37306137.post-7785329299781449246" source="http://www.blogger.com/feeds/37306137/posts/default/7785329299781449246" type="text/html" /></entry></feed>
