Thursday, April 06, 2006

ClassCastException


Why can't the message from ClassCastException tell us what class couldn't be cast into what other
Class?

I've said it before, but it still does my head in so I'm saying it again..

I know that you can put this into your message, but how many times do *other peoples* exeptions have this information in them?
Come to think of it why didn't Sun make ClassCastException have a constructor with arguments for two classes and a message:

ClassCastException(Class from, Class into, String message)

I mean, this one thing would probably save billions of man hours worldwide as people wouldn't need to compile in extra debug output or step through their programmes in the debugger.


I know nothing, I'm not a fortune teller, and you'd be insane to think that I am. This disclaimer was cribbed from an email footer I once received. It is so ridiculous I had to have it for myself.

Statements in this blog that are not purely historical are forward-looking statements including, without limitation, statements regarding my expectations, objectives, anticipations, plans, hopes, beliefs, intentions or strategies regarding the future. Factors that could cause actual results to differ materially from the forward looking statements include risks and uncertainties such as any unforeseen event or any unforeseen system failures, and other risks. It is important to note that actual outcomes could differ materially from those in such forward-looking statements.

Danny Angus Copyright © 2006-2013 (OMG that's seven years of this nonsense)