lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r912418 - /lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/TopScoreDocCollector.cs
Date Sun, 21 Feb 2010 22:19:06 GMT
Author: digy
Date: Sun Feb 21 22:19:05 2010
New Revision: 912418

URL: http://svn.apache.org/viewvc?rev=912418&view=rev
Log:
Changes for "LUCENE-2271: Fix javadocs of TopScoreDocCollector"

Modified:
    lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/TopScoreDocCollector.cs

Modified: lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/TopScoreDocCollector.cs
URL: http://svn.apache.org/viewvc/lucene/lucene.net/trunk/C%23/src/Lucene.Net/Search/TopScoreDocCollector.cs?rev=912418&r1=912417&r2=912418&view=diff
==============================================================================
--- lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/TopScoreDocCollector.cs (original)
+++ lucene/lucene.net/trunk/C#/src/Lucene.Net/Search/TopScoreDocCollector.cs Sun Feb 21 22:19:05
2010
@@ -29,10 +29,10 @@
 	/// instance of this collector you should know in advance whether documents are
 	/// going to be collected in doc Id order or not.
 	/// 
-	/// <p/><b>NOTE</b>: The values Float.Nan,
-	/// Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY are
-	/// not valid scores.  This collector will not properly
-	/// collect hits with such scores.
+	/// <p/><b>NOTE</b>: The values {@link Float#NaN} and
+    /// {Float#NEGATIVE_INFINITY} are not valid scores.  This
+    /// collector will not properly collect hits with such
+    /// scores.
 	/// </summary>
 	public abstract class TopScoreDocCollector:TopDocsCollector
 	{
@@ -47,6 +47,11 @@
 			public override void  Collect(int doc)
 			{
 				float score = scorer.Score();
+                
+                // This collector cannot handle these scores:
+                System.Diagnostics.Debug.Assert(score != float.NegativeInfinity);
+                System.Diagnostics.Debug.Assert(!float.IsNaN(score));
+
 				totalHits++;
 				if (score <= pqTop.score)
 				{
@@ -76,6 +81,10 @@
 			public override void  Collect(int doc)
 			{
 				float score = scorer.Score();
+
+                // This collector cannot handle NaN
+                System.Diagnostics.Debug.Assert(!float.IsNaN(score));
+
 				totalHits++;
 				doc += docBase;
 				if (score < pqTop.score || (score == pqTop.score && doc > pqTop.doc))



Mime
View raw message