On Thu, Apr 1, 2010 at 9:23 AM, Carsten Ziegeler <[email protected]> wrote: > Bertrand Delacretaz wrote >> ... void getSomething() { >> if(...something bad happened...) { >> throw new >> PackageFooBarClassWizMethodGetSomethingProblemComputeException (...);...
> ...Great idea, +1 - now, actually I started to use this two years ago in my > Catapult prototype....but never finished this.... Ah yes, Catapult...I should have a look, there were great ideas in there! > > ...But I think we can go one bit further: the location alone is only one > part of the story. The other part is the current "input" which means > parameters passed into the method, local variables, instance variables > etc. I think we should add some more bytecode stuff which adds all the > contents of these variables to the exception.... Wow...now this adds another dimension, excellent! The exception names might get a bit long then...maybe the exception name should be just an md5 of the aggregated info (package, class name, method, input variables, VM stack, moon phase etc.) with a utility that would rebuild the full exception class name with a double reverse hashed lookup. > ...who likes debugging anyway? As soon as an exception > is thrown you get the full range of information in your face and can > immediately see what's wrong.... Right, this could speed up development in a dramatic way. Anyone got contacts at the JCP? This definitely sounds like a new standard in the making. Food for thought.... -Bertrand
