Archive for August, 2004

java.util.regex.Pattern StackOverflowError’s on (x|y)*

# 2004-08-27 08:57:53 -0400 | Java | 4 Comments

I’ve been doing a fair whack of regex processing in Java recently. I must admit that having a regex library in the language is very useful, and Java’s java.util.regex.Pattern implements a very complete regex library (all the “Perl5″ stuff, non-greedy quantifiers, Unicode character classes, etc).

So I was completely surprised when it started throwing StackOverflowError. The following code highlights the problem (reproduced on Sun’s JDK1.5.0-b2 and JDK1.4.2_01). Any pattern like (x|y)* (an alternative wrapped in a star) is implemented recursively by Pattern. Each matched alternative uses about 5 method calls on the stack.

A perfect example of how IDEA *just works*

# 2004-08-20 17:33:59 -0400 | Java | 7 Comments

People I know who use Eclipse ask me why I use IntelliJ IDEA, when Eclipse is really good and free. Well, it’s little gems like the following that put IDEA miles above anything and everything else.

Back from reef

# 2004-08-17 09:54:26 -0400 | General | No Comments

Just back from a two week holiday (”vacation”) in Port Douglas. There is nothing like a fortnight of swimming, sleeping, walks, naps and hazelnut gelato to re-charge the batteries. If you ever have the chance to visit the Great Barrier Reef, I highly recommend going for a snorkel/dive, it was awesome. I spent all day yesterday clearing my build-up of support [...]