You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Kevin Sutter (JIRA)" <ji...@apache.org> on 2009/01/28 21:40:59 UTC

[jira] Created: (OPENJPA-877) Findbugs problems with our generated enhanced code

Findbugs problems with our generated enhanced code
--------------------------------------------------

                 Key: OPENJPA-877
                 URL: https://issues.apache.org/jira/browse/OPENJPA-877
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
            Reporter: Kevin Sutter


A co-worker "accidentally" ran findbugs against some openjpa bytecode enhanced Entities and found a few issues.  This JIRA Issue will be used to document his findings:

=======================================
We recently started running Findbugs to try to find problems. Due to the way we did this we ended up running it against some JPA enhanced entities, rather than the pre-enhanced classes and Findbugs picks up some "problems".

One problem it picks up is that there is a method with a Boolean return type that returns null. I guess this complaint comes in because that can cause an NPE if it were to be autoboxed.
The other problem is that there is some code doing something like new Integer(2) rather than Integer.valueOf(2), the latter having better performance because it caches.

Both these "problems" are introduced by the JPA enhancement so I am not worried about them and will disable these checks, but I thought I would let you know what I found.
=======================================

Thanks,
Kevin

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (OPENJPA-877) Findbugs problems with our generated enhanced code

Posted by Kevin Sutter <kw...@gmail.com>.
:-)  Yes, that's the reason for the JIRA...  I didn't have time to fix it
right now, so I opened the JIRA.  Or, am I missing the intent of your note?

Kevin

On Wed, Jan 28, 2009 at 3:16 PM, Evan Ireland <ei...@sybase.com> wrote:

> Kevin,
>
> Wouldn't you want the enhancer changed to use Integer.valueOf(...)?
>
> > -----Original Message-----
> > From: Kevin Sutter (JIRA) [mailto:jira@apache.org]
> > Sent: Thursday, 29 January 2009 9:41 a.m.
> > To: dev@openjpa.apache.org
> > Subject: [jira] Created: (OPENJPA-877) Findbugs problems with our
> > generated enhanced code
> >
> > Findbugs problems with our generated enhanced code
> > --------------------------------------------------
> >
> >                  Key: OPENJPA-877
> >                  URL: https://issues.apache.org/jira/browse/OPENJPA-877
> >              Project: OpenJPA
> >           Issue Type: Bug
> >           Components: kernel
> >             Reporter: Kevin Sutter
> >
> >
> > A co-worker "accidentally" ran findbugs against some openjpa bytecode
> > enhanced Entities and found a few issues.  This JIRA Issue will be used
> to
> > document his findings:
> >
> > =======================================
> > We recently started running Findbugs to try to find problems. Due to the
> > way we did this we ended up running it against some JPA enhanced
> entities,
> > rather than the pre-enhanced classes and Findbugs picks up some
> > "problems".
> >
> > One problem it picks up is that there is a method with a Boolean return
> > type that returns null. I guess this complaint comes in because that can
> > cause an NPE if it were to be autoboxed.
> > The other problem is that there is some code doing something like new
> > Integer(2) rather than Integer.valueOf(2), the latter having better
> > performance because it caches.
> >
> > Both these "problems" are introduced by the JPA enhancement so I am not
> > worried about them and will disable these checks, but I thought I would
> > let you know what I found.
> > =======================================
> >
> > Thanks,
> > Kevin
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
>
>
>

RE: [jira] Created: (OPENJPA-877) Findbugs problems with our generated enhanced code

Posted by Evan Ireland <ei...@sybase.com>.
Kevin,

Wouldn't you want the enhancer changed to use Integer.valueOf(...)?

> -----Original Message-----
> From: Kevin Sutter (JIRA) [mailto:jira@apache.org]
> Sent: Thursday, 29 January 2009 9:41 a.m.
> To: dev@openjpa.apache.org
> Subject: [jira] Created: (OPENJPA-877) Findbugs problems with our
> generated enhanced code
> 
> Findbugs problems with our generated enhanced code
> --------------------------------------------------
> 
>                  Key: OPENJPA-877
>                  URL: https://issues.apache.org/jira/browse/OPENJPA-877
>              Project: OpenJPA
>           Issue Type: Bug
>           Components: kernel
>             Reporter: Kevin Sutter
> 
> 
> A co-worker "accidentally" ran findbugs against some openjpa bytecode
> enhanced Entities and found a few issues.  This JIRA Issue will be used to
> document his findings:
> 
> =======================================
> We recently started running Findbugs to try to find problems. Due to the
> way we did this we ended up running it against some JPA enhanced entities,
> rather than the pre-enhanced classes and Findbugs picks up some
> "problems".
> 
> One problem it picks up is that there is a method with a Boolean return
> type that returns null. I guess this complaint comes in because that can
> cause an NPE if it were to be autoboxed.
> The other problem is that there is some code doing something like new
> Integer(2) rather than Integer.valueOf(2), the latter having better
> performance because it caches.
> 
> Both these "problems" are introduced by the JPA enhancement so I am not
> worried about them and will disable these checks, but I thought I would
> let you know what I found.
> =======================================
> 
> Thanks,
> Kevin
> 
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.