<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Mike`s Blog - Java</title>
    <link>http://www.mhaller.de/</link>
    <description>Keep it simple, stupid!</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Booting a JVM</title>
    <link>http://www.mhaller.de/archives/157-Booting-a-JVM.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/157-Booting-a-JVM.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=157</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=157</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/bytecode-interpreter.png&#039;&gt;&lt;!-- s9ymdb:175 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;110&quot; height=&quot;80&quot; style=&quot;float: left; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/bytecode-interpreter.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;I&#039;m right in the middle of implementing &lt;strong&gt;an interpreter for JVM bytecode&lt;/strong&gt;. Today was the first time the system printed out the magic &quot;Hello World!&quot; message.&lt;br /&gt;
&lt;br /&gt;
The interpreted boot time for running on a JDK 1.6 host (i&#039;m reusing their classes) is 4667ms. It takes 10ms to execute &lt;code&gt;System.out.printlnt(&quot;Hello World!&quot;);&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
Starting up the Virtual Machine and executing any class is pretty easy:&lt;br /&gt;
&lt;pre class=&quot;java&quot;&gt;
final VirtualMachine vm = new VirtualMachine();

final Classpath classpath = new Classpath();
classpath.addLoader(new HostVMResourceLoader()); // Re-uses JDK classes
classpath.addFolder(&quot;C:/Example/bin&quot;); // The HelloWorld project
vm.setClasspath(classpath);

vm.start();

vm.execute(&quot;org/example/HelloWorld&quot;);
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The output can be seen in the screenshot:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/bytecode-interpreter-output.png&#039;&gt;&lt;!-- s9ymdb:176 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;400&quot; height=&quot;200&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/bytecode-interpreter-output.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The following is an histogram of the bytecodes being executed, only to start up and initialize the JVM.&lt;br /&gt;
That includes booting up the System class, character sets, ThreadGroups, Reflection, NIO, and a lot of native methods which had to be replaced.&lt;br /&gt;
&lt;pre&gt;
[01] aconst_null                3398 invocations
[02] iconst_m1                    31 invocations
[03] iconst_0                  33689 invocations
[04] iconst_1                  11795 invocations
[05] iconst_2                    445 invocations
[06] iconst_3                    181 invocations
[07] iconst_4                    121 invocations
[08] iconst_5                     57 invocations
[09] lconst_0                     18 invocations
[0a] lconst_1                      3 invocations
[0b] fconst_0                     19 invocations
[10] bipush                    58215 invocations
[11] sipush                      222 invocations
[12] ldc                        1287 invocations
[13] ldc_w                       494 invocations
[14] ldc2_w                       15 invocations
[15] iload                    362633 invocations
[16] lload                         5 invocations
[19] aload                     81878 invocations
[1a] iload_0                  100335 invocations
[1b] iload_1                  236106 invocations
[1c] iload_2                    1208 invocations
[1d] iload_3                    1383 invocations
[1e] lload_0                       3 invocations
[1f] lload_1                       4 invocations
[20] lload_2                       6 invocations
[22] fload_0                      15 invocations
[24] fload_2                      52 invocations
[25] fload_3                      24 invocations
[26] dload_0                       1 invocations
[2a] aload_0                  306476 invocations
[2b] aload_1                   43405 invocations
[2c] aload_2                   25744 invocations
[2d] aload_3                   83195 invocations
[32] aaload                      794 invocations
[33] baload                        6 invocations
[34] caload                    78421 invocations
[36] istore                   161005 invocations
[37] lstore                        2 invocations
[3a] astore                    26685 invocations
[3b] istore_0                      2 invocations
[3c] istore_1                    907 invocations
[3d] istore_2                    121 invocations
[3e] istore_3                    185 invocations
[3f] lstore_0                      1 invocations
[40] lstore_1                      2 invocations
[41] lstore_2                      3 invocations
[4b] astore_0                     35 invocations
[4c] astore_1                    742 invocations
[4d] astore_2                   2411 invocations
[4e] astore_3                  19006 invocations
[4f] iastore                      20 invocations
[53] aastore                    1654 invocations
[54] bastore                      19 invocations
[55] castore                     265 invocations
[57] pop                         808 invocations
[58] pop2                          4 invocations
[59] dup                        4418 invocations
[5a] dup_x1                        4 invocations
[5c] dup2                          1 invocations
[60] iadd                      86425 invocations
[61] ladd                          1 invocations
[64] isub                      61816 invocations
[68] imul                        814 invocations
[6a] fmul                         11 invocations
[70] irem                        135 invocations
[78] ishl                          8 invocations
[7a] ishr                          9 invocations
[7c] iushr                         8 invocations
[7e] iand                        163 invocations
[7f] land                          1 invocations
[80] ior                       25086 invocations
[81] lor                           1 invocations
[82] ixor                          8 invocations
[84] iinc                      29597 invocations
[85] i2l                           1 invocations
[86] i2f                          17 invocations
[8b] f2i                          11 invocations
[91] i2b                          13 invocations
[92] i2c                       25083 invocations
[94] lcmp                         13 invocations
[95] fcmpl                        19 invocations
[96] fcmpg                        19 invocations
[99] ifeq                      25358 invocations
[9a] ifne                      42109 invocations
[9b] iflt                     102593 invocations
[9c] ifge                      12405 invocations
[9d] ifgt                         27 invocations
[9e] ifle                       6280 invocations
[9f] if_icmpeq                 51280 invocations
[a0] if_icmpne                   813 invocations
[a1] if_icmplt                 77656 invocations
[a2] if_icmpge                 52068 invocations
[a3] if_icmpgt                    73 invocations
[a4] if_icmple                    52 invocations
[a5] if_acmpeq                  1612 invocations
[a6] if_acmpne                  2072 invocations
[a7] goto                      66816 invocations
[a8] jsr                           1 invocations
[a9] ret                           1 invocations
[ab] lookupswitch                  1 invocations
[ac] ireturn                  164404 invocations
[ad] lreturn                       6 invocations
[b0] areturn                   14314 invocations
[b1] return                     6938 invocations
[b2] getstatic                 39043 invocations
[b3] putstatic                   201 invocations
[b4] getfield                 310885 invocations
[b5] putfield                  15212 invocations
[b6] invokevirtual            102940 invocations
[b7] invokespecial              3603 invocations
[b8] invokestatic              65929 invocations
[b9] invokeinterface           13227 invocations
[bb] new                         950 invocations
[bc] newarray                     40 invocations
[bd] anewarray                   477 invocations
[be] arraylength                 764 invocations
[c0] checkcast                 23360 invocations
[c1] instanceof                   55 invocations
[c2] monitorenter                151 invocations
[c3] monitorexit                 151 invocations
[c6] ifnull                    15595 invocations
[c7] ifnonnull                 19950 invocations

Total: 3118655

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Three million bytecode instructions executed to get a little message on the screen.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 01 Mar 2011 23:49:00 +0100</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/157-guid.html</guid>
    
</item>
<item>
    <title>Spatial search with Lucene</title>
    <link>http://www.mhaller.de/archives/156-Spatial-search-with-Lucene.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/156-Spatial-search-with-Lucene.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=156</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=156</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    At the Hadoop Hackathon this weekend at Sybit, we&#039;ve worked on a getting tiled images into HDFS and HBase. A side-story was how to search for these tiles based on GPS coordinates. I took the task to see how you can perform queries based on spatial coordinates. That is, searching for locations which are within a specified radius from an origin:&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/archives/156-Spatial-search-with-Lucene.html&#039;&gt;&lt;!-- s9ymdb:170 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;98&quot; height=&quot;110&quot; style=&quot;float: left; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/CartesianGridAnimated.serendipityThumb.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/archives/156-Spatial-search-with-Lucene.html&#039;&gt;&lt;!-- s9ymdb:174 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;79&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/5Miles.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.mhaller.de/archives/156-Spatial-search-with-Lucene.html#extended&quot;&gt;Continue reading &quot;Spatial search with Lucene&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 16 Oct 2010 21:52:10 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/156-guid.html</guid>
    
</item>
<item>
    <title>Visualizing Dataflow</title>
    <link>http://www.mhaller.de/archives/152-Visualizing-Dataflow.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/152-Visualizing-Dataflow.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=152</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=152</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/MiniDataflowVisual.png&#039;&gt;&lt;!-- s9ymdb:156 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;110&quot; height=&quot;66&quot; style=&quot;float: right; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/MiniDataflowVisual.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;I&#039;ve been playing around recently regarding &lt;strong&gt;visualization of dataflow in Java applications&lt;/strong&gt;. It seems that there are tons of tools to inspect the control flow, but I had no luck yet finding something which can visualize the amount of data and the type of data flowing through complex systems.&lt;br /&gt;
&lt;br /&gt;
Not being an &lt;a href=&quot;http://www.eclipse.org/aspectj/&quot;&gt;AOP&lt;/a&gt; guru, i wondered if there was something else to use. Something, which is unobtrusive and can be applied to existing systems. The first thing i&#039;m trying is &lt;a href=&quot;http://java.sun.com/javase/6/docs/technotes/guides/jpda/&quot;&gt;Java&#039;s Debugging APIs&lt;/a&gt;, namely &lt;a href=&quot;http://java.sun.com/javase/6/docs/jdk/api/jpda/jdi/&quot;&gt;JDI&lt;/a&gt;, to &lt;strong&gt;automatically step through a program and record method entries&lt;/strong&gt;.&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.mhaller.de/archives/152-Visualizing-Dataflow.html#extended&quot;&gt;Continue reading &quot;Visualizing Dataflow&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 21 Jun 2010 22:49:30 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/152-guid.html</guid>
    
</item>
<item>
    <title>Popularity of log frameworks</title>
    <link>http://www.mhaller.de/archives/149-Popularity-of-log-frameworks.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/149-Popularity-of-log-frameworks.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=149</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=149</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Logging is some weird kind of aspect of software development. It&#039;s a necessary evil so to say. On the one hand, it&#039;s great to have the flexibility to either log in a file or to console, to roll the files, to enable certain log statements at runtime etc. But on the other hand, there are so many logging frameworks and so manyof them did wrong in their first encounter, it became quiet insane.&lt;br /&gt;
&lt;br /&gt;
A few years ago, driven by the well-known problems of commons-logging, we&#039;ve switched over to slf4j with log4j as engine. I don&#039;t regret that, as I like the slf4j-api and modularized design. I also kind of like log4j - its log4j.xml, its debug system parameters and that its practically spread all over the Java world. Yes, sure, there are some minor drawbacks, like the inability of the log4j committers to provide clean Maven pom.xml files for some version. Did they fix that btw?&lt;br /&gt;
&lt;br /&gt;
Anyway, to cut a long story short: i&#039;ve played around with Neo4j and Maven and came up with a quick Maven Repository scanner which counts the dependencies from reverse: it shows how often a certain artifact is referenced by another project as dependency. The data basis was my local repository (11988 artifacts) and it&#039;s surely biased to some degree. I&#039;ll try to get a clean Maven Repo mirror some day and rerun the experiment.&lt;br /&gt;
&lt;br /&gt;
The winner is:&lt;br /&gt;
&lt;br /&gt;
1162 times used (9,69%): &lt;strong&gt;org.slf4j&lt;/strong&gt;&lt;br /&gt;
867 times used (7,23%): log4j  &lt;br /&gt;
837 times used (6,98%): commons-logging  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is other interesting information in that experiment, like&lt;br /&gt;
20,33% of the artifacts are using junit, thereas 1,9% use testng. 21,13% use the Spring Framework and 6,45% of all the Maven artifacts in my repo use the javax.servlet spec. Easymock is used by 5,62% of the artifacts. Other popular libraries include com.sun.xml.bind, commons-lang, asm, Xerces, Apache Camel, Jetty, javax.xml.bind, javax.xml.soap, wsdl4j, commons-collections, Ant, Apache Cocoon, Apache Abdera, org.eclipse, commons-io, cglib, hibernate, velocity, woodstox and derby.&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 04 May 2010 08:43:44 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/149-guid.html</guid>
    
</item>
<item>
    <title>Consolas</title>
    <link>http://www.mhaller.de/archives/142-Consolas.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/142-Consolas.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=142</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=142</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;a href=&quot;http://hivelogic.com/articles/top-10-programming-fonts&quot;&gt;Dan&lt;/a&gt; writes about it, &lt;a href=&quot;http://www.smashingmagazine.com/2010/01/18/25-new-high-quality-free-fonts/&quot;&gt;Sven &amp;amp; Vitaly&lt;/a&gt; are writing about it, &lt;a href=&quot;http://www.codinghorror.com/blog/archives/000356.html&quot;&gt;Jeff&lt;/a&gt;, &lt;a href=&quot;http://www.hanselman.com/blog/UsingConsolasAsTheWindowsConsoleFont.aspx&quot;&gt;Scott&lt;/a&gt; and &lt;a href=&quot;http://www.furrygoat.com/2005/08/07/longhorn-fonts/&quot;&gt;Steve&lt;/a&gt; found it years ago and are probably using it ever since. Many &lt;a href=&quot;http://stackoverflow.com/questions/4689/recommended-fonts-for-programming-closed&quot;&gt;StackOverflow&lt;/a&gt; users do it as well. So why don&#039;t I?&lt;br /&gt;
&lt;br /&gt;
Well, now I did and so far, it&#039;s promosing.&lt;br /&gt;
I switched &lt;b&gt;from Courier New to Consolas&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Besides gaining some more space, it really looks much nicer.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- s9ymdb:129 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;557&quot; height=&quot;360&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/ConsolasCourierNewComparison3.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
But compare for yourself:&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/ConsolasCourierNewComparison.png&#039;&gt;&lt;!-- s9ymdb:128 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;62&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/ConsolasCourierNewComparison.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Consolas is a commercial font and if you&#039;re on Windows and have any of the Microsoft products installed, chances are that you already have Consolas installed on your system. If you don&#039;t, check out the other programming fonts features on &lt;a href=&quot;http://www.smashingmagazine.com/2010/01/18/25-new-high-quality-free-fonts/&quot;&gt;Smashing Magazines&lt;/a&gt; articles.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sat, 23 Jan 2010 15:27:12 +0100</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/142-guid.html</guid>
    
</item>
<item>
    <title>Tracing with JDK Logging</title>
    <link>http://www.mhaller.de/archives/141-Tracing-with-JDK-Logging.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/141-Tracing-with-JDK-Logging.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=141</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=141</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Imagine you&#039;re writing a small test case to check out some &lt;a href=&quot;http://ibatis.apache.org/&quot;&gt;new library or version&lt;/a&gt; or cool new technology. &lt;br /&gt;
&lt;br /&gt;
You&#039;re eager to try out that stuff, learn how it works and how to use it.&lt;br /&gt;
But, unfortunately, &lt;strong&gt;something goes wrong&lt;/strong&gt; and you see the following:&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/ConsoleLogging0.PNG&#039;&gt;&lt;!-- s9ymdb:125 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;590&quot; height=&quot;201&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/ConsoleLogging0.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Exactly, &lt;strong&gt;you see nothing&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
You didn&#039;t quite read the quick start tutorial carefully and you must have missed something at the configuration file or at the code. You&#039;re not sure - all you get is a mysterious exception or the code just doesn&#039;t do anything visible, as it does here. At this point, &lt;strong&gt;you just want it to print out what&#039;s going on, anything&lt;/strong&gt; - you would like to have some fine-grained logging output on your console.&lt;br /&gt;
&lt;br /&gt;
You know it&#039;s a pain to set up all that logging facility stuff correctly and your loved pre-configured &lt;tt&gt;log4j.xml&lt;/tt&gt; with all the handy shortcuts is on the other machine. Okay, all you needed was just the whole debug output of that library to get it to know better and see what&#039;s going wrong.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
The project already has commons-logging on it&#039;s classpath, but gladly no implementation, so it&#039;s using JDK Logging as a backend. &lt;a href=&quot;http://www.slf4j.org/&quot;&gt;Commons-logging should die anyway.&lt;/a&gt; &lt;a href=&quot;http://wiki.apache.org/commons/Logging/UndeployMemoryLeak&quot;&gt;Really.&lt;/a&gt; &lt;a href=&quot;http://www.mhaller.de/archives/140-Memory-leaks-et-alii.html&quot;&gt;I mean it.&lt;/a&gt;. You can see that it&#039;s using JDK Logging since the console output is two-line formatted like the following snippet. The name of the logger is the adapter used to bridge between Commons-Logging and JDK Logging, and in this case it&#039;s &lt;a href=&quot;http://ibatis.apache.org/&quot;&gt;iBatis 3&lt;/a&gt; &lt;tt&gt;JakartaCommonsLoggingImpl&lt;/tt&gt;.

&lt;pre&gt;
16.01.2010 16:20:27 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl debug
FEIN: PooledDataSource forcefully closed/removed all connections.
16.01.2010 16:20:27 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl debug
FEIN: PooledDataSource forcefully closed/removed all connections.
&lt;/pre&gt;

&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
Now, back to the example which is currently not printing out anything. To get decent logging output to your console with standard JDK logging, you either have to create a &lt;tt&gt;logging.properties&lt;/tt&gt; and fill it with some obscure properties like &lt;tt&gt;.handlers&lt;/tt&gt; and anyway you don&#039;t know how to configure that correctly. &lt;strong&gt;Isn&#039;t there anywhere a good and quick to find example for that?&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
I started using this code, which seems to be the simplest possible way of getting something to the console quickly.&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;
Logger rootLogger = LogManager.getLogManager().getLogger(&quot;&quot;);
Handler handler = new ConsoleHandler();
handler.setLevel(Level.ALL);
rootLogger.addHandler(handler);
rootLogger.setLevel(Level.ALL);
&lt;/pre&gt;&lt;br /&gt;
As you can see, &lt;strong&gt;there&#039;s some output now&lt;/strong&gt;.&lt;br /&gt;
But it&#039;s red (System.err stream) and there are too many newlines for my taste.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
It uses the root logger, identified by the empty string &lt;tt&gt;(&quot;&quot;)&lt;/tt&gt;, adds a Handler, which is responsible for printing the log messages to the console. Other Handlers write the log messages to the file system or send it over the wire. The Level is the log level, which determines which log messages are being sent to the Handler and which are ignored. For example, you can set it to &lt;tt&gt;INFO&lt;/tt&gt;, so only Info, Warning, Error-level log messages are being printed. Log messages of level Debug and Trace are being ignored.
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/ConsoleLogging1.PNG&#039;&gt;&lt;!-- s9ymdb:126 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;608&quot; height=&quot;203&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/ConsoleLogging1.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Since &lt;strong&gt;I don&#039;t like the output being spread over two lines&lt;/strong&gt; (it makes it reading much harder, especially if your output is tabular like like the iBatis output for &lt;tt&gt;java.sql&lt;/tt&gt; statements. So I ended up with something like this, to format the lines into a single line and get it to print out on System output console instead of System error:&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;
Logger logger = LogManager.getLogManager().getLogger(&quot;&quot;);
class RedirectingConsoleHandler extends ConsoleHandler {
	public RedirectingConsoleHandler(OutputStream target) {
		super();
		setOutputStream(target);
	}
}
;
Handler handler = new RedirectingConsoleHandler(System.out);
handler.setLevel(Level.ALL);
// handler.setFormatter(new XMLFormatter());
Formatter newFormatter = new Formatter() {

	@Override
	public String format(LogRecord record) {
		return String.format(&quot;%tT %-40.40s %-8.8s %s\n&quot;, new Date(),
				record.getLoggerName(), record.getLevel().getLocalizedName(),
				formatMessage(record));
	}
};
handler.setFormatter(newFormatter);
logger.addHandler(handler);
logger.setLevel(Level.ALL);
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
This code will &lt;strong&gt;redirect the output&lt;/strong&gt; of the Logging facility to a configure stream, in this case the &lt;tt&gt;System.out&lt;/tt&gt; stream. That&#039;s the &lt;tt&gt;RedirectingConsoleHandler&lt;/tt&gt; class is for. The anonymous &lt;tt&gt;Formatter&lt;/tt&gt; class will format the log message, e.g. add a timestamp, the name of the logger, on which level it was logged and the actual log message of the log record and &lt;strong&gt;only use one single line&lt;/strong&gt;. The output looks much more how I like it:&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/ConsoleLogging2.PNG&#039;&gt;&lt;!-- s9ymdb:127 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;654&quot; height=&quot;203&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/ConsoleLogging2.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;(Yeah, i know the SQL statements are truncated at the example screenshot. But in modern times, with larger screens, it&#039;s &lt;strong&gt;no problem since the consoles are much broader than the space available on my blog&lt;/strong&gt;)&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Note: this is only used for testing, not for production, not for performance measurements, not for audit logging. This kind of logging is only meant for technical debug tracing. Logging is among the Top10 unknown performance killers in enterprise applications.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sat, 16 Jan 2010 16:02:01 +0100</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/141-guid.html</guid>
    
</item>
<item>
    <title>Memory leaks et alii</title>
    <link>http://www.mhaller.de/archives/140-Memory-leaks-et-alii.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/140-Memory-leaks-et-alii.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=140</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=140</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;div class=&quot;serendipity_imageComment_center&quot; style=&quot;width: 400px&quot;&gt;&lt;div class=&quot;serendipity_imageComment_img&quot;&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/Articles/Java/PrevXWSTimerThreadNotCancelled2.png&#039;&gt;&lt;!-- s9ymdb:115 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;400&quot; height=&quot;276&quot;  src=&quot;http://www.mhaller.de/uploads/Articles/Java/PrevXWSTimerThreadNotCancelled2.png&quot; alt=&quot;Leaky web application&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;serendipity_imageComment_txt&quot;&gt;Leaky web application&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
One of the most common problems in building enterprise web applications are leaks. A leak is consumption of a resource by a program where the program is unable to release the resource. Leaks come in various types, such as&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;Memory leaks&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Thread and ThreadLocal leaks&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;ClassLoader leaks&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;System resource leaks&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Connection leaks&lt;/li&gt;&lt;br /&gt;
&lt;/ul&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.mhaller.de/archives/140-Memory-leaks-et-alii.html#extended&quot;&gt;Continue reading &quot;Memory leaks et alii&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 30 Dec 2009 14:30:15 +0100</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/140-guid.html</guid>
    
</item>
<item>
    <title>Per-unit-test profiling</title>
    <link>http://www.mhaller.de/archives/138-Per-unit-test-profiling.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/138-Per-unit-test-profiling.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=138</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=138</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    As a preparation for long-term performance measurements, (sometimes called &lt;a href=&quot;http://lmgtfy.com/?q=Continuous+Performance+Management&quot;&gt;Continuous Performance Management&lt;/a&gt; or CPM), I tried to automate the creation of &lt;a href=&quot;http://www.ej-technologies.com/products/jprofiler/overview.html&quot;&gt;JProfiler&lt;/a&gt; profiling snapshots and, along the way, came up with the following side product: &lt;strong&gt;Automated per-test method profiling&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
Basically, the idea is to go from here:&lt;br /&gt;
&lt;p&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/JUnitJProfilerMySQL1.PNG&#039;&gt;&lt;!-- s9ymdb:88 --&gt;&lt;img class=&quot;serendipity_image_left&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/JUnitJProfilerMySQL1.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;to here&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/JUnitJProfilerMySQL6.PNG&#039;&gt;&lt;!-- s9ymdb:93 --&gt;&lt;img class=&quot;serendipity_image_left&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/JUnitJProfilerMySQL6.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;&lt;i&gt;&quot;What&#039;s so great about this?&quot;&lt;/i&gt;, you wonder?&lt;/p&gt;&lt;br /&gt;
Read the &lt;a href=&quot;http://www.mhaller.de/archives/138-Per-unit-test-profiling.html&quot;&gt;full article&lt;/a&gt; for fancy screenshots and code snippets.&lt;br /&gt;
&lt;br /&gt;
(Btw, the test cases are due to &lt;a href=&quot;http://stackoverflow.com/questions/1672415/charat-or-substring-which-is-faster&quot;&gt;this question&lt;/a&gt;. Usually, i don&#039;t do String performance tests &lt;img src=&quot;http://www.mhaller.de/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.mhaller.de/archives/138-Per-unit-test-profiling.html#extended&quot;&gt;Continue reading &quot;Per-unit-test profiling&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 16 Nov 2009 23:01:55 +0100</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/138-guid.html</guid>
    
</item>
<item>
    <title>Top10 programming controversial</title>
    <link>http://www.mhaller.de/archives/136-Top10-programming-controversial.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/136-Top10-programming-controversial.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=136</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=136</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    There&#039;s a Stackoverflow question about controversial programming opinions:&lt;br /&gt;
The top ten as voted by the SO community:&lt;br /&gt;
&lt;br /&gt;
1. The only &quot;best practice&quot; you should be using all the time is &lt;strong&gt;Use Your Brain&lt;/strong&gt;&lt;br /&gt;
2. Most comments in code are in fact a pernicious form of &lt;strong&gt;code duplication&lt;/strong&gt;&lt;br /&gt;
3. Programmers who don&#039;t code in their spare time for fun, will &lt;strong&gt;never become as good&lt;/strong&gt; as those that do&lt;br /&gt;
4. &lt;strong&gt;Not all programmers are created equal&lt;/strong&gt;&lt;br /&gt;
5. &lt;strong&gt;XML is highly overrated&lt;/strong&gt;&lt;br /&gt;
6. &lt;strong&gt;&quot;Googling it&quot;&lt;/strong&gt; is okay!&lt;br /&gt;
7. I fail to understand why people think that &lt;strong&gt;Java&lt;/strong&gt; is absolutely the &lt;strong&gt;best &quot;first&quot; programming&lt;/strong&gt; language to be taught in universities&lt;br /&gt;
8. If you &lt;strong&gt;only&lt;/strong&gt; know *one language*, no matter how well you know it, you&#039;re &lt;strong&gt;not a great programmer&lt;/strong&gt;&lt;br /&gt;
9. &lt;strong&gt;Performance does matter&lt;/strong&gt;&lt;br /&gt;
10. &lt;strong&gt;The Business Apps farce&lt;/strong&gt; (You have to &lt;a href=&quot;http://stackoverflow.com/questions/406760/whats-your-most-controversial-programming-opinion/406825#406825&quot;&gt;read it&lt;/a&gt; to understand)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 04 Nov 2009 11:02:37 +0100</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/136-guid.html</guid>
    
</item>
<item>
    <title>Where have all the threads gone?</title>
    <link>http://www.mhaller.de/archives/133-Where-have-all-the-threads-gone.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/133-Where-have-all-the-threads-gone.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=133</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=133</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Recently, we got a nasty error in the log file:&lt;br /&gt;
&lt;pre&gt;
java.lang.OutOfMemoryError: unable to create new native thread
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Although we had specified &lt;code&gt;-XX:HeapDumpOnOutOfMemoryError&lt;/code&gt;, this does not include dumping the heap to disk when the heap is not involved in an OutOfMemoryError. In this case, the JVM was unable to create new threads as the limit of threads was reached.&lt;br /&gt;
&lt;br /&gt;
So, the question is: &lt;b&gt;How many threads can be created?&lt;/b&gt;&lt;br /&gt;
The answer is, as usual: &lt;b&gt;It depends!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.mhaller.de/uploads/threads-memory.png&#039;&gt;&lt;!-- s9ymdb:82 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;110&quot; height=&quot;80&quot; style=&quot;float: right; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/threads-memory.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;br /&gt;&lt;a href=&quot;http://www.mhaller.de/archives/133-Where-have-all-the-threads-gone.html#extended&quot;&gt;Continue reading &quot;Where have all the threads gone?&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 06 Jul 2009 15:37:04 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/133-guid.html</guid>
    
</item>
<item>
    <title>My Own Twitter Client</title>
    <link>http://www.mhaller.de/archives/130-My-Own-Twitter-Client.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/130-My-Own-Twitter-Client.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=130</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=130</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Using &lt;a href=&quot;http://yusuke.homeip.net/twitter4j/&quot;&gt;twitter4j&lt;/a&gt;, it&#039;s pretty easy to hack together a new &lt;a href=&quot;https://twitter.com/&quot;&gt;Twitter&lt;/a&gt; desktop client. What I wanted to do is to have search capabilities and have all the tweets in a local database, so I could have a look and work with the messages people write even when i&#039;m offline (which never happens anyway, but just in case).&lt;br /&gt;
&lt;br /&gt;
So, taking &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;Eclipse RCP&lt;/a&gt;, munching it with twitter4j, adding a bit of &lt;a href=&quot;http://db.apache.org/derby/&quot;&gt;Apache Derby&lt;/a&gt; and other stuff, I ended up with the following prototype in a couple of hours:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- s9ymdb:80 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;526&quot; height=&quot;389&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/sometwitter1.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
It has a &lt;b&gt;virtual table&lt;/b&gt;, so it loads tweets on-demand from the local database when you scroll down. It only reloads the latest 20 tweets from Twitter.com in online mode. There is an offline-mode to decrease the amount of network bandwidth and service utilization. Twitter is already pretty slow. The client &lt;b&gt;caches all the profile images&lt;/b&gt; for faster loading. It displays the time of the tweet and &lt;b&gt;highlights URLs&lt;/b&gt;. I had a feature in it which &lt;b&gt;resolves shortened URLs&lt;/b&gt; and displays the real ones on hover, but i disabled it as I&#039;ve got problems displaying a nice hover. Hover&#039;s in Eclipse RCP/SWT/JFace just don&#039;t look very nice, compared to all the new Web 2.0 or Mac designs found in modern apps today.&lt;br /&gt;
&lt;br /&gt;
What other features could be put into yet-another-twitter-client? Tag clouds? URL clouds? Charts? Google Maps? Automatic translations like Babelfish?&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sun, 17 May 2009 22:01:31 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/130-guid.html</guid>
    
</item>
<item>
    <title>In-Memory Databases</title>
    <link>http://www.mhaller.de/archives/127-In-Memory-Databases.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/127-In-Memory-Databases.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=127</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=127</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    For testing and demo installation purposes, or for in-memory data aggregation operations, it may be suitable to use a &quot;nearly full-blown&quot; database. They&#039;re called in-memory databases and there are some implementation for the Java platform which are used since years:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;a href=&quot;http://www.hsqldb.org/&quot;&gt;hsqldb&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
One of the first 100% Java implementations of a SQL relational database management system. Like all the others, it can be run from a persistent file system or run in-memory. It&#039;s fast, it has a very low footprint and it can be embedded in any Java application. Hsqldb was my favourite for years to use in unit tests and integration tests. It can also read and write CSV files.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;a href=&quot;http://www.h2database.com/&quot;&gt;H2Database&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
The successor of hsqldb is H2. It&#039;s better documented, performs even better and has more options. There&#039;s even a web console where you can work with the data in the in-memory database like you can do with phpMyAdmin. Great thing. I&#039;m currently using H2 at home and at work.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;a href=&quot;http://blogs.sun.com/kah/entry/derby_10_5_preview_in&quot;&gt;Derby&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
Derby, the Java database, now also supports the in-memory protocol. That&#039;s great to hear and an additional argument for switching to Derby as the default implementation for databases in embedded versions or for demo installations.&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 05 May 2009 21:58:48 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/127-guid.html</guid>
    
</item>
<item>
    <title>Monitoring code quality</title>
    <link>http://www.mhaller.de/archives/126-Monitoring-code-quality.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/126-Monitoring-code-quality.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=126</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=126</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://sonar.codehaus.org/&#039; target=&quot;_blank&quot;&gt;&lt;!-- s9ymdb:78 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;100&quot; height=&quot;54&quot; style=&quot;float: right; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.mhaller.de/uploads/sonar-blackonwhite.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;I&#039;ve been looking for tools to measure and visualize code quality for some time now. Every once in a while, there&#039;s some tool which aggregates results from quality measurements and monitoring tools like &lt;a href=&quot;http://pmd.sourceforge.net/&quot;&gt;PMD&lt;/a&gt;, &lt;a href=&quot;http://findbugs.sourceforge.net/&quot;&gt;Findbugs&lt;/a&gt;, &lt;a href=&quot;http://checkstyle.sourceforge.net/&quot;&gt;Checkstyle&lt;/a&gt; etc. but I haven&#039;t yet found something which attracted my interest.&lt;br /&gt;
&lt;br /&gt;
Read on to find out about Codehaus&#039; Sonar.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;serendipity_imageComment_center&quot; style=&quot;width: 320px&quot;&gt;&lt;div class=&quot;serendipity_imageComment_img&quot;&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&quot;http://www.java-community.de/archives/126-Monitoring-code-quality.html&quot;&gt;&lt;!-- s9ymdb:73 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;320&quot; height=&quot;182&quot;  src=&quot;http://www.mhaller.de/uploads/Sonar6_Small.png&quot; alt=&quot;Codehaus Sonar for code quality showing Hotspots&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;serendipity_imageComment_txt&quot;&gt;Codehaus Sonar for code quality&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.mhaller.de/archives/126-Monitoring-code-quality.html#extended&quot;&gt;Continue reading &quot;Monitoring code quality&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 26 Apr 2009 13:35:02 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/126-guid.html</guid>
    
</item>
<item>
    <title>Java Class Popularity</title>
    <link>http://www.mhaller.de/archives/125-Java-Class-Popularity.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/125-Java-Class-Popularity.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=125</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=125</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Taken from a heap dump of a JBoss Application Server with some applications deployed, i&#039;ve look at the number of objects in the heap and compiled a &#039;popularity list&#039; accordingly:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;java.util&lt;/b&gt;&lt;br /&gt;
1. ArrayList&lt;br /&gt;
2. HashMap&lt;br /&gt;
3. TreeMap&lt;br /&gt;
4. Vector&lt;br /&gt;
5. Hashtable&lt;br /&gt;
6. LinkedList&lt;br /&gt;
7. HashSet&lt;br /&gt;
8. &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/util/WeakHashMap.html&quot;&gt;WeakHashMap&lt;/a&gt;&lt;br /&gt;
9. TreeSet&lt;br /&gt;
&lt;br /&gt;
Read on to see the full list. I&#039;ve marked some classes which I find interesting enough to have a second look on them. Know your library.&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.mhaller.de/archives/125-Java-Class-Popularity.html#extended&quot;&gt;Continue reading &quot;Java Class Popularity&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 17 Apr 2009 08:00:00 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/125-guid.html</guid>
    
</item>
<item>
    <title>Date ranges in Lucene</title>
    <link>http://www.mhaller.de/archives/119-Date-ranges-in-Lucene.html</link>
            <category>Java</category>
    
    <comments>http://www.mhaller.de/archives/119-Date-ranges-in-Lucene.html#comments</comments>
    <wfw:comment>http://www.mhaller.de/wfwcomment.php?cid=119</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.mhaller.de/rss.php?version=2.0&amp;type=comments&amp;cid=119</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Lucene is a &lt;i&gt;very efficient and fast&lt;/i&gt; Java search engine. Once indexed, any object can be found by looking for attribute matches. An object in Lucene is called &lt;b&gt;Document&lt;/b&gt; and its attributes are called &lt;b&gt;Field&lt;/b&gt;s. Lucene uses &lt;b&gt;Query&lt;/b&gt; and &lt;b&gt;Filter&lt;/b&gt; objects to narrow down the search to what the user wants to find. A Query makes the amount of data to be searched smaller while a Filter is used for more fine-grained control over what a search result shall include. Queries are more memory-hungry than filters, but for the usual use cases, both are very good.&lt;br /&gt;
&lt;br /&gt;
In this post, I&#039;d like to show how you can search for &lt;b&gt;Date and Time ranges&lt;/b&gt;, for example modification dates of files. I&#039;d like to find all files on my local file system which were modified in April 2009.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.mhaller.de/archives/119-Date-ranges-in-Lucene.html#extended&quot;&gt;Continue reading &quot;Date ranges in Lucene&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 04 Apr 2009 13:23:59 +0200</pubDate>
    <guid isPermaLink="false">http://www.mhaller.de/archives/119-guid.html</guid>
    
</item>

</channel>
</rss>