Don’t Yield to pressure?

or: does Thread.yield have its place in todays Java programs?

I was profiling a rather old legacy codebase (since the first rule of performance optimization is “profile it” with the close second of “have clear goals in mind” - but that’s an other post) and - after optimizing the first ...

more ...

Using TarInputStream from Java

994941366_af693049f1_o Recently I had to parse trough a bunch of logs, scattered in subdirectories and different types of archives (tar, bz and gz). My first thought was of course Perl (since it is the language for parsing quasi-freeform text), however I didn’t have “streaming” implementation for the archive modules, which ...

more ...

Careful with that axe^H^H^H static, Eugene!

557403262_2d8d8a3576_b An other instance from the “bugs which will bite you” series:

public class TestStatic {
    static class Foo {
        static Foo instance = new Foo();
        static String name = Foo.class.getName();

        public Foo() {
            System.err.println("Hello, my name is " + name);
        }
    }

    public static void main(String[] args) {
        System.err.println("Your name is ...
more ...

Spot the error

C++ compilers are notorious for giving error messages which point you in the wrong direction. However even simpler languages can have issues. Can you spot the real problem with the java code below?

abstract_java_error

There is a comma missing between the parameters! Nice, ey? (To be fair, on the sidebar Eclipse ...

more ...