The REAL WTF here is that the title of the WTF reads "Classic WTF: Implements ISwissArmyKnife". I see two problems with this title.

First: You've got a syntax error here. "Implements" should be "implements" (no capital i).
Second: Prepending an 'I' or any other prefix to indicate a type to a class name or interface is considered bad practice in Java and violates the Sun Java naming conventions.

The REAL WTF here is that the title of the WTF reads "Classic WTF: Implements ISwissArmyKnife". I see two problems with this title.

First: You've got a syntax error here. "Implements" should be "implements" (no capital i).
Second: Prepending an 'I' or any other prefix to indicate a type to a class name or interface is considered bad practice in Java and violates the Sun Java naming conventions.

How would that make it any better? The problem is clearly that this object has far too much responsibility than it should. 'Proper callback function pointers' won't fix that - only better design will fix that.

Still not seeing the problem -- like another poster said, sounds like UI code. You've got your main window in your application waiting for input, like a secretary with 14 phones at her desk. Maybe the design should be split up with multiple secretaries answering smaller groups of phones, but maybe the phones don't ring that often and the 14-line receptionist is the best answer to the problem. Without a bit more body in the "//snip", I can't accept this one as a WTF (yet).

Still not seeing the problem -- like another poster said, sounds like UI code. You've got your main window in your application waiting for input, like a secretary with 14 phones at her desk. Maybe the design should be split up with multiple secretaries answering smaller groups of phones, but maybe the phones don't ring that often and the 14-line receptionist is the best answer to the problem. Without a bit more body in the "//snip", I can't accept this one as a WTF (yet).

The problem isn't that the developer wrote it this way, its that Java requires it to be written this way. And the fact that people seem to think there couldn't be a better way is one of the best arguments that closures need to be implemented in Java.

How would that make it any better? The problem is clearly that this object has far too much responsibility than it should. 'Proper callback function pointers' won't fix that - only better design will fix that.

My minimal fix would involve a bunch of private classes that implement various interfaces and talk to the object in question. But yeah, you gotta split that up a bit.

I used that as an attempt to provide some constructive criticism of a coworker's class, and he took it as a compliment. I said to him, "That class does quite alot, isn' that a little bit of a golden hammer?" He goes, "Yeah, isn't it neat!"