Skip to content

{ Tag Archives } LJC

Best new feature in Eclipse 3.6 Helios

… is hidden away on the last tab of the Java Formatting Profile editor (Preferences -> Java -> Code Style -> Formatter -> Edit). They’ve finally (after nearly six years) added the ability to temporarily turn the code formatter off for a tricksy block that needs its own custom formatting. e.g.: // @formatter:off xml .append( [...]

Also tagged ,

NoSuchMethodError when running JUnit tests in Eclipse

This is worth a quick post as I couldn’t find a solution on Google and it took me an hour or two of fiddling. I have a Maven project, call it frontend-war, which contains the main service code for FuncNet. A unit test kept failing in Eclipse with NoSuchMethodError, one of my least favourite screw-ups [...]

Also tagged , ,

RetriableTask — a generic wrapper for retrying operations in Java

A couple of times recently I’ve needed to write methods that retry up to n times if an error occurs, and surprisingly, couldn’t find any standard patterns to accomplish this on the web. So I wrote my own. All comments appreciated (there may well be massive holes in my logic but it works so far).

Also tagged ,

IteratorReader — streaming character data from an iterator

Recently when plugging two components of a high-throughput web service together, I ran into a snag. One component (a data repository) exposes an Iterator for pulling XML-formatted records out of it one by one. The other (for serving SOAP response documents) needed, ideally, something that could be wrapped in a StreamSource — i.e. an InputStream [...]

Also tagged ,