Monday, January 08, 2007

ClassCastException - why so coy?


Well it seems that 23% of the people who read this blog read it because they searched for the term "classcastexception".

If you are reading this because you are having trouble with a ClassCastException I suggest you try searching for "troubleshooting classcastexception" or something like that instead, it might also be a good idea to add the name of the class or product which is causing your pain. You could also read some of my other posts on the subject here.

But I'm going to say this again anyway...

Why doesn't ClassCastException have a constructor takes two objects and outputs the message "Can't cast xx.xx.xx to yy.yy.yy at" so that we can find out what couldn't be cast to what simply by applying our reading skills to the message and not having to
a) read the stack trace and
b) attach a debugger just to find out what the wrong type was.

I see this bug registered with Sun, so obviously someone else cares too, but not that much because it has been in-progress since june 2004.

The last time I blogged about CCE I got a comment, but it wasn't wholly supportive it just said "Get any Desired College Degree, In less then 2 weeks.!"


Comments:

blog comments powered by Disqus

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)