You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@visi.com> on 2007/02/13 09:46:54 UTC

Eating exceptions -- wanna help?

So one of the things we need to clean up in our codebase is places  
where we catch an exception and throw a new exception but do *not*  
keep the original exception.

I attempted to grep for this and found that pretty much impossible to  
do, so instead I hacked up something with ASM to check the code in  
openejb-core for places where we are constructing something of type  
Throwable using the single string constructor.  I.e. places where we  
are potentially "eating" exceptions.

   the list:  http://cwiki.apache.org/OPENEJB/hungry-exceptions.html

There are likely several mentioned in that list that are legitimate  
usages of "new Exception(myString)"  Typically that'd be code that  
checks for a certain state and throws an exception if the condition  
is not met -- there really is no "original" exception as that *is*  
the original exception.  But pretty much everything else should get  
fixed.

I'm tempted to create JIRAs for each class so we always have a  
current list, but I'm hesitant as it could get out of sync with svn  
really fast.  We'd have to work through the list really fast to make  
that a good idea.  What do people think?

Who is interested in helping?  I definitely plan to fix what I can.

-David


Re: Eating exceptions -- wanna help?

Posted by Manu George <ma...@gmail.com>.
Hi Dave,
           I am signing up too :). Can spare some time tomorrow night.

Regards
Manu

On 2/13/07, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
> On 2/13/07, David Blevins <da...@visi.com> wrote:
>
> > I attempted to grep for this and found that pretty much impossible to
> > do, so instead I hacked up something with ASM to check the code in
> > openejb-core for places where we are constructing something of type
> > Throwable using the single string constructor.  I.e. places where we
> > are potentially "eating" exceptions.
>
> Hi Dave,
>
> Could you demonstrate the code? I'm just curious how easy it is with
> ASM. I'd use AspectJ oraz AspectWerkz (not available anymore) and as I
> have never used ASM I'd be happy to take a look at the sample of
> yours.
>
>
>
> > I'm tempted to create JIRAs for each class so we always have a
> > current list, but I'm hesitant as it could get out of sync with svn
> > really fast.  We'd have to work through the list really fast to make
> > that a good idea.  What do people think?
>
> Go and raise issues. I'll take care of some tonight.
>
> Jacek
>
> --
> Jacek Laskowski
> http://www.JacekLaskowski.pl
>

Re: Eating exceptions -- wanna help?

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 2/13/07, David Blevins <da...@visi.com> wrote:

> I attempted to grep for this and found that pretty much impossible to
> do, so instead I hacked up something with ASM to check the code in
> openejb-core for places where we are constructing something of type
> Throwable using the single string constructor.  I.e. places where we
> are potentially "eating" exceptions.

Hi Dave,

Could you demonstrate the code? I'm just curious how easy it is with
ASM. I'd use AspectJ oraz AspectWerkz (not available anymore) and as I
have never used ASM I'd be happy to take a look at the sample of
yours.



> I'm tempted to create JIRAs for each class so we always have a
> current list, but I'm hesitant as it could get out of sync with svn
> really fast.  We'd have to work through the list really fast to make
> that a good idea.  What do people think?

Go and raise issues. I'll take care of some tonight.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: Eating exceptions -- wanna help?

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi David...

Did I miss this task, I could not find JIRAs related to this task ???



On 2/15/07, David Blevins <da...@visi.com> wrote:

> I'll break these up in to a few large JIRA issues.
>
> -David
>
> On Feb 14, 2007, at 4:53 AM, Mohammad Nour El-Din wrote:
>
> > Hi All...
> >
> > It would be my honor to share the effort with you, but I have one
> > question,
> > did you agree upon how is going to be shared among us ? just not to
> > take
> > something while someone else is working on it .
> >
> >
> >
> > On 2/14/07, Raj Saini <ra...@gmail.com> wrote:
> >
> >> I can also take up few of them during the weekend.
> >>
> >> Thanks,
> >>
> >> Raj
> >> David Blevins wrote:
> >> > So one of the things we need to clean up in our codebase is places
> >> > where we catch an exception and throw a new exception but do *not*
> >> > keep the original exception.
> >> >
> >> > I attempted to grep for this and found that pretty much
> >> impossible to
> >> > do, so instead I hacked up something with ASM to check the code in
> >> > openejb-core for places where we are constructing something of type
> >> > Throwable using the single string constructor.  I.e. places
> >> where we
> >> > are potentially "eating" exceptions.
> >> >
> >> >   the list:  http://cwiki.apache.org/OPENEJB/hungry-exceptions.html
> >> >
> >> > There are likely several mentioned in that list that are legitimate
> >> > usages of "new Exception(myString)"  Typically that'd be code that
> >> > checks for a certain state and throws an exception if the
> >> condition is
> >> > not met -- there really is no "original" exception as that *is* the
> >> > original exception.  But pretty much everything else should get
> >> fixed.
> >> >
> >> > I'm tempted to create JIRAs for each class so we always have a
> >> current
> >> > list, but I'm hesitant as it could get out of sync with svn really
> >> > fast.  We'd have to work through the list really fast to make
> >> that a
> >> > good idea.  What do people think?
> >> >
> >> > Who is interested in helping?  I definitely plan to fix what I can.
> >> >
> >> > -David
> >> >
> >> >
> >>
> >>
> >
> >
> > --
> > Thanks
> > - Mohammad Nour
>
>


-- 
Thanks
- Mohammad Nour

Re: Eating exceptions -- wanna help?

Posted by David Blevins <da...@visi.com>.
I'll break these up in to a few large JIRA issues.

-David

On Feb 14, 2007, at 4:53 AM, Mohammad Nour El-Din wrote:

> Hi All...
>
> It would be my honor to share the effort with you, but I have one  
> question,
> did you agree upon how is going to be shared among us ? just not to  
> take
> something while someone else is working on it .
>
>
>
> On 2/14/07, Raj Saini <ra...@gmail.com> wrote:
>
>> I can also take up few of them during the weekend.
>>
>> Thanks,
>>
>> Raj
>> David Blevins wrote:
>> > So one of the things we need to clean up in our codebase is places
>> > where we catch an exception and throw a new exception but do *not*
>> > keep the original exception.
>> >
>> > I attempted to grep for this and found that pretty much  
>> impossible to
>> > do, so instead I hacked up something with ASM to check the code in
>> > openejb-core for places where we are constructing something of type
>> > Throwable using the single string constructor.  I.e. places  
>> where we
>> > are potentially "eating" exceptions.
>> >
>> >   the list:  http://cwiki.apache.org/OPENEJB/hungry-exceptions.html
>> >
>> > There are likely several mentioned in that list that are legitimate
>> > usages of "new Exception(myString)"  Typically that'd be code that
>> > checks for a certain state and throws an exception if the  
>> condition is
>> > not met -- there really is no "original" exception as that *is* the
>> > original exception.  But pretty much everything else should get  
>> fixed.
>> >
>> > I'm tempted to create JIRAs for each class so we always have a  
>> current
>> > list, but I'm hesitant as it could get out of sync with svn really
>> > fast.  We'd have to work through the list really fast to make  
>> that a
>> > good idea.  What do people think?
>> >
>> > Who is interested in helping?  I definitely plan to fix what I can.
>> >
>> > -David
>> >
>> >
>>
>>
>
>
> -- 
> Thanks
> - Mohammad Nour


Re: Eating exceptions -- wanna help?

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi All...

It would be my honor to share the effort with you, but I have one question,
did you agree upon how is going to be shared among us ? just not to take
something while someone else is working on it .



On 2/14/07, Raj Saini <ra...@gmail.com> wrote:

> I can also take up few of them during the weekend.
>
> Thanks,
>
> Raj
> David Blevins wrote:
> > So one of the things we need to clean up in our codebase is places
> > where we catch an exception and throw a new exception but do *not*
> > keep the original exception.
> >
> > I attempted to grep for this and found that pretty much impossible to
> > do, so instead I hacked up something with ASM to check the code in
> > openejb-core for places where we are constructing something of type
> > Throwable using the single string constructor.  I.e. places where we
> > are potentially "eating" exceptions.
> >
> >   the list:  http://cwiki.apache.org/OPENEJB/hungry-exceptions.html
> >
> > There are likely several mentioned in that list that are legitimate
> > usages of "new Exception(myString)"  Typically that'd be code that
> > checks for a certain state and throws an exception if the condition is
> > not met -- there really is no "original" exception as that *is* the
> > original exception.  But pretty much everything else should get fixed.
> >
> > I'm tempted to create JIRAs for each class so we always have a current
> > list, but I'm hesitant as it could get out of sync with svn really
> > fast.  We'd have to work through the list really fast to make that a
> > good idea.  What do people think?
> >
> > Who is interested in helping?  I definitely plan to fix what I can.
> >
> > -David
> >
> >
>
>


-- 
Thanks
- Mohammad Nour

Re: Eating exceptions -- wanna help?

Posted by Raj Saini <ra...@gmail.com>.
I can also take up few of them during the weekend.

Thanks,

Raj
David Blevins wrote:
> So one of the things we need to clean up in our codebase is places 
> where we catch an exception and throw a new exception but do *not* 
> keep the original exception.
>
> I attempted to grep for this and found that pretty much impossible to 
> do, so instead I hacked up something with ASM to check the code in 
> openejb-core for places where we are constructing something of type 
> Throwable using the single string constructor.  I.e. places where we 
> are potentially "eating" exceptions.
>
>   the list:  http://cwiki.apache.org/OPENEJB/hungry-exceptions.html
>
> There are likely several mentioned in that list that are legitimate 
> usages of "new Exception(myString)"  Typically that'd be code that 
> checks for a certain state and throws an exception if the condition is 
> not met -- there really is no "original" exception as that *is* the 
> original exception.  But pretty much everything else should get fixed.
>
> I'm tempted to create JIRAs for each class so we always have a current 
> list, but I'm hesitant as it could get out of sync with svn really 
> fast.  We'd have to work through the list really fast to make that a 
> good idea.  What do people think?
>
> Who is interested in helping?  I definitely plan to fix what I can.
>
> -David
>
>