lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Tregenna <luc...@rekenys.com>
Subject Re: Lucene.Net 1.9 RC1 Build 4 beta is ready
Date Thu, 15 Jun 2006 06:30:10 GMT
George Aroush wrote:

>Thanks Ben, that did it!
>
>If you have cycles and can take on other open issues, please do.
>
>
>  
>
OK, another one -
The TestNumberTools are failing as the expectation from the java tests 
are that you convert longs to base36 strings and the NumberTools was 
converting them to base16. I reckon that was done because 
System.Convert.ToInt6() only takes bases up to 16, but fortunately 
SupportClass.Number has methods for doing base 36 so using that and 
changing the base/radix in NumberTools back to 36 fixes the failures in 
TestNumberTools. See below for patch....

Ben

Index: NumberTools.cs
===================================================================
--- NumberTools.cs    (revision 414223)
+++ NumberTools.cs    (working copy)
@@ -37,7 +37,7 @@
     public class NumberTools
     {
        
-        private const int RADIX = 16; // 36;    {{Arousdh-1.9}} Java's 
is 36, but .NET's is 16; will this be an issue?
+        private const int RADIX = 36; // 36;    {{Arousdh-1.9}} Java's 
is 36, but .NET's is 16; will this be an issue?
        
         private const char NEGATIVE_PREFIX = '-';
        
@@ -75,7 +75,7 @@
             {
                 buf.Append(POSITIVE_PREFIX);
             }
-            System.String num = System.Convert.ToString(l, RADIX);
+            System.String num = SupportClass.Number.ToString(l, RADIX);
            
             int padLen = STR_SIZE - num.Length - buf.Length;
             while (padLen-- > 0)
@@ -115,7 +115,7 @@
             }
            
             char prefix = str[0];
-            long l = System.Convert.ToInt64(str.Substring(1), RADIX);
+            long l = SupportClass.Number.Parse(str.Substring(1), RADIX);
            
             if (prefix == POSITIVE_PREFIX)
             {



Mime
View raw message