lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r881848 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs
Date Wed, 18 Nov 2009 17:45:54 GMT
Author: digy
Date: Wed Nov 18 17:45:54 2009
New Revision: 881848

URL: http://svn.apache.org/viewvc?rev=881848&view=rev
Log:
LUCENENET-282 Handle potential overflow in LogByteSizeMergePolicy.SetMaxMergeMB

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs?rev=881848&r1=881847&r2=881848&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs Wed Nov 18
17:45:54 2009
@@ -61,7 +61,12 @@
 		/// </summary>
 		public virtual void  SetMaxMergeMB(double mb)
 		{
+            //mgarski: java gracefully overflows to Int64.MaxValue, .NET to MinValue...
 			maxMergeSize = (long) (mb * 1024 * 1024);
+            if (maxMergeSize < 0)
+            {
+                maxMergeSize = DEFAULT_MAX_MERGE_MB;
+            }
 		}
 		
 		/// <summary>Returns the largest segment (meaured by total byte



Mime
View raw message