<?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:blogger='http://schemas.google.com/blogger/2008' 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-6745498797965913516</id><updated>2024-09-04T19:48:23.258-07:00</updated><title type='text'>Things in Java Developer&#39;s Life</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javaatwork.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6745498797965913516/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://javaatwork.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ashutosh</name><uri>http://www.blogger.com/profile/13099288373508604808</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8gCCxQSCDiJHBBzbsHhaFZuAviHYhQlIupueCaZgIzQuvikqk_EEAGXq39_6fRPqHuTYzG0ggNCj-foC5C6Fga3EFO1d_c-Z-1pVmYoa56EMhIiB-lDT2ce7_-RcVNA/s220/DSC012171.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6745498797965913516.post-5297114065302210084</id><published>2012-05-31T09:04:00.000-07:00</published><updated>2012-05-31T09:36:54.749-07:00</updated><title type='text'>Log4j 1.2.15 Maven Dependency Problem And Solution</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Look inside the blog&lt;br /&gt;
by Peter :&amp;nbsp;&lt;a href=&quot;http://unitstep.net/blog/2009/05/18/resolving-log4j-1215-dependency-problems-in-maven-using-exclusions/&quot;&gt;Log4j 1.2.15 Maven Dependency Problem&lt;/a&gt;&amp;nbsp; &amp;lt;&amp;lt; exclude unwanted dependencies&amp;gt;&lt;br /&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
by&amp;nbsp;&lt;span style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: -webkit-auto;&quot;&gt;Simon&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 20px;&quot;&gt;&amp;nbsp;:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://onemanwenttomow.wordpress.com/2007/12/31/maven2-log4j-and-jmx-dependencies/&quot; style=&quot;font-size: 12px; line-height: 20px;&quot;&gt;Log4j 1.2.15 Maven Dependency Problem&lt;/a&gt;&lt;span style=&quot;font-size: 12px; line-height: 20px;&quot;&gt;&amp;nbsp;&amp;lt;&amp;lt; manual&amp;nbsp;registration of required jars into maven repository &amp;gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaatwork.blogspot.com/feeds/5297114065302210084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaatwork.blogspot.com/2012/05/log4j-1215-maven-dependency-problem-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6745498797965913516/posts/default/5297114065302210084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6745498797965913516/posts/default/5297114065302210084'/><link rel='alternate' type='text/html' href='http://javaatwork.blogspot.com/2012/05/log4j-1215-maven-dependency-problem-and.html' title='Log4j 1.2.15 Maven Dependency Problem And Solution'/><author><name>Ashutosh</name><uri>http://www.blogger.com/profile/13099288373508604808</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8gCCxQSCDiJHBBzbsHhaFZuAviHYhQlIupueCaZgIzQuvikqk_EEAGXq39_6fRPqHuTYzG0ggNCj-foC5C6Fga3EFO1d_c-Z-1pVmYoa56EMhIiB-lDT2ce7_-RcVNA/s220/DSC012171.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6745498797965913516.post-1705216201200518962</id><published>2010-05-22T04:00:00.001-07:00</published><updated>2010-05-22T05:18:34.559-07:00</updated><title type='text'>Comparing Java Enums</title><content type='html'>Well it was seeming just another day in Office when a piece of checked in code caught my attention. It led to a constructive debate in the team and eventually we arrived at the conclusion as mentioned below.&lt;br /&gt;I had used .equals() to compare two Enums as we all know that Object.equals() internally uses == operator two compare two references and for Enums which is true as two equal enums will always point to the same memory location as they are singleton in nature. I considered .equals() a comfortable and a standard way of comparing two Objects which could also be applied to Enums as well.&lt;br /&gt;Here comes the different side of the story.The argument was Enums are basically constants and the convention is we should use == to compare constants. Since it didn&#39;t seem to be very convincing to me as object .equals() does the same thing and enum is not a primitive datatype like int etc, I decided to google on it.&lt;br /&gt;&lt;br /&gt;It came out that using == over .equals() is more advantageous in two ways:&lt;br /&gt;&lt;br /&gt;a) It gives you a compile time advantage. How? See below .&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://schneide.files.wordpress.com/2008/09/enum_comparison.png&quot;&gt;&lt;img style=&quot;float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 397px; height: 211px;&quot; src=&quot;http://schneide.files.wordpress.com/2008/09/enum_comparison.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Comparing the &lt;code&gt;EState&lt;/code&gt; enum with an &lt;code&gt;ILamp&lt;/code&gt;  using equals() is accepted perfectly by the compiler even though the  condition never can be true in practice. Using &lt;code&gt;==&lt;/code&gt; the  compiler screams and tells us that we are comparing apples with oranges.&lt;br /&gt;&lt;br /&gt;b)One can avoid the accidental and unwanted null pointer exceptions using == operator over .equals() making it null safe.&lt;br /&gt;&lt;br /&gt;Though the second problem can be avoided, the first one seems to be a cool advantage during development&lt;br /&gt;&lt;br /&gt;The interesting articles that i came across on this topic are below:&lt;br /&gt;&lt;a href=&quot;http://schneide.wordpress.com/2008/09/22/or-equals/&quot;&gt;http://schneide.wordpress.com/2008/09/22/or-equals/&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://stackoverflow.com/questions/1750435/comparing-java-enum-members-or-equals&quot;&gt;http://stackoverflow.com/questions/1750435/comparing-java-enum-members-or-equals&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaatwork.blogspot.com/feeds/1705216201200518962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javaatwork.blogspot.com/2010/05/comparing-java-enums.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6745498797965913516/posts/default/1705216201200518962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6745498797965913516/posts/default/1705216201200518962'/><link rel='alternate' type='text/html' href='http://javaatwork.blogspot.com/2010/05/comparing-java-enums.html' title='Comparing Java Enums'/><author><name>Ashutosh</name><uri>http://www.blogger.com/profile/13099288373508604808</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8gCCxQSCDiJHBBzbsHhaFZuAviHYhQlIupueCaZgIzQuvikqk_EEAGXq39_6fRPqHuTYzG0ggNCj-foC5C6Fga3EFO1d_c-Z-1pVmYoa56EMhIiB-lDT2ce7_-RcVNA/s220/DSC012171.JPG'/></author><thr:total>0</thr:total></entry></feed>