You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Patrick Linskey <pl...@gmail.com> on 2007/08/08 18:45:24 UTC

Possible bug in EntityManagerFactoryImpl

Hi,

EntityManagerFactoryImpl.toFetchPlan() begins like so:

    FetchPlan toFetchPlan(Broker broker, FetchConfiguration fetch) {
        if (fetch == null)
            return null;

        FetchConfiguration inner = fetch;
        if (inner instanceof DelegatingFetchConfiguration)
            inner = ((DelegatingFetchConfiguration) inner).
                getInnermostDelegate();


However, we never use 'inner'. Does anyone have any insight into
whether we should just remove the inner-related lines, or if we should
remove the 'inner' variable and reassign 'fetch' instead?

-Patrick

-- 
Patrick Linskey
202 669 5907

Re: Possible bug in EntityManagerFactoryImpl

Posted by Patrick Linskey <pl...@gmail.com>.
I just noticed it while I was working on the API stuff last night.

-Patrick

On 8/8/07, Marc Prud'hommeaux <mp...@apache.org> wrote:
> Patrick-
>
> That certainly looks like a bug to me. My only guess is that we
> should be assigning the innermost delegate to "fetch", although it
> does look like someone very intentionally was storing it in another
> variable.
>
> Did you happen to find this with findbugs, code inspection, or did it
> actually cause a visible problem?
>
>
> On Aug 8, 2007, at 9:45 AM, Patrick Linskey wrote:
>
> > Hi,
> >
> > EntityManagerFactoryImpl.toFetchPlan() begins like so:
> >
> >     FetchPlan toFetchPlan(Broker broker, FetchConfiguration fetch) {
> >         if (fetch == null)
> >             return null;
> >
> >         FetchConfiguration inner = fetch;
> >         if (inner instanceof DelegatingFetchConfiguration)
> >             inner = ((DelegatingFetchConfiguration) inner).
> >                 getInnermostDelegate();
> >
> >
> > However, we never use 'inner'. Does anyone have any insight into
> > whether we should just remove the inner-related lines, or if we should
> > remove the 'inner' variable and reassign 'fetch' instead?
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > 202 669 5907
>
>


-- 
Patrick Linskey
202 669 5907

Re: Possible bug in EntityManagerFactoryImpl

Posted by Marc Prud'hommeaux <mp...@apache.org>.
Patrick-

That certainly looks like a bug to me. My only guess is that we  
should be assigning the innermost delegate to "fetch", although it  
does look like someone very intentionally was storing it in another  
variable.

Did you happen to find this with findbugs, code inspection, or did it  
actually cause a visible problem?


On Aug 8, 2007, at 9:45 AM, Patrick Linskey wrote:

> Hi,
>
> EntityManagerFactoryImpl.toFetchPlan() begins like so:
>
>     FetchPlan toFetchPlan(Broker broker, FetchConfiguration fetch) {
>         if (fetch == null)
>             return null;
>
>         FetchConfiguration inner = fetch;
>         if (inner instanceof DelegatingFetchConfiguration)
>             inner = ((DelegatingFetchConfiguration) inner).
>                 getInnermostDelegate();
>
>
> However, we never use 'inner'. Does anyone have any insight into
> whether we should just remove the inner-related lines, or if we should
> remove the 'inner' variable and reassign 'fetch' instead?
>
> -Patrick
>
> -- 
> Patrick Linskey
> 202 669 5907