Archive for the 'java' Category
1 day of CommunityOne and 4 days of JavaOne went by in a flash. I’ve been to a lot of great, a couple of not-so-great and some really bad sessions.
To avoid information overload on semi-interesting topics I really tried to only go to sessions about topics I’m really interested in. For this JavaOne these […]
Closures and the return of the return
13 Comments Published by peter December 21st, 2007 in closures, java, ruby.I attended Joshua Blochs' presentation on closures at JavaPolis last week (watch the video here). This slides about return not return from what you'd expect kept me wondering: how do other languages solve this 'problem'.
The example from Bloch, taken from Slide 38 of Blochs' closures controversy presentation:
PLAIN TEXT
JAVA:
static <E> Boolean contains(Iterable<E> seq, {E => Boolean} [...]
Detecting copy/pasted code is a useful technique to find potential buggy code. Duplicated code often results in bugs being fixed in only one version of the copied code. PMD is a great sourcecode analysis tool which integrates nicely with maven and has CPD (copy/paste detection) capabilities.
To configure with default settings and CPD support add [...]
multiproject maven2: getting the site to work
0 Comments Published by peter November 14th, 2007 in java, maven.When generating a project site for a multiproject setup as described in my previous post many people run into the same problem. The links to the different modules don't work when you use the 'site:site' target. A couple of solutions exist which 'solve' this 'problem' (technically it is a feature).
The actually links are configure [...]
Getting started with multiproject maven2
2 Comments Published by peter November 13th, 2007 in java, maven.I'm helping a group of students to split up their codebase into a couple of manageable project using maven2 as the build tool. Their existing project is a layered Spring MVC web application. The following layers are present:
data model
dao / integration
services
web application 1
Since dependencies where not managed yet the codebase managed to drift into containing [...]
No, don't worry... it's not me installing Leopard on my MacBook.
My wife managed to install Leopard without much help. Everything went smooth and Leopard runs really well. First impressions are (although it lacks Java 6) quite good; I really like spaces.
One of my colleagues was however less lucky. He ended up having to do the [...]
Connecting JConsole to a Java process: the missing -D option
0 Comments Published by peter October 17th, 2007 in java, jconsole.Once in a while I tend to use JConsole for basic profiling of a Java process.
Somehow I always forget which flag I need to set to enable remote connections to a process. And yes, I know the option is hidden somewhere on page 3 of the documentation...
You need to add the following in [...]
LazyList based on the Google Collections Library
4 Comments Published by peter October 1st, 2007 in java.In my previous post I mentioned implementing the Google Collections counterpart of the commons-collections LazyList. I'll refer to the Google Collections Library as GCL from now on.
The LazyList decorates another List to create objects in the list on demand. To code below is loosly based on the code in commond-collections' lazylist counterpart. Most modifications are [...]
Recently the Google Collections Library came to my attention. The Google Collections Library is a suite of new collections and collection-related goodness for Java 5.0, brought to you by Google.
Since I'm a frequent user of apaches' commons-collections library I wondered what the difference is.
From browsing the API and FAQ it seems that:
It fully based [...]
While setting up JAXB2 for converting object graphs to XML I came across a not-so-nice part of the annotations specification. While looking for a way to define a package level annotation (never needed to do this before) I found the solution a bit surprising:
To define a package-level annotation one has to create a file called [...]



















