[ 
https://issues.apache.org/jira/browse/LOG4NET-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ron Grabowski updated LOG4NET-95:
---------------------------------

    Fix Version/s: 1.2.11

> Level.CompareTo() may result a wrong Value -> sorting of Levels does not work
> -----------------------------------------------------------------------------
>
>                 Key: LOG4NET-95
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-95
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.10
>         Environment: VS2005 C#
>            Reporter: Bernd Klaiber
>            Assignee: Ron Grabowski
>            Priority: Minor
>             Fix For: 1.2.11
>
>
> I want to show a sorted list of available Levels.
> The sort routine uses Level.Compare(Level l, Level r).
> The result might be wrong when comparing ALL to another Level, because there 
> is an overflow when just subtracting the m_levelValue.
> try to call the integer compare method:
> Level.cs:
>               public static int Compare(Level l, Level r)
>               {
>                       ...
>                         //orig: return l.m_levelValue - r.m_levelValue;  -> 
> bug when int overflow
>                       return l.m_levelValue.CompareTo(r.m_levelValue);
>               }
> hope this helps.
> best regards, Bernd.

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

Reply via email to