<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5830860775515675394</id><updated>2012-01-28T10:44:20.147-08:00</updated><category term='kiss'/><category term='java tips'/><category term='Jetty'/><category term='Maven'/><category term='Vaadin'/><category term='Development tools'/><category term='Eclipse'/><category term='software development'/><category term='devil'/><category term='DevClub'/><title type='text'>Andrei Solntsev</title><subtitle type='html'>Java development practical practices</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-3399537725248494147</id><published>2012-01-28T08:34:00.000-08:00</published><updated>2012-01-28T08:34:03.527-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software development'/><category scheme='http://www.blogger.com/atom/ns#' term='kiss'/><title type='text'>KISS</title><content type='html'>Recently I did talk about KISS principle in software development:&lt;br /&gt;&lt;blockquote&gt;Keep it stupid simple&lt;/blockquote&gt;&lt;br /&gt;After a short introduction (see slides below) participants were given a number of problems for solving.  The problems were very simple, so the goal was not just to solve them, but to find as simple solution as possible.&lt;br /&gt;&lt;br /&gt;Participants could post their solutions to an online server. Here it is:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://taskserver.jelastic.com/"&gt;http://taskserver.jelastic.com/&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;Now posting new solutions is disabled; you can only browse all provided solutions.&lt;br /&gt;In future versions it's planned to implement automated testing of provided solutions.&lt;br /&gt;  &lt;br /&gt;&lt;div style="width:425px" id="__ss_11309686"&gt;&lt;strong style="display:block;margin:12px 0 4px"&gt;&lt;a href="http://www.slideshare.net/asolntsev/kissdevclub-eeest" title="Kiss.devclub ee.est"&gt;Kiss.devclub ee.est&lt;/a&gt;&lt;/strong&gt;&lt;object id="__sse11309686" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=kiss-devclub-ee-est-120128092851-phpapp01&amp;stripped_title=kissdevclub-eeest&amp;userName=asolntsev" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;param name="wmode" value="transparent"/&gt;&lt;embed name="__sse11309686" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=kiss-devclub-ee-est-120128092851-phpapp01&amp;stripped_title=kissdevclub-eeest&amp;userName=asolntsev" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/asolntsev"&gt;Andrei Solntsev&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-3399537725248494147?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/3399537725248494147/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=3399537725248494147' title='Комментарии: 1'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/3399537725248494147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/3399537725248494147'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2012/01/kiss.html' title='KISS'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-5059207877746214148</id><published>2011-03-03T16:30:00.000-08:00</published><updated>2011-03-04T14:29:46.921-08:00</updated><title type='text'>WTF is business logic?</title><content type='html'>&lt;h3&gt;Question&lt;/h3&gt;&lt;br /&gt;I have heard many times the term "logic" or "business-logic" in discussions about software development. For instance:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;(about unit-tests) it's not necessary to achieve 100% code coverage, testing of &lt;b&gt;logic &lt;/b&gt;is god enough.&lt;/li&gt;&lt;li&gt; (about web applications architecture) controller should not contain any &lt;b&gt;business-logic&lt;/b&gt;, it only should call other classes's methods.&lt;/li&gt;&lt;li&gt;VIEW layer (e.g. JSP files) should not contain any &lt;b&gt;business logic&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Now tell me, what is "logic"? Does it mean any IF in code? But, I don't think that code without IFs ever existed. Or "business-logic" means any information that came from client? Actually I believe that all what we do is initiated by client, so all our code does contain information from client. That's why I never could understand what the fuck is "business logic".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Answer&lt;/h3&gt;&lt;br /&gt;Probably this question could be easier answered if you use term "knowledge" instead of "logic". "Logic" is any &lt;b&gt;knowledge&lt;/b&gt; about the code, or about how your code should behave. It may be also expressed like "logic is anything that you ever wanted to comment".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;br /&gt;Let's consider class Account for example.&lt;br /&gt;&lt;br /&gt;Once upon a time Internet connection disappeared from our office for two hours. I actually could not work because SVN, jira, dabase etc. were not available. And I decided to exercise in writing unit-tests. So I found class Account:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;public class Account&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;// Negative amount means that account is prepaid&lt;br /&gt;&amp;nbsp;&amp;nbsp;private BigDecimal amount;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public BigDecimal getAmount() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return amount;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;// And 20 getters/setters more&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At the first glance, is there anything to test? Is there any IFs? Is there any logic? It seems that no. No logic, no IFs - nothing to test. I wanted to skip this class and find something more complicated, but eventually got sight of the comment near the &lt;code&gt;amount&lt;/code&gt; field:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Negative amount means that account is prepaid&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Wait, what is that?&lt;br /&gt;It turns out that the &lt;code&gt;amount&lt;/code&gt; is a total debt of the client, and if the client has made an advanced payment, then this "debt" is negative. Well, this is some knowledge about the code. Let's try to &lt;a href="http://asolntsev.blogspot.com/2010/05/why-devil-invented-javadoc.html"&gt;convert this comment to unit-test&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;public class AccountTest&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;@Test&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void negativeAmountMeansThatAccountIsPrepaid() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Account prepaidAccount = new Account(-123);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;assertTrue(prepaidAccount.isPrepaid());&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Since we check for negative &lt;code&gt;amount&lt;/code&gt;, it also would be reasonable to check for positive &lt;code&gt;amount&lt;/code&gt;:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&amp;nbsp;&amp;nbsp;@Test&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void positiveAmountMeansThatAccountIsInDebt() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Account indebtAccount = new Account(456);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;assertFalse(indebtAccount.isPrepaid());&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;assertTrue(indebtAccount.isInDebt());&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We have eventually got two new methods &lt;code&gt;isPrepaid&lt;/code&gt; and &lt;code&gt;isInDebt&lt;/code&gt;, which implementation is of course straightforward for you:&lt;br /&gt;&lt;pre name="code" class="java"&gt;public class Account&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;private BigDecimal amount;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public boolean isInDebt() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return amount &amp;gt; 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;public boolean isPrepaid() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return amount &amp;lt; 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You see, we have got IF's in our code!&lt;br /&gt;What's next? You should have thought: probably, these IF's already were somewhere in the code?&lt;br /&gt;&lt;br /&gt;I had to search for such IF's for a while, but it was worth it. These IFs were in JSP files, which is the "view" layer, which should not contain any business logic by definition:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&amp;lt;% Positive amount means that account is in debt %&gt;&lt;br /&gt;&amp;lt;c:if test="${account.amount &amp;gt; 0}"&gt;&lt;br /&gt;  &amp;lt;span style="color: red;"&gt;Please pay your debt!&amp;lt;/span&gt;&lt;br /&gt;&amp;lt;/c:if&gt;&lt;br /&gt;&amp;lt;c:if test="${account.amount &amp;lt; 0}"&gt;&lt;br /&gt;  &amp;lt;span style="color: green;"&gt;Advanced payment&amp;lt;/span&gt;&lt;br /&gt;&amp;lt;/c:if&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Wow, we have found the second test-case. Cool. Now, since we have methods &lt;code&gt;isInDebt&lt;/code&gt; and &lt;code&gt;isPrepaid&lt;/code&gt;, we can abandon logic in JSP:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="jsp"&gt;&amp;lt;c:if test="${account.inDebt}"&gt;&lt;br /&gt; &amp;lt;span style="color: red;"&gt;Please pay tour debt!&amp;lt;/span&gt;&lt;br /&gt;&amp;lt;/c:if&gt;&lt;br /&gt;&amp;lt;c:if test="${account.prepaid}"&gt;&lt;br /&gt;  &amp;lt;span style="color: green;"&gt;Advanced payment&amp;lt;/span&gt;&lt;br /&gt;&amp;lt;/c:if&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Is it better? I believe it is. This is &lt;i&gt;encapsulation&lt;/i&gt; - hiding the implementation of logic from outer code. Class Amount is the only in the whole world who knows how to define, if client is in debt or has advanced payment. Other code doesn't ever know how it happens - it can get resulting boolean throught methods &lt;code&gt;isInDebt&lt;/code&gt; and &lt;code&gt;isPrepaid&lt;/code&gt;. Theoretically "in debt" and "advanced payment" information could be stored in different columns, or event different tables, or even different databases. Nobody knows. Thanks to two methods, this logic is encapsulated in class &lt;code&gt;Account&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;If you still don't believe, compare code size:&lt;br /&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&lt;br /&gt;Before&lt;br /&gt;&lt;pre name="code" class="jsp"&gt;&amp;lt;%-- Positive amount means that account is in debt %--&gt;&lt;br /&gt;&amp;lt;c:if test="${account.amount &amp;gt; 0}"&gt;&lt;br /&gt;  &amp;lt;span style="color: red;"&gt;Please pay your debt!&amp;lt;/span&gt;&lt;br /&gt;&amp;lt;/c:if&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="140"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td&gt;&lt;br /&gt;After&lt;br /&gt;&lt;pre name="code" class="jsp"&gt;&amp;lt;c:if test="${account.inDebt}"&gt;&lt;br /&gt;  &amp;lt;span style="color: red;"&gt;Please pay your debt!&amp;lt;/span&gt;&lt;br /&gt;&amp;lt;/c:if&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;You can go further and create two different methods &lt;code&gt;getPrepaidAmount()&lt;/code&gt; и &lt;code&gt;getDebt()&lt;/code&gt; instead of method &lt;code&gt;getAmount()&lt;/code&gt;. Additionally they can check, if the client has really debt or advanced payment. As a result, it's impossible now to write a code like this one:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&amp;lt;%-- No matter if you have advanced payment, &lt;br /&gt;I still think that you are in debt! %&gt;&lt;br /&gt;&amp;lt;c:if test="${account.amount != 0}"&gt;&lt;br /&gt;  &amp;lt;font color="red"&gt;Please pay your debt!&amp;lt;/font&gt;&lt;br /&gt;&amp;lt;/c:if&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ideally, method &lt;code&gt;getAmount()&lt;/code&gt; should be removed. This would be the real &lt;i&gt;encapsulation&lt;/i&gt;: hiding of data and code and making them available only throught API. I think I would remove all of 20 other getters/setters if internet connection wouldn't get back to our office that day.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Moral&lt;/h3&gt;As You see, unit-tests lead you to readable, object-oriented code. Are you still thinking that your code doesn't contain logic? Are you still thinking that you code has nothing to test? &lt;br /&gt;&lt;br /&gt;Of course it has!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-5059207877746214148?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/5059207877746214148/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=5059207877746214148' title='Комментарии: 3'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/5059207877746214148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/5059207877746214148'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2011/03/wtf-is-business-logic.html' title='WTF is business logic?'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-4292105142663192661</id><published>2010-05-13T14:17:00.000-07:00</published><updated>2010-07-10T03:01:41.356-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java tips'/><category scheme='http://www.blogger.com/atom/ns#' term='devil'/><title type='text'>Why the devil invented javadoc?</title><content type='html'>It is believed that a good program should be well documented.&lt;br /&gt;&lt;br /&gt;SUN company even creared a special format &lt;a href="http://ru.wikipedia.org/wiki/Javadoc"&gt;&lt;i&gt;javadoc&lt;/i&gt;&lt;/a&gt; - "a standard for documenting classes Java". In fact, it was quite a common case in my experience, when a code did not pass Code Review just because some of its methods lacked comments.&lt;br /&gt;&lt;br /&gt;Today I'll tell you why the comments are evil.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Start from example&lt;/h2&gt;&lt;br /&gt;Consider the real example from live code. This is a real code written quite diligent programmer who was not lazy and wrote a commentary on his method. Pleased with himself, he went to pour himself a cup of coffee from the machine. While he is going to the office kitchen, let's take a look at what we have here.&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid lightgray; width: 95%; margin-left: 5px; margin-right: 5px; background-color: rgb(238, 238, 238); padding: 2px;"&gt;&lt;pre&gt;public class AddressUtil {&lt;br /&gt;/**&lt;br /&gt;&lt;span style="color:red;"&gt;    * Format string as address&lt;/span&gt;, &lt;span style="color:blue;"&gt;expected input&lt;br /&gt;* format:"EE ; ;Tallinn;Narva mnt;120B;831;10127"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;    *&lt;br /&gt;* @param flatAddress&lt;br /&gt;* @return Formatted address&lt;/span&gt;&lt;br /&gt;*/&lt;br /&gt;public static String toString(String flatAddress) {......}&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Excellent! We have a correctly designed a format javadoc, from which a special program can generate HTML-documentation. As it is easy to see that (theoretically) makes this method.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Where is the hidden devil?&lt;/h2&gt;&lt;br /&gt;But where are those little things that hid the devil? And here they are:&lt;br /&gt;&lt;ol type="square"&gt;&lt;br /&gt;&lt;li&gt;Very soon this documentation &lt;b&gt;becomes outdated&lt;/b&gt;, because some other developer will come and change the code, but forget to change the documentation. It may even be the same developer, because while he was standing in line for coffee, it occurred to him that he forgot to process one rare case. When he comes back, he adds the desired IF into the code, but forgets that he already has javadoc, which &lt;i&gt;must be maintained&lt;/i&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;This documentation &lt;b&gt;does not describe&lt;/b&gt; the mass of cases: how the method behaves, if the input comes null or empty string? What if address contains house number, but misses apartment number (ie bourgeois took home a whole)? What's that empty parameter between the "EE" and "Tallinn"?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Documentation doesn't describe what this method &lt;b&gt;returns&lt;/b&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There are three &lt;b&gt;extra lines&lt;/b&gt; in the documentation: "&lt;tt&gt;*&lt;/tt&gt;", "&lt;tt&gt;@ param flatAddress&lt;/tt&gt;" and "&lt;tt&gt;@ return Formatted address&lt;/tt&gt;". Just think: they occupy a large part of the documentation, and they are absolutely useless!&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;It can be summarized in two words: "&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;i&gt;Comments lies&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;"! That's all. You cannot do anything with this, except the cases when you have a special position for people how review all the documentation periodically. Damn, do you really want to do that?&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The Magic&lt;/h2&gt;&lt;br /&gt;Now let's do a focus-pocus and create &lt;i&gt;The Magic&lt;/i&gt;. We make a few magical passes. Sim salyabim, Ahalan-mahalay, Lyaska-masyaski ....&lt;br /&gt;&lt;br /&gt;&lt;ol type="number"&gt;&lt;br /&gt;&lt;li&gt;Pass # 1: Everything that is written &lt;span style="color:red;"&gt;in red&lt;/span&gt;, we turn to the name of the method: &lt;tt&gt;toString&lt;/tt&gt; -&gt; &lt;tt&gt;formatAddress&lt;/tt&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Pass # 2: Everything that is written &lt;span style="color:blue;"&gt;in blue&lt;/span&gt;, transfer to unit-test.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Pass # 3: (my favorite) The text, written in green, wipe fuckin. Do not spare him, he was born in vain!&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;What we did in the end?&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid lightgray; width: 95%; margin-left: 5px; margin-right: 5px; background-color: rgb(238, 238, 238); padding: 2px;"&gt;&lt;pre&gt;public class AddressUtil {&lt;br /&gt;public static String &lt;span style="color:red;"&gt;formatAddress&lt;/span&gt;(String flatAddress) {......}&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;  @Test public void testFormatAddress() {&lt;br /&gt;assertEquals("Narva mnt 120B-831  10127 Tallinn",&lt;br /&gt;AddressUtil.formatAddress(&lt;br /&gt;        "EE ; ;Tallinn;Narva mnt;120B;831;10127"));&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;What the new version better than the old?&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;It's just &lt;b&gt;shorter&lt;/b&gt;: there are now 4 rows compared to former 8.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;This test will &lt;b&gt;never becomes obsolete&lt;/b&gt;, because it will run automatically every time you build the project, and if the programmer change the code, and forget about the method, it immediately pops up.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You can describe &lt;b&gt;all the rare cases&lt;/b&gt;: the empty string, missing keys, invalid values, etc.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;In short,&lt;br /&gt;&lt;span style=";font-family:Georgia;color:blue;"&gt;&lt;center&gt;GOOD TITLE + TESTS = DOCUMENTATION&lt;/center&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;rather, &lt;i&gt;executable documentation&lt;/i&gt;, or documentation that can not only read but also "run", automatically checking that it is still adequate.&lt;br /&gt;&lt;br /&gt;It is said that Confucius was a poster over the bed:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Georgia;"&gt;&lt;center&gt;&lt;i&gt;Convert comments to executable documentation&lt;/i&gt;&lt;/center&gt;&lt;/span&gt;&lt;br /&gt;&lt;img src="http://www.logoi.com/pastimages/img/confucius_5.jpg" align="right" width="150" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Afterword&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I'm just afraid that our brave programmer, returning from the kitchen, will not understand the focus, because he had not seen our magical movements. He will get mad only because SOMEONE Nagle has deleted his comments, and he will try to find us and kill for such subversive activities.&lt;br /&gt;&lt;br /&gt;... And his coffee gets cool in the meantime. Well, no so bad: after all, coffee, they say, is harmful. So, we did today did one good thing.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://womanka.ru/wp-content/uploads/2009/11/coffee.jpg" align="right" width="200" /&gt;&lt;br /&gt;&lt;br /&gt;Andrei Solntsev&lt;br /&gt;&lt;br /&gt;&lt;a href="http://funny-java.blogspot.com/"&gt;http://funny-java.blogspot.com/&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;PS. Well, I must admit the documentation is still needed in some cases, for example, when you writing public API, which other people will download and use. This API is hardly going to be changed, so it's possible to maintain the documentation. But you must remember that documentation is not just comments in code - this is a part of you product, which requires resources for creation and maintenance. Tule of thumb: prefer NOT to writing comments. Write them only if it's really unavoidable.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-4292105142663192661?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/4292105142663192661/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=4292105142663192661' title='Комментарии: 3'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/4292105142663192661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/4292105142663192661'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2010/05/why-devil-invented-javadoc.html' title='Why the devil invented javadoc?'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-1339034192325650339</id><published>2010-01-19T07:20:00.001-08:00</published><updated>2010-05-16T14:20:40.051-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java tips'/><title type='text'>Java memory analysis</title><content type='html'>As a reminder for myself, two articles about analyzing Java memory:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://schneide.wordpress.com/2008/11/03/analyzing-java-heap-problems-part-1-basic-actions-and-tools/"&gt;http://schneide.wordpress.com/2008/11/03/analyzing-java-heap-problems-part-1-basic-actions-and-tools/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://schneide.wordpress.com/2008/12/29/analyzing-java-heap-problems-part-2-using-eclipse-mat/"&gt;http://schneide.wordpress.com/2008/12/29/analyzing-java-heap-problems-part-2-using-eclipse-mat/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-1339034192325650339?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/1339034192325650339/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=1339034192325650339' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/1339034192325650339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/1339034192325650339'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2010/01/java-memory-analysis.html' title='Java memory analysis'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-485004312991980798</id><published>2009-12-23T02:09:00.000-08:00</published><updated>2010-05-16T14:21:01.764-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java tips'/><category scheme='http://www.blogger.com/atom/ns#' term='DevClub'/><title type='text'>HireBug</title><content type='html'>On the last &lt;a href="http://www.devclub.eu/2009/12/23/%D0%BF%D0%BE%D0%B4%D0%B2%D0%BE%D0%B4%D1%8F-%D0%B8%D1%82%D0%BE%D0%B3%D0%B8-devclub-221209/"&gt;DevClub&lt;/a&gt; meeting I presented a HireBug - a "server-side Firebug".&lt;br /&gt;&lt;br /&gt;This is presentation in russian:&lt;br /&gt;http://www.slideshare.net/asolntsev/hire-bug&lt;br /&gt;&lt;br /&gt;Update: presentation video (also in russian):&lt;br /&gt;http://www.devclub.eu/2009/12/29/andrei-slontsev-hirebug/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-485004312991980798?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/485004312991980798/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=485004312991980798' title='Комментарии: 3'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/485004312991980798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/485004312991980798'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2009/12/hirebug.html' title='HireBug'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-1342906125818077866</id><published>2009-11-27T04:44:00.000-08:00</published><updated>2010-05-16T14:21:26.553-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><category scheme='http://www.blogger.com/atom/ns#' term='Vaadin'/><title type='text'>Vaadin demo with Maven</title><content type='html'>I like Vaadin - Java web framework created by Finnish guys from &lt;a href="http://www.itmill.com/"&gt;ITMill&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Vaadin homepage: &lt;a href="http://vaadin.com/"&gt;http://vaadin.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is demo web application built with Vaadin+Maven which performs search files on server.&lt;br /&gt;It was really easy to create it!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_KH5QVrOFzeM/Sw_LO_LraWI/AAAAAAAABqw/4wwodqLtcB4/s1600/VaadinDemoEclipseProject.jpg"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 232px; height: 221px;" src="http://4.bp.blogspot.com/_KH5QVrOFzeM/Sw_LO_LraWI/AAAAAAAABqw/4wwodqLtcB4/s320/VaadinDemoEclipseProject.jpg" alt="" id="BLOGGER_PHOTO_ID_5408765135834278242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;All you need is to include Vaadin depenency to your pom.xml and create class that extends com.vaadin.Application. No any XMLs, jsp etc.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Full source code:&lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/2856647/vaadin-demo-webapp.zip"&gt;http://dl.dropbox.com/u/2856647/vaadin-demo-webapp.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Screencast:&lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/2856647/VaadinDemo.swf"&gt;http://dl.dropbox.com/u/2856647/VaadinDemo.swf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Short overview of Vaadin: &lt;a href="http://www.streamhead.com/vaadin-promote-great-gwt-toolkit/"&gt;http://www.streamhead.com/vaadin-promote-great-gwt-toolkit/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-1342906125818077866?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/1342906125818077866/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=1342906125818077866' title='Комментарии: 1'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/1342906125818077866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/1342906125818077866'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2009/11/vaadin-demo.html' title='Vaadin demo with Maven'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_KH5QVrOFzeM/Sw_LO_LraWI/AAAAAAAABqw/4wwodqLtcB4/s72-c/VaadinDemoEclipseProject.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-6240991522554476576</id><published>2009-11-26T14:40:00.000-08:00</published><updated>2010-05-16T14:24:26.739-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Jetty'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Development tools'/><title type='text'>Jetty Runner</title><content type='html'>&lt;span style="font-weight: bold;"&gt;What is JettyRunner?&lt;/span&gt;&lt;br /&gt;Jetty Runner is an Eclipse plugin that allows developer to easy run web applications from your projects.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How it works&lt;/span&gt;&lt;br /&gt;- Scan all projects in workspace&lt;br /&gt;- Detect web applications projects&lt;br /&gt;- Let user choose web applications to run&lt;br /&gt;- Let user choose the database to connect to&lt;br /&gt;- Run Jetty&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Presentation&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.slideshare.net/asolntsev/eclipse-jetty-runner"&gt;http://www.slideshare.net/asolntsev/eclipse-jetty-runner&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Screencast&lt;/span&gt;&lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/2856647/JettyRunnerDemo.swf"&gt;http://dl.dropbox.com/u/2856647/JettyRunnerDemo.swf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Installation&lt;/span&gt;&lt;br /&gt;Write me in comments if you are interested. Then I will publish the sources/binaries.&lt;br /&gt;&lt;br /&gt;PS. This plugin was presented at &lt;a href="http://wiki.eclipse.org/Eclipse_DemoCamps_November_2009/Tallinn"&gt;Eclipse DemoCamp&lt;/a&gt; in Tallinn 27.11.2009&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-6240991522554476576?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/6240991522554476576/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=6240991522554476576' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/6240991522554476576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/6240991522554476576'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2009/11/jetty-runner.html' title='Jetty Runner'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-3971982482648841414</id><published>2009-05-20T15:47:00.000-07:00</published><updated>2010-05-16T14:22:10.933-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java tips'/><title type='text'>ThreadSafeDateFormat</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem&lt;/span&gt;&lt;br /&gt;As known, Java class SimpleDateFormat is not Thread-safe.&lt;br /&gt;It means that you cannot declare a static member DateFormat in class:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;private static final DateFormat DATE_FORMAT = new SimpleDateFormat( DATE_PATTERN );&lt;span style="color:red;"&gt; // WRONG!&lt;/span&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Using this member by 2 concurrent treads will lead to error.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is a solution?&lt;/span&gt;&lt;br /&gt;One solution is to create new SimpleDateFormat( DATE_PATTERN ) each time you need to parse a date. Another solution is to create a Thread-safe version of DateFormat.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;That's it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.lang.ref.SoftReference;&lt;br /&gt;import java.text.DateFormat;&lt;br /&gt;import java.text.FieldPosition;&lt;br /&gt;import java.text.ParsePosition;&lt;br /&gt;import java.text.SimpleDateFormat;&lt;br /&gt;import java.util.Date;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Thread-safe version of java.text.DateFormat.&lt;br /&gt;* You can declare it as a static final variable:&lt;br /&gt;*&lt;br /&gt;* private static final ThreadSafeDateFormat&lt;br /&gt;*   DATE_FORMAT = new ThreadSafeDateFormat( DATE_PATTERN );&lt;br /&gt;*/&lt;br /&gt;public class &lt;b&gt;ThreadSafeDateFormat&lt;/b&gt; extends DateFormat&lt;br /&gt;{&lt;br /&gt;private static final long serialVersionUID = 3786090697869963812L;&lt;br /&gt;&lt;br /&gt;private final String m_sDateFormat;&lt;br /&gt;&lt;br /&gt;public ThreadSafeDateFormat(String sDateFormat)&lt;br /&gt;{&lt;br /&gt;    m_sDateFormat = sDateFormat;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private final ThreadLocal &lt;b&gt;m_formatCache&lt;/b&gt; = new ThreadLocal()&lt;br /&gt;{&lt;br /&gt;  public Object get()&lt;br /&gt;  {&lt;br /&gt;    SoftReference softRef = (SoftReference) super.get();&lt;br /&gt;    if (softRef == null || softRef.get() == null)&lt;br /&gt;    {&lt;br /&gt;      softRef = new SoftReference(&lt;br /&gt;        new SimpleDateFormat(m_sDateFormat) );&lt;br /&gt;&lt;br /&gt;      super.set(softRef);&lt;br /&gt;    }&lt;br /&gt;    return softRef;&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;private DateFormat &lt;b&gt;getDateFormat()&lt;/b&gt;&lt;br /&gt;{&lt;br /&gt;  return (DateFormat) (&lt;br /&gt;    (SoftReference)m_formatCache.get()).get();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public StringBuffer &lt;b&gt;format&lt;/b&gt;(Date date,&lt;br /&gt;  StringBuffer toAppendTo, FieldPosition fieldPosition)&lt;br /&gt;{&lt;br /&gt;  return getDateFormat().format(&lt;br /&gt;    date, toAppendTo, fieldPosition);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Date &lt;b&gt;parse&lt;/b&gt;(String source, ParsePosition pos)&lt;br /&gt;{&lt;br /&gt;  return getDateFormat().parse(source, pos);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The main idea of this class is storing separate instances of SimpleDateFormat for separate Threads in ThreadLocal variable. If 2 concurrent threads try to parse date, the will use 2 different instances of SimpleDateFormat.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-3971982482648841414?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/3971982482648841414/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=3971982482648841414' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/3971982482648841414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/3971982482648841414'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2009/05/threadsafedateformat.html' title='ThreadSafeDateFormat'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-5231451343496308748</id><published>2009-03-14T04:35:00.000-07:00</published><updated>2010-05-16T14:25:57.277-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java tips'/><title type='text'>Functional Programming in Java</title><content type='html'>This is my seminar about Functional Programming and using its ideas in Java.&lt;br /&gt;&lt;br /&gt;It was done in year 2006.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.slideshare.net/asolntsev/functional-programming-in-java"&gt;http://www.slideshare.net/asolntsev/functional-programming-in-java&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-5231451343496308748?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/5231451343496308748/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=5231451343496308748' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/5231451343496308748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/5231451343496308748'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2009/03/functional-programming-in-java.html' title='Functional Programming in Java'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-7555982645759037196</id><published>2008-08-10T23:22:00.000-07:00</published><updated>2010-05-17T16:28:30.062-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>proxy-scm sources</title><content type='html'>As some people ask, I publish my sources of maven-scm which include &lt;a href="http://asolntsev.blogspot.com/2008/02/extending-maven-scm-proxy-scm.html"&gt;proxy-scm feature&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You can either build it from sources, or upload binaries to your company/local repository.&lt;br /&gt;&lt;br /&gt;Sources (downloaded from apache source repository and modified):&lt;br /&gt;&lt;a href="http://andrei.solntsev.googlepages.com/maven-scm-1.1.Internal-sources.zip"&gt;http://andrei.solntsev.googlepages.com/maven-scm-1.1.Internal-sources.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Binaries (built with JDK 1.5, compatible with JDK 1.4):&lt;br /&gt;&lt;a href="http://andrei.solntsev.googlepages.com/maven-scm-1.1.Internal-binaries.zip"&gt;http://andrei.solntsev.googlepages.com/maven-scm-1.1.Internal-binaries.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you build  from sources, you need to change &lt;distributionmanagement&gt; section in pom.xml files.&lt;br /&gt;&lt;br /&gt;To start using this modified version of maven-scm plugin, you need to write it into your pom.xml's "pluginManagement" section:&lt;br /&gt;&lt;/distributionmanagement&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;pluginManagement&gt;&lt;br /&gt;&amp;lt;plugins&gt;&lt;br /&gt;  &amp;lt;plugin&gt;&lt;br /&gt;      &amp;lt;groupId&gt;org.apache.maven.plugins&amp;lt;/groupId&gt;&lt;br /&gt;      &amp;lt;artifactId&gt;maven-scm-plugin&amp;lt;/artifactId&gt;&lt;br /&gt;      &amp;lt;version&gt;1.1.INTERNAL-SNAPSHOT&amp;lt;/version&gt;&lt;br /&gt;    &amp;lt;/plugin&gt;&lt;br /&gt; &amp;lt;/plugins&gt;&lt;br /&gt;&amp;lt;/pluginManagement&gt;&lt;distributionmanagement&gt;&lt;br /&gt;&lt;/distributionmanagement&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-7555982645759037196?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/7555982645759037196/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=7555982645759037196' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/7555982645759037196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/7555982645759037196'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2008/08/proxy-scm-sources.html' title='proxy-scm sources'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-9201137742784709558</id><published>2008-03-05T00:30:00.000-08:00</published><updated>2010-05-16T14:22:44.860-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java tips'/><title type='text'>How to find which jar file contains your class at 'runtime'</title><content type='html'>It's often happening when you want to get know where JVM takes some class from.&lt;br /&gt;If this class potentially can be located in several folders/jars, you never know which one of them JVM uses.&lt;br /&gt;&lt;br /&gt;There is a simple method allowing this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/**&lt;br /&gt;* Method returns code source of given class.&lt;br /&gt;* This is URL of classpath folder, zip or jar file.&lt;br /&gt;* If code source is unknown, returns null (for example, for classes java.io.*).&lt;br /&gt;*&lt;br /&gt;* @param clazz    For example, &lt;code&gt;java.sql.SQLException.class&lt;/code&gt;&lt;br /&gt;* @return for example, &lt;code&gt;"file:/C:/jdev10/jdev/mywork/classes/"&lt;/code&gt;&lt;br /&gt;*                             or &lt;code&gt;"file:/C:/works/projects/classes12.zip"&lt;/code&gt;&lt;br /&gt;*/&lt;br /&gt;public static String getCodeSource(Class clazz)&lt;br /&gt;{&lt;br /&gt;if (clazz == null ||&lt;br /&gt;    clazz.getProtectionDomain() == null ||&lt;br /&gt;    clazz.getProtectionDomain().getCodeSource() == null ||&lt;br /&gt;    clazz.getProtectionDomain().getCodeSource().getLocation() == null)&lt;br /&gt;&lt;br /&gt;   // This typically happens for system classloader&lt;br /&gt;   // (java.lang.* etc. classes)&lt;br /&gt;   return null;&lt;br /&gt;&lt;br /&gt;return clazz.getProtectionDomain()&lt;br /&gt;         .getCodeSource().getLocation().toString();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-9201137742784709558?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/9201137742784709558/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=9201137742784709558' title='Комментарии: 1'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/9201137742784709558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/9201137742784709558'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2008/03/how-to-find-which-jar-file-contains.html' title='How to find which jar file contains your class at &apos;runtime&apos;'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-7520578017130859080</id><published>2008-02-09T14:06:00.001-08:00</published><updated>2010-05-16T14:23:04.612-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Extending Maven SCM: proxy-scm</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;Problem description&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Maven is a great tool, but it has one constraint that makes it inapplicable in many cases.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;It can checkout the whole project (pom.xml and sources) from a single place in SCM storage using a single tag.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;It's quite suitable in open-source projects, where new versions of projects don't appear too often.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;But in our company we have a lot of components, each of which is stored in its own place in SCM and tagged with its own tag. To make using Maven possible, we need to create either BASH or ANT script which would check out all required projects from SCM.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;This is the concern: &lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;font-family:arial;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div  style="text-align: center;font-family:arial;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;why do I need Maven if i still need ANT for running it&lt;/span&gt;?&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family:arial;"&gt;If only Maven could do it by itself...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;After thinking a while, we have created a solution.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;Solution&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;As known, Maven SCM plugin has several SCM providers: CVS, Subversion, ClearCase etc.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Idea is to create one more provider, &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;Proxy SCM&lt;/span&gt;&lt;span style="font-family:arial;"&gt;. Its main goal is to checkout different modules from different places calling other SCM providers.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;We need to extend pom.xml with 2 attributes:&lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: courier new;"&gt;&lt;li&gt;/project/modules/module@scmProvider&lt;/li&gt;&lt;li&gt;/project/modules/module@scmHost&lt;/li&gt;&lt;li&gt;/project/modules/module@path&lt;/li&gt;&lt;li&gt;/project/modules/module@tag&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Given pom.xml of form:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;project&gt;&lt;br /&gt;&amp;lt;scm&gt;&lt;br /&gt;&amp;lt;connection&gt;scm:proxyscm:cvs:pserver:@myhost:dir:nodule&amp;lt;/connection&gt;&lt;br /&gt;&amp;lt;developerConnection&gt;scm:proxyscm:cvs:pserver:bla-bla&amp;lt;/developerConnection&gt;&lt;br /&gt;&amp;lt;/scm&gt;&lt;br /&gt;&amp;lt;modules&gt;&lt;br /&gt;  &amp;lt;module &lt;span style="color: rgb(0, 153, 0);"&gt;path="robots/terminator/sdk"&lt;/span&gt;&gt;terminator_sdk&amp;lt;/module&gt;&lt;br /&gt;  &amp;lt;module &lt;span style="color: rgb(0, 153, 0);"&gt;path="robots/terminator/ui"&lt;/span&gt; tag="terminator_ui_v1-2"&gt;terminator_ui&amp;lt;/module&gt;&lt;br /&gt;  &amp;lt;module &lt;span style="color: rgb(0, 0, 153);"&gt;scmProvider&lt;/span&gt;="svn" &lt;span style="color: rgb(0, 0, 153);"&gt;scmHost&lt;/span&gt;="http://svn.apache.org/repos/asf/commons/proper/launcher" &lt;span style="color: rgb(0, 153, 0);"&gt;path="trunk"&lt;/span&gt;&gt;commons_launcher&amp;lt;/module&gt;&lt;br /&gt;&amp;lt;/modules&gt;&lt;br /&gt;&amp;lt;/project&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The proxy-scm provider checks out all the 3 projects into 3 subfolders in current folder, resulting in the following content:&lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: arial;"&gt;&lt;li&gt;pom.xml&lt;/li&gt;&lt;li&gt;terminator_sdk&lt;/li&gt;&lt;li&gt;        pom.xml&lt;/li&gt;&lt;li&gt;        src&lt;/li&gt;&lt;li&gt;terminator_ui&lt;/li&gt;&lt;li&gt;        pom.xml&lt;/li&gt;&lt;li&gt;        src&lt;/li&gt;&lt;li&gt;commons_launcher&lt;/li&gt;&lt;li&gt;        pom.xml&lt;/li&gt;&lt;li&gt;        src&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;Implementation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The code of proxy-scm provider is quite simple: it just needs to parse file "pom.xml" and call appropriate SCM provider for every module.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I would like to commit this code into the next Maven SCM version (1.1). But it seems those guys don't respond to JRA issues neither commit patches into new version :(&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-7520578017130859080?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/7520578017130859080/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=7520578017130859080' title='Комментарии: 12'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/7520578017130859080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/7520578017130859080'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2008/02/extending-maven-scm-proxy-scm.html' title='Extending Maven SCM: proxy-scm'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5830860775515675394.post-7936182852804980882</id><published>2008-02-08T00:10:00.000-08:00</published><updated>2010-05-16T14:23:20.229-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java tips'/><title type='text'>Null-Initialization in Java</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;In many languages (C++), uninitialized variables lead to errors. So, it's considered to be a good style to initialize every variable with &lt;span style="font-style: italic; font-weight: bold;"&gt;0&lt;/span&gt; or &lt;span style="font-style: italic; font-weight: bold;"&gt;null&lt;/span&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;however, in Java it's quite the opposite.&lt;br /&gt;Initialization with &lt;b&gt;&lt;i&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;null&lt;/span&gt;&lt;/i&gt;&lt;/b&gt; is not  recommended for those class members that &lt;b&gt;&lt;u&gt;&lt;span style="font-weight: bold;"&gt;should not&lt;/span&gt;&lt;/u&gt;&lt;/b&gt; be  null.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;Instead, it's recommended to declare those members &lt;span style="font-weight: bold; font-style: italic;"&gt;final&lt;/span&gt; and initialize only once with an adequate value.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;See example  below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;h3&gt;&lt;b&gt;&lt;span style=";font-family:Arial;font-size:130%;color:red;"   &gt;&lt;span style=";font-size:13pt;color:red;"   lang="EN-US"&gt;Bad  practice:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt; &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"   &gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; &lt;span style="background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; -moz-background-size: auto auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;color:silver;" &gt;CCollectorTarget&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectTrg&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorSchema &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectSchm&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorProject &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectPrj&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorFiles &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectFiles&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorData(  &lt;span style="background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; -moz-background-size: auto auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;color:silver;" &gt;CCollectorTarget&lt;/span&gt;  collectTrg,&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;                   CCollectorSchema collectSchm,&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;                   CCollectorProject collectPrj,&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;                   CCollectorFiles collectFiles ) &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       {&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectSchm&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  collectSchm;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectTrg&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  collectTrg;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectPrj&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  collectPrj;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"  &gt;m_collectFiles&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"   &gt; =  collectFiles;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"   &gt;       }&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;h3&gt;&lt;b&gt;&lt;span style=";font-family:Arial;font-size:130%;color:green;"   &gt;&lt;span style=";font-size:13pt;color:green;"   lang="EN-US"&gt;Good  practice:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;     &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"   &gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;final&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorTarget &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectTrg&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;final&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorSchema &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectSchm&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;final&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorProject &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectPrj&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;final&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorFiles &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="background-color: silver; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; -moz-background-size: auto auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectFiles&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;"  &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(127, 0, 85);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(127, 0, 85);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;  CCollectorData(  CCollectorTarget collectTrg,&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;                   CCollectorSchema collectSchm,&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;                   CCollectorProject collectPrj,&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;                   CCollectorFiles collectFiles )&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       {&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectSchm&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  collectSchm;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectTrg&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  collectTrg;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectPrj&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  collectPrj;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 192);font-family:Courier New;font-size:85%;"  &gt;&lt;span style="background-color: silver; background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; -moz-background-size: auto auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 192);font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;m_collectFiles&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt; =  collectFiles;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:black;"   &gt;&lt;span style=";font-family:'Courier New';font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:'Courier New';font-size:10pt;color:black;"    lang="EN-US"&gt;       }&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;This technique has additional  advantages: java compiler detects cases when you &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;ol style="margin-top: 0in;" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;forget to  initialize variable, or &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style=";font-family:Arial;font-size:10pt;"   lang="EN-US"&gt;try to  initialize it more than once.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5830860775515675394-7936182852804980882?l=asolntsev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://asolntsev.blogspot.com/feeds/7936182852804980882/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5830860775515675394&amp;postID=7936182852804980882' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/7936182852804980882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5830860775515675394/posts/default/7936182852804980882'/><link rel='alternate' type='text/html' href='http://asolntsev.blogspot.com/2008/02/null-initialization-in-java.html' title='Null-Initialization in Java'/><author><name>asolntsev</name><uri>http://www.blogger.com/profile/16632087166612261207</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_KH5QVrOFzeM/R6wTJvp8TkI/AAAAAAAAAfk/8pQI3aFpLew/S220/grease_msn.JPG'/></author><thr:total>0</thr:total></entry></feed>
