The Occasional Blogger

Low Volume - By Definition

Category: Java

Double Checked Locking

After warning someone about the problems of double checked locking I discovered it’s been fixed in Java 5. Simply add the volatile keyword and it’s all good.
See Wikipedia for all the details.

JVM Languages

I think my favourite blog at the moment would be Charles Nutter’s. You can always count on him for enthusiastic informative postings. It isn’t hard to tell he loves his job – it comes through very strongly in his posts. His last post was a pearler. In it he talks about [...]

Followup: Converting from Java to Groovy one step at a time

Charles Nutter is in on the fun with a Ruby version:

def subn(n, list)
return [[]] if n == 0
return [] if list.empty?

remainder = list[1..-1]
subn(n-1, remainder).collect {|it| [list[ 0 ]] + it } + subn(n, remainder)
end

That made me realise there was [...]

Converting from Java to Groovy one step at a time

I came across a post on (cadr life) the other day about creating a function to find all subsequences of a list with a certain length. The Java version was particularly icky and in his post he shows the equivalent code in a couple of languages. I thought it might be interesting to [...]

Assertions with assertThat

I like to think I’m reasonably up-to-date with Java technologies but then I discovered something today that shows up that I’m still ignorant of a lot of available technology that’s out there. Today I ran across hamcrest which is now apparently part of junit 4.4 and above.
Basically it replaces the old assertEquals() & variants [...]

Back to Groovy

After being initially interested in Groovy I cooled on it as a language and haven’t touched it in some time. Recently I had need to create a little throwaway program and gave Groovy another go.
Groovy is now up to version 1.5 and Grails which is heavily inspired by Ruby on Rails has [...]

Book Review: The Definitive ANTLR Reference

Having needed to so some parsing recently I picked up a copy of The Definitive ANTLR Reference: Building Domain-Specific Languages from The Pragmatic Bookshelf. I’ve found myself purchasing a lot of their books recently. The PDF versions are great in particular because they come with no nasty DRM and are genuinely cheaper than [...]

Going with the lesser known web framework

In the past I’ve been a proponent of Tapestry. It had a nice component based view of the world and there were certain elegant concepts that were very appealing. Unfortunately it had two major flaws:
1. It’s too complicated.
2. Backward compatibility has been thrown out the door multiple times.
Tapestry takes a significant time to [...]

State of Hibernate

I must confess myself disappointed with the latest release of hibernate. What was a reasonably simple project seems to have ballooned into something a lot more complicated. If you go to the website you’ll find 3.2.4.SP1 is listed as the latest release. I was thinking this would be compatible with hibernate annotations [...]

Java Platform Languages

Increasingly there seems to be a move towards language alternatives that function on the Java (VM) Platform. Personally I think the platform itself is the best thing about Java. The language while adequate has never really particularly inspiring. Certainly when I started coding Java it was a big step up from [...]