I think that might be some old code remaining from some previous test (I looked the source code of the JDK and just for this snippet and the way you are doing, the only explanation for this is an old code which was overriding the wrong method). The stacktrace might help to guarantee that.