This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/master by this push:
     new 20b887e  BUG: Fixed several references to J2N.BitConversion that were 
calling the overload that normalizes NaN when they should have been calling the 
raw bit conversion instead.
20b887e is described below

commit 20b887e4add8a34a69a8dc873ba19a575729e2c5
Author: Shad Storhaug <[email protected]>
AuthorDate: Mon Sep 14 10:11:56 2020 +0700

    BUG: Fixed several references to J2N.BitConversion that were calling the 
overload that normalizes NaN when they should have been calling the raw bit 
conversion instead.
---
 src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs | 2 +-
 src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs | 2 +-
 src/Lucene.Net/Document/FloatDocValuesField.cs                    | 4 ++--
 src/Lucene.Net/Search/Spans/FieldMaskingSpanQuery.cs              | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs 
b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
index 4e65680..4b9fa84 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
@@ -161,7 +161,7 @@ namespace Lucene.Net.Index
                         Assert.AreEqual(text, hitDoc.Get("fieldname"));
                         if (Debugging.AssertsEnabled) 
Debugging.Assert(ireader.Leaves.Count == 1);
                         NumericDocValues dv = 
((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv");
-                        
Assert.AreEqual((long)J2N.BitConversion.SingleToInt32Bits(5.7f), 
dv.Get(hits.ScoreDocs[i].Doc)); // LUCENENET specific - cast required because 
types don't match (xUnit checks this)
+                        
Assert.AreEqual((long)J2N.BitConversion.SingleToRawInt32Bits(5.7f), 
dv.Get(hits.ScoreDocs[i].Doc)); // LUCENENET specific - cast required because 
types don't match (xUnit checks this)
                     }
                 } // ireader.Dispose();
             } // directory.Dispose();
diff --git a/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs 
b/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs
index 43d8acb..b6390c2 100644
--- a/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs
+++ b/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs
@@ -708,7 +708,7 @@ namespace Lucene.Net.Codecs.Compressing
             // start offsets
             for (int i = 0; i < fieldNums.Length; ++i)
             {
-                
vectorsStream.WriteInt32(J2N.BitConversion.SingleToInt32Bits(charsPerTerm[i]));
+                
vectorsStream.WriteInt32(J2N.BitConversion.SingleToRawInt32Bits(charsPerTerm[i]));
             }
 
             writer.Reset(vectorsStream);
diff --git a/src/Lucene.Net/Document/FloatDocValuesField.cs 
b/src/Lucene.Net/Document/FloatDocValuesField.cs
index 7c78190..00d7d83 100644
--- a/src/Lucene.Net/Document/FloatDocValuesField.cs
+++ b/src/Lucene.Net/Document/FloatDocValuesField.cs
@@ -43,13 +43,13 @@ namespace Lucene.Net.Documents
         /// <param name="value"> 32-bit <see cref="float"/> value </param>
         /// <exception cref="ArgumentNullException"> if the field name is 
<c>null</c> </exception>
         public SingleDocValuesField(string name, float value)
-            : base(name, BitConversion.SingleToInt32Bits(value))
+            : base(name, BitConversion.SingleToRawInt32Bits(value))
         {
         }
 
         public override void SetSingleValue(float value)
         {
-            base.SetInt64Value(BitConversion.SingleToInt32Bits(value));
+            base.SetInt64Value(BitConversion.SingleToRawInt32Bits(value));
         }
 
         public override void SetInt64Value(long value)
diff --git a/src/Lucene.Net/Search/Spans/FieldMaskingSpanQuery.cs 
b/src/Lucene.Net/Search/Spans/FieldMaskingSpanQuery.cs
index b98af6f..135af94 100644
--- a/src/Lucene.Net/Search/Spans/FieldMaskingSpanQuery.cs
+++ b/src/Lucene.Net/Search/Spans/FieldMaskingSpanQuery.cs
@@ -149,7 +149,7 @@ namespace Lucene.Net.Search.Spans
 
         public override int GetHashCode()
         {
-            return MaskedQuery.GetHashCode() ^ Field.GetHashCode() ^ 
J2N.BitConversion.SingleToInt32Bits(Boost);
+            return MaskedQuery.GetHashCode() ^ Field.GetHashCode() ^ 
J2N.BitConversion.SingleToRawInt32Bits(Boost);
         }
     }
 }
\ No newline at end of file

Reply via email to