That link works for me? ... and redirects me to:

http://216.121.112.228/


-----Original Message----- From: MarcGerritsen
Sent: Monday, May 02, 2011 8:54 AM
To: nhibernate-development
Subject: [nhibernate-development] Re: Bug: unnecessary proxy initialisation in CriteriaQueryTranslator

Is the JIRA down or am i looking in the wrong place?
http://jira.nhforge.org/

On 2 mei, 00:30, Fabio Maulo <[email protected]> wrote:
Please, can you file a new JIRA ticket ?
Thanks.

On Sun, May 1, 2011 at 6:10 PM, MarcGerritsen <[email protected]>wrote:









> Hello,

> I found a bug in the CriteriaQueryTranslator.
> For the construction of a debug string the ToString method is calld on
> a proxy.
> This initializes the proxy unnecessary.
> To make sure this does not happen anymore i wrapped the logger lines
> with if (logger.IsDebugEnabled).
> Below I give you the patch created to fix the bug.

> Marc Gerritsen

> Index: CriteriaQueryTranslator.cs
> ===================================================================
> --- CriteriaQueryTranslator.cs  (revision 5792)
> +++ CriteriaQueryTranslator.cs  (working copy)
> @@ -313,7 +313,8 @@
>                {
>                        ICriteria result;
>                        associationPathCriteriaMap.TryGetValue(path, out
> result);
> -                       logger.DebugFormat("getCriteria for path={0}
> crit={1}", path,
> result);
> +            if (logger.IsDebugEnabled)
> +                           logger.DebugFormat("getCriteria for path={0}
> crit={1}", path,
> result);
>                        return result;
>                }

> @@ -498,7 +499,8 @@
>                        foreach (string token in tokens)
>                        {
>                                componentPath += token;
> -                               logger.DebugFormat("searching for {0}",
> componentPath);
> +                if (logger.IsDebugEnabled)
> + logger.DebugFormat("searching for > {0}",
> componentPath);
>                                IType type =
> provider.GetType(componentPath);
>                                if (type.IsAssociationType)
>                                {
> @@ -535,9 +537,9 @@
>                                        throw new QueryException("not an
> association: " +
> componentPath);
>                                }
>                        }
> -
> - logger.DebugFormat("returning entity name={0} > for
> path={1}
> class={2}",
> -                               provider.Name, path,
> provider.GetType().Name);
> +            if (logger.IsDebugEnabled)
> + logger.DebugFormat("returning entity > name={0}
> for path={1}
> class={2}",
> +                                   provider.Name, path,
> provider.GetType().Name);
>                        return provider;
>                }

> @@ -554,8 +556,9 @@
>                                        alias = me.Value.Name; // the
> entity name
>                                }
>                                criteriaSQLAliasMap[crit] =
> StringHelper.GenerateAlias(alias, i+
> +);
> -                               logger.DebugFormat("put criteria={0}
> alias={1}",
> - crit, > criteriaSQLAliasMap[crit]);
> +                if(logger.IsDebugEnabled)
> +                                   logger.DebugFormat("put criteria={0}
> alias={1}",
> +                                           crit,
> criteriaSQLAliasMap[crit]);
>                        }
>                        criteriaSQLAliasMap[rootCriteria] = rootSQLAlias;
>                }
> @@ -568,7 +571,8 @@
>                public string GetSQLAlias(ICriteria criteria)
>                {
>                        String alias = criteriaSQLAliasMap[criteria];
> -                       logger.DebugFormat("returning alias={0} for
> criteria={1}", alias,
> criteria);
> +            if (logger.IsDebugEnabled)
> +                           logger.DebugFormat("returning alias={0} for
> criteria={1}",
> alias, criteria);
>                        return alias;
>                }

--
Fabio Maulo

Reply via email to