You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2010/04/01 09:38:59 UTC
Re: [RT] Using strong patterned prefixes (SPP) for exception class
names
On Thu, Apr 1, 2010 at 9:23 AM, Carsten Ziegeler <cz...@apache.org> 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
Re: [RT] Using strong patterned prefixes (SPP) for exception class
names
Posted by Michael Dürig <mi...@day.com>.
> 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.
I mentioned the md5 approach a while back on the Jackrabbit list [1]: an
advantage of md5 is that it would automatically serve as hash tag for
search engines: searching for an md5 would lead to forum
posts/FAQs/mailing lists/manuals where the issue is discussed. Searching
for md5s would result in much fewer false positives than searching i.e.
for "SlingException". To see what I mean Google for "error 0x800cccdd"
and for "error 1" and compare the results.
Of course some care would have to be taken to include the correct
information in the md5 in order not to be overly specific or general.
Michael
[1] http://markmail.org/message/zthaqbeciu7lom6z