How to find a concurrency bug – this was the question I asked myself some time ago. It is always very hard to find a concurrency bug. Mostly you have no idea when it happens or if it is really a concurrency issue or some nasty bit of code. If it is a concurrency issue the question is if the bug is in your code or in a supplied library? Will the problem happen only on multicore processors or on any machine? Besides the technical problem the customer is eager to get a solution and...
A few days ago, we upgraded the jdk we use for development. After this some developers experienced a special problem with our eclipse while debugging. When they set a breakpoint, eclipse did not stop. After a try and error phase we found a working solution. The problem disappeared when we set the vm parameter -Xms (define initial size of heap) to a higher value for the jvm inside eclipse. In our case we set -Xms to -Xms256m. We still do not know why this solution works. But we thought...
Lucene offers great full text search capabilities. It is based on an index, which is maintained by Lucene. With Luke, the Lucene Index Toolbox () you can analyze your index and let explain queries. After startup, you have to select your index. For this example, I created a test index with one file. It’s content is “this is a lucene test”. I used the StandardAnalyzer, which uses the WhitespaceTokenizer and filters out all tokens less than 3 characters and stop words. This will result in an index...
Ant offers some XML features like the xslt task, which transforms XML files into other files. But unfortunately, with Ant you can’t make simple XPath Queries on a specific XML file.
Luckily, there is a nice open source solution called XmlTask, which offers many possibilities to work with XML files.
Download the latest version of XmlTask from
Wrong use of the memory options can cause serious performance problems. To optimize the right memory size of the JVM or to find some critical memory issues, the GC log of the JVM can be very useful. Simply start the Java application with the option -Xloggc:<file>. Every GC action gets logged into this file. To analyse this log file, there is a nice tool called GCViewer, which can be downloaded from . GCViewer is able to display the memory usage of the application based on time and...
There are some kind of tasks, which Ant won’t do. One of them is the loop. There is no simple way to implement a dynamic for or while loop in Ant. What do i mean with dynamic? Let me make an example. Ant reads out a number of iterations from a property file (we call it the number x) and should perform a loop x-times to call another Ant task. And this can only hardly be done with Ant. But fortunately, there is Groovy. Groovy is a scripting language, which runs in a Java Virtual Machine...
A few weeks ago, I started using Mockito. Mockito is a mocking framework for Java.
What mockito is able to do:
– mocking interfaces and abstract classes
– mocking concrete classes
– spy real objects
I liked mockito so much that I decided to present it to you…
Yesterday, I visited an interesting presentation from Tudor Girba. He showed us several ways for visualize code. One of the most interesting visualization was Code City.
(ArgoUML from )
Source Control like CVS or Subversion is used almost in every software project. As a developer, it’s your responsibility to be up to date with the current version from the source control system. In Eclipse there is a nice feature to schedule such synchronizations. This means, you get regularly informed about all updates and you have less merging problems!
Today I stumbled upon the problem eclipse did not find some classes with the code completition or [Ctrl-Shift-T]. If you write the class name in the code everything looks ok. I tried to clean my workspaces with rebuild etc. did not work.
But there is hope: After deleting all content in .metadata/.plugins/org.eclipse.jdt.core eclipse re-indexes the workspace again and everything is ok. I guess -clean as startup parameter would work likewise but I can’t verify.