lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccurr...@apache.org
Subject svn commit: r1325952 - in /incubator/lucene.net/trunk: src/core/ src/core/Index/ src/core/Search/ src/core/Search/Spans/ src/core/Store/ src/core/Util/ test/core/Index/
Date Fri, 13 Apr 2012 21:09:18 GMT
Author: ccurrens
Date: Fri Apr 13 21:09:17 2012
New Revision: 1325952

URL: http://svn.apache.org/viewvc?rev=1325952&view=rev
Log:
[LUCENENET-484] - Fixed TestConcurrentMergeScheduler.TestFlushExceptions to no longer intermittently fail.

Modified:
    incubator/lucene.net/trunk/src/core/Index/ConcurrentMergeScheduler.cs
    incubator/lucene.net/trunk/src/core/Lucene.Net.csproj
    incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs
    incubator/lucene.net/trunk/src/core/Search/FuzzyQuery.cs
    incubator/lucene.net/trunk/src/core/Search/MultiSearcher.cs
    incubator/lucene.net/trunk/src/core/Search/ParallelMultiSearcher.cs
    incubator/lucene.net/trunk/src/core/Search/ReqExclScorer.cs
    incubator/lucene.net/trunk/src/core/Search/Spans/TermSpans.cs
    incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs
    incubator/lucene.net/trunk/src/core/Store/FSDirectory.cs
    incubator/lucene.net/trunk/src/core/Store/FSLockFactory.cs
    incubator/lucene.net/trunk/src/core/Store/LockFactory.cs
    incubator/lucene.net/trunk/src/core/Store/MMapDirectory.cs
    incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs
    incubator/lucene.net/trunk/src/core/Store/SimpleFSDirectory.cs
    incubator/lucene.net/trunk/src/core/Store/SimpleFSLockFactory.cs
    incubator/lucene.net/trunk/src/core/Util/BitUtil.cs
    incubator/lucene.net/trunk/src/core/Util/OpenBitSetIterator.cs
    incubator/lucene.net/trunk/test/core/Index/TestConcurrentMergeScheduler.cs
    incubator/lucene.net/trunk/test/core/Index/TestFieldsReader.cs
    incubator/lucene.net/trunk/test/core/Index/TestIndexWriter.cs
    incubator/lucene.net/trunk/test/core/Index/TestIsCurrent.cs
    incubator/lucene.net/trunk/test/core/Index/TestSegmentMerger.cs
    incubator/lucene.net/trunk/test/core/Index/TestSegmentReader.cs
    incubator/lucene.net/trunk/test/core/Index/TestSegmentTermDocs.cs

Modified: incubator/lucene.net/trunk/src/core/Index/ConcurrentMergeScheduler.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Index/ConcurrentMergeScheduler.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Index/ConcurrentMergeScheduler.cs (original)
+++ incubator/lucene.net/trunk/src/core/Index/ConcurrentMergeScheduler.cs Fri Apr 13 21:09:17 2012
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 
+using System;
 using System.Collections.Generic;
 using Lucene.Net.Support;
 using Directory = Lucene.Net.Store.Directory;
@@ -402,7 +403,6 @@ namespace Lucene.Net.Index
 				}
 				catch (System.Exception exc)
 				{
-					
 					// Ignore the exception if it was due to abort:
 					if (!(exc is MergePolicy.MergeAbortedException))
 					{

Modified: incubator/lucene.net/trunk/src/core/Lucene.Net.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Lucene.Net.csproj?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Lucene.Net.csproj (original)
+++ incubator/lucene.net/trunk/src/core/Lucene.Net.csproj Fri Apr 13 21:09:17 2012
@@ -109,7 +109,7 @@
     <DebugType>pdbonly</DebugType>
     <ErrorReport>prompt</ErrorReport>
     <DebugSymbols>true</DebugSymbols>
-    <CodeAnalysisRuleSet>JustDesign.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
@@ -877,6 +877,7 @@
     </Compile>
     <Compile Include="Support\TextSupport.cs" />
     <Compile Include="Support\ThreadClass.cs" />
+    <Compile Include="Support\ThreadLock.cs" />
     <Compile Include="Support\WeakDictionary.cs" />
     <Compile Include="Support\WeakHashTable.cs" />
     <Compile Include="Support\WeakReference.cs" />

Modified: incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs Fri Apr 13 21:09:17 2012
@@ -82,31 +82,27 @@ namespace Lucene.Net.Search
 		{
 			return overlap / (float) maxOverlap;
 		}
-		
-		// Default false
-		protected internal bool discountOverlaps;
-		
-		/// <summary>Determines whether overlap tokens (Tokens with
-		/// 0 position increment) are ignored when computing
-		/// norm.  By default this is false, meaning overlap
-		/// tokens are counted just like non-overlap tokens.
-		/// 
-		/// <p/><b>WARNING</b>: This API is new and experimental, and may suddenly
-		/// change.<p/>
-		/// 
-		/// </summary>
-		/// <seealso cref="ComputeNorm">
-		/// </seealso>
-		public virtual void  SetDiscountOverlaps(bool v)
-		{
-			discountOverlaps = v;
-		}
 
 	    /// <seealso cref="SetDiscountOverlaps">
+        /// </seealso>
+        // Default false
+        protected internal bool discountOverlaps;
+
+	    /// <summary>Determines whether overlap tokens (Tokens with
+	    /// 0 position increment) are ignored when computing
+	    /// norm.  By default this is false, meaning overlap
+	    /// tokens are counted just like non-overlap tokens.
+	    /// 
+	    /// <p/><b>WARNING</b>: This API is new and experimental, and may suddenly
+	    /// change.<p/>
+	    /// 
+	    /// </summary>
+	    /// <seealso cref="ComputeNorm">
 	    /// </seealso>
 	    public virtual bool DiscountOverlaps
 	    {
 	        get { return discountOverlaps; }
+	        set { discountOverlaps = value; }
 	    }
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/src/core/Search/FuzzyQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/FuzzyQuery.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/FuzzyQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/FuzzyQuery.cs Fri Apr 13 21:09:17 2012
@@ -47,10 +47,11 @@ namespace Lucene.Net.Search
 		private float minimumSimilarity;
 		private int prefixLength;
 		private bool termLongEnough = false;
-		
-		protected internal Term term;
-		
-		/// <summary> Create a new FuzzyQuery that will match terms with a similarity 
+
+        /// <summary> Returns the pattern term.</summary>
+	    public Term Term { get; protected internal set; }
+
+	    /// <summary> Create a new FuzzyQuery that will match terms with a similarity 
 		/// of at least <c>minimumSimilarity</c> to <c>term</c>.
 		/// If a <c>prefixLength</c> &gt; 0 is specified, a common prefix
 		/// of that length is also required.
@@ -71,7 +72,7 @@ namespace Lucene.Net.Search
 		/// </summary>
 		public FuzzyQuery(Term term, float minimumSimilarity, int prefixLength)
 		{
-			this.term = term;
+			this.Term = term;
 			
 			if (minimumSimilarity >= 1.0f)
 				throw new System.ArgumentException("minimumSimilarity >= 1");
@@ -121,12 +122,6 @@ namespace Lucene.Net.Search
 			return new FuzzyTermEnum(reader, Term, minimumSimilarity, prefixLength);
 		}
 
-	    /// <summary> Returns the pattern term.</summary>
-	    public Term Term
-	    {
-	        get { return term; }
-	    }
-
 	    public override RewriteMethod RewriteMethod
 	    {
 	        set { throw new System.NotSupportedException("FuzzyQuery cannot change rewrite method"); }
@@ -137,7 +132,7 @@ namespace Lucene.Net.Search
 			if (!termLongEnough)
 			{
 				// can only match if it's exact
-				return new TermQuery(term);
+				return new TermQuery(Term);
 			}
 
 		    int maxSize = BooleanQuery.MaxClauseCount;
@@ -195,12 +190,12 @@ namespace Lucene.Net.Search
 		public override System.String ToString(System.String field)
 		{
 			System.Text.StringBuilder buffer = new System.Text.StringBuilder();
-			if (!term.Field.Equals(field))
+			if (!Term.Field.Equals(field))
 			{
-				buffer.Append(term.Field);
+				buffer.Append(Term.Field);
 				buffer.Append(":");
 			}
-			buffer.Append(term.Text);
+			buffer.Append(Term.Text);
 			buffer.Append('~');
 			buffer.Append(Single.ToString(minimumSimilarity));
 			buffer.Append(ToStringUtils.Boost(Boost));
@@ -231,7 +226,7 @@ namespace Lucene.Net.Search
 			int result = base.GetHashCode();
 			result = prime * result + BitConverter.ToInt32(BitConverter.GetBytes(minimumSimilarity), 0);
 			result = prime * result + prefixLength;
-			result = prime * result + ((term == null)?0:term.GetHashCode());
+			result = prime * result + ((Term == null)?0:Term.GetHashCode());
 			return result;
 		}
 		
@@ -248,12 +243,12 @@ namespace Lucene.Net.Search
 				return false;
 			if (prefixLength != other.prefixLength)
 				return false;
-			if (term == null)
+			if (Term == null)
 			{
-				if (other.term != null)
+				if (other.Term != null)
 					return false;
 			}
-			else if (!term.Equals(other.term))
+			else if (!Term.Equals(other.Term))
 				return false;
 			return true;
 		}

Modified: incubator/lucene.net/trunk/src/core/Search/MultiSearcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/MultiSearcher.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/MultiSearcher.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/MultiSearcher.cs Fri Apr 13 21:09:17 2012
@@ -18,6 +18,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using Lucene.Net.Support;
 using Lucene.Net.Util;
 using Document = Lucene.Net.Documents.Document;
 using FieldSelector = Lucene.Net.Documents.FieldSelector;
@@ -261,12 +262,13 @@ namespace Lucene.Net.Search
 		{
 			HitQueue hq = new HitQueue(nDocs, false);
 			int totalHits = 0;
-			
+
+            var lockObj = new object();
 			for (int i = 0; i < searchables.Length; i++)
 			{
-				// search each searcher
-                // use new object() for lock, we don't care about synchronization for these
-                TopDocs docs = MultiSearcherCallableNoSort(new object(), searchables[i], weight, filter, nDocs, hq, i, starts);
+                // search each searcher
+                // use NullLock, we don't care about synchronization for these
+                TopDocs docs = MultiSearcherCallableNoSort(ThreadLock.NullLock, lockObj, searchables[i], weight, filter, nDocs, hq, i, starts);
 				totalHits += docs.TotalHits; // update totalHits
 			}
 			
@@ -286,12 +288,13 @@ namespace Lucene.Net.Search
 			int totalHits = 0;
 			
 			float maxScore = System.Single.NegativeInfinity;
-			
+
+		    var lockObj = new object();
 			for (int i = 0; i < searchables.Length; i++)
 			{
 				// search each searcher
-                // use new object() for lock, we don't care about synchronization for these
-			    TopFieldDocs docs = MultiSearcherCallableWithSort(new object(), searchables[i], weight, filter, n, hq, sort,
+                // use NullLock, we don't care about synchronization for these
+                TopFieldDocs docs = MultiSearcherCallableWithSort(ThreadLock.NullLock, lockObj, searchables[i], weight, filter, n, hq, sort,
 			                                          i, starts);
 			    totalHits += docs.TotalHits;
 				maxScore = System.Math.Max(maxScore, docs.MaxScore);
@@ -310,11 +313,9 @@ namespace Lucene.Net.Search
 		{
 			for (int i = 0; i < searchables.Length; i++)
 			{
-				
 				int start = starts[i];
 				
 				Collector hc = new AnonymousClassCollector(collector, start, this);
-				
 				searchables[i].Search(weight, filter, hc);
 			}
 		}
@@ -384,8 +385,8 @@ namespace Lucene.Net.Search
 			return rewrittenQuery.Weight(cacheSim);
 		}
 
-	    internal Func<object, Searchable, Weight, Filter, int, HitQueue, int, int[], TopDocs> MultiSearcherCallableNoSort =
-	        (theLock, searchable, weight, filter, nDocs, hq, i, starts) =>
+	    internal Func<ThreadLock, object, Searchable, Weight, Filter, int, HitQueue, int, int[], TopDocs> MultiSearcherCallableNoSort =
+	        (threadLock, lockObj, searchable, weight, filter, nDocs, hq, i, starts) =>
 	            {
 	                TopDocs docs = searchable.Search(weight, filter, nDocs);
 	                ScoreDoc[] scoreDocs = docs.ScoreDocs;
@@ -394,17 +395,22 @@ namespace Lucene.Net.Search
                         ScoreDoc scoreDoc = scoreDocs[j];
                         scoreDoc.Doc += starts[i]; //convert doc
                         //it would be so nice if we had a thread-safe insert
-                        lock (theLock)
+                        try
                         {
+                            threadLock.Enter(lockObj);
                             if (scoreDoc == hq.InsertWithOverflow(scoreDoc))
                                 break;
                         }
+                        finally
+                        {
+                            threadLock.Exit(lockObj);
+                        }
                     }
 	                return docs;
 	            };
 
-        internal Func<object, Searchable, Weight, Filter, int, FieldDocSortedHitQueue, Sort, int, int[], TopFieldDocs>
-	        MultiSearcherCallableWithSort = (theLock, searchable, weight, filter, nDocs, hq, sort, i, starts) =>
+        internal Func<ThreadLock, object, Searchable, Weight, Filter, int, FieldDocSortedHitQueue, Sort, int, int[], TopFieldDocs>
+            MultiSearcherCallableWithSort = (threadLock, lockObj, searchable, weight, filter, nDocs, hq, sort, i, starts) =>
 	                                            {
 	                                                TopFieldDocs docs = searchable.Search(weight, filter, nDocs, sort);
                                                     // if one of the Sort fields is FIELD_DOC, need to fix its values, so that
@@ -423,11 +429,15 @@ namespace Lucene.Net.Search
                                                             break;
                                                         }
                                                     }
-
-                                                    lock (theLock)
+	                                                try
                                                     {
+                                                        threadLock.Enter(lockObj);
                                                         hq.SetFields(docs.fields);
-                                                    }
+	                                                }
+	                                                finally
+                                                    {
+                                                        threadLock.Exit(lockObj);
+	                                                }
 
 	                                                ScoreDoc[] scoreDocs = docs.ScoreDocs;
                                                     for (int j = 0; j < scoreDocs.Length; j++) // merge scoreDocs into hq
@@ -435,7 +445,7 @@ namespace Lucene.Net.Search
                                                         FieldDoc fieldDoc = (FieldDoc) scoreDocs[j];
                                                         fieldDoc.Doc += starts[i]; //convert doc
                                                         //it would be so nice if we had a thread-safe insert
-                                                        lock (theLock)
+                                                        lock (lockObj)
                                                         {
                                                             if (fieldDoc == hq.InsertWithOverflow(fieldDoc))
                                                                 break;

Modified: incubator/lucene.net/trunk/src/core/Search/ParallelMultiSearcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/ParallelMultiSearcher.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/ParallelMultiSearcher.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/ParallelMultiSearcher.cs Fri Apr 13 21:09:17 2012
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Linq;
 using Lucene.Net.Support;
@@ -117,12 +118,14 @@ namespace Lucene.Net.Search
             {
                 int cur = i;
                 tasks[i] =
-                    Task.Factory.StartNew(() => MultiSearcherCallableNoSort(lockObj, searchables[cur], weight, filter,
+                    Task.Factory.StartNew(() => MultiSearcherCallableNoSort(ThreadLock.MonitorLock, lockObj, searchables[cur], weight, filter,
                                                                             nDocs, hq, cur, starts));
             }
 
 		    int totalHits = 0;
 		    float maxScore = float.NegativeInfinity;
+            
+
 		    Task.WaitAll(tasks);
             foreach(TopDocs topDocs in tasks.Select(x => x.Result))
             {
@@ -153,19 +156,21 @@ namespace Lucene.Net.Search
             {
                 int cur = i;
                 tasks[i] =
-                    Task.Factory.StartNew(
-                        () => MultiSearcherCallableWithSort(lockObj, searchables[cur], weight, filter, nDocs, hq, sort, cur,
+                    Task<TopFieldDocs>.Factory.StartNew(
+                        () => MultiSearcherCallableWithSort(ThreadLock.MonitorLock, lockObj, searchables[cur], weight, filter, nDocs, hq, sort, cur,
                                                       starts));
             }
 
 		    int totalHits = 0;
 		    float maxScore = float.NegativeInfinity;
+
             Task.WaitAll(tasks);
             foreach (TopFieldDocs topFieldDocs in tasks.Select(x => x.Result))
             {
                 totalHits += topFieldDocs.TotalHits;
                 maxScore = Math.Max(maxScore, topFieldDocs.MaxScore);
             }
+
             ScoreDoc[] scoreDocs = new ScoreDoc[hq.Size()];
             for (int i = hq.Size() - 1; i >= 0; i--)
                 scoreDocs[i] = hq.Pop();

Modified: incubator/lucene.net/trunk/src/core/Search/ReqExclScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/ReqExclScorer.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/ReqExclScorer.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/ReqExclScorer.cs Fri Apr 13 21:09:17 2012
@@ -24,7 +24,7 @@ namespace Lucene.Net.Search
 	/// <summary>A Scorer for queries with a required subscorer
 	/// and an excluding (prohibited) sub DocIdSetIterator.
 	/// <br/>
-	/// This <c>Scorer</c> implements <see cref="DocIdSetIterator.SkipTo(int)" />,
+    /// This <c>Scorer</c> implements <see cref="DocIdSetIterator.Advance(int)" />,
 	/// and it uses the skipTo() on the given scorers.
 	/// </summary>
 	class ReqExclScorer:Scorer
@@ -110,7 +110,7 @@ namespace Lucene.Net.Search
 		}
 		
 		/// <summary>Returns the score of the current document matching the query.
-		/// Initially invalid, until <see cref="Next()" /> is called the first time.
+		/// Initially invalid, until <see cref="NextDoc()" /> is called the first time.
 		/// </summary>
 		/// <returns> The score of the required scorer.
 		/// </returns>

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/TermSpans.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/TermSpans.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/TermSpans.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/TermSpans.cs Fri Apr 13 21:09:17 2012
@@ -50,7 +50,7 @@ namespace Lucene.Net.Search.Spans
 			{
 				if (!positions.Next())
 				{
-					doc = System.Int32.MaxValue;
+					doc = int.MaxValue;
 					return false;
 				}
 				doc = positions.Doc;
@@ -66,7 +66,7 @@ namespace Lucene.Net.Search.Spans
 		{
 			if (!positions.SkipTo(target))
 			{
-				doc = System.Int32.MaxValue;
+				doc = int.MaxValue;
 				return false;
 			}
 			
@@ -101,7 +101,7 @@ namespace Lucene.Net.Search.Spans
 	    {
 	        byte[] bytes = new byte[positions.PayloadLength];
 	        bytes = positions.GetPayload(bytes, 0);
-	        System.Collections.Generic.List<byte[]> val = new System.Collections.Generic.List<byte[]>();
+	        var val = new System.Collections.Generic.List<byte[]>();
 	        val.Add(bytes);
 	        return val;
 	    }
@@ -118,7 +118,6 @@ namespace Lucene.Net.Search.Spans
 			return "spans(" + term.ToString() + ")@" + (doc == - 1?"START":((doc == System.Int32.MaxValue)?"END":doc + "-" + position));
 		}
 
-
 	    public virtual TermPositions Positions
 	    {
 	        get { return positions; }

Modified: incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs Fri Apr 13 21:09:17 2012
@@ -37,7 +37,7 @@ namespace Lucene.Net.Search
 		/// <summary> Default timer resolution.</summary>
 		/// <seealso cref="SetResolution(uint)">
 		/// </seealso>
-		public const uint DEFAULT_RESOLUTION = 20;
+		public const int DEFAULT_RESOLUTION = 20;
 		
 		/// <summary> Default for <see cref="IsGreedy()" />.</summary>
 		/// <seealso cref="IsGreedy()">

Modified: incubator/lucene.net/trunk/src/core/Store/FSDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Store/FSDirectory.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Store/FSDirectory.cs (original)
+++ incubator/lucene.net/trunk/src/core/Store/FSDirectory.cs Fri Apr 13 21:09:17 2012
@@ -123,17 +123,17 @@ namespace Lucene.Net.Store
 		{
 			if (!checked_Renamed)
 			{
-                if (!this.directory.Exists)
+                if (!this._directory.Exists)
                 {
                     try
                     {
-                        this.directory.Create();
+                        this._directory.Create();
                     }
                     catch (Exception)
                     {
-                        throw new System.IO.IOException("Cannot create directory: " + directory);
+                        throw new System.IO.IOException("Cannot create directory: " + _directory);
                     }
-                    this.directory.Refresh(); // need to see the creation
+                    this._directory.Refresh(); // need to see the creation
                 }
 				
 				checked_Renamed = true;
@@ -147,7 +147,7 @@ namespace Lucene.Net.Store
 		{
 			EnsureOpen();
 			CreateDir();
-			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
+			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name));
             if (file.Exists) // delete existing, if any
             {
                 try
@@ -162,7 +162,7 @@ namespace Lucene.Net.Store
 		}
 		
 		/// <summary>The underlying filesystem directory </summary>
-		protected internal System.IO.DirectoryInfo directory = null;
+		protected internal System.IO.DirectoryInfo _directory = null;
 		
 		/// <summary>Create a new FSDirectory for the named location (ctor for subclasses).</summary>
 		/// <param name="path">the path of the directory
@@ -183,12 +183,12 @@ namespace Lucene.Net.Store
             // system property Lucene.Net.Store.FSDirectoryLockFactoryClass is set,
             // instantiate that; else, use SimpleFSLockFactory:
 
-            directory = path;
+            _directory = path;
 
             // due to differences in how Java & .NET refer to files, the checks are a bit different
-            if (!directory.Exists && System.IO.File.Exists(directory.FullName))
+            if (!_directory.Exists && System.IO.File.Exists(_directory.FullName))
             {
-                throw new NoSuchDirectoryException("file '" + directory.FullName + "' exists but is not a directory");
+                throw new NoSuchDirectoryException("file '" + _directory.FullName + "' exists but is not a directory");
             }
             SetLockFactory(lockFactory);
             
@@ -201,10 +201,10 @@ namespace Lucene.Net.Store
                 // if the lock factory has no lockDir set, use the this directory as lockDir
                 if (dir == null)
                 {
-                    lf.LockDir = this.directory;
+                    lf.LockDir = this._directory;
                     lf.LockPrefix = null;
                 }
-                else if (dir.FullName.Equals(this.directory.FullName))
+                else if (dir.FullName.Equals(this._directory.FullName))
                 {
                     lf.LockPrefix = null;
                 }
@@ -303,14 +303,14 @@ namespace Lucene.Net.Store
 		public override System.String[] ListAll()
 		{
 			EnsureOpen();
-			return ListAll(directory);
+			return ListAll(_directory);
 		}
 		
 		/// <summary>Returns true iff a file with the given name exists. </summary>
 		public override bool FileExists(System.String name)
 		{
 			EnsureOpen();
-			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
+			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name));
             return file.Exists;
 		}
 		
@@ -318,7 +318,7 @@ namespace Lucene.Net.Store
 		public override long FileModified(System.String name)
 		{
 			EnsureOpen();
-			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
+			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name));
             return (long)file.LastWriteTime.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds; //{{LUCENENET-353}}
 		}
 		
@@ -333,7 +333,7 @@ namespace Lucene.Net.Store
 		public override void  TouchFile(System.String name)
 		{
 			EnsureOpen();
-			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
+			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name));
 			file.LastWriteTime = System.DateTime.Now;
 		}
 		
@@ -341,7 +341,7 @@ namespace Lucene.Net.Store
 		public override long FileLength(System.String name)
 		{
 			EnsureOpen();
-			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
+			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name));
 			return file.Exists ? file.Length : 0;
 		}
 		
@@ -349,7 +349,7 @@ namespace Lucene.Net.Store
 		public override void  DeleteFile(System.String name)
 		{
 			EnsureOpen();
-			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
+			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name));
             try
             {
                 file.Delete();
@@ -363,7 +363,7 @@ namespace Lucene.Net.Store
 		public override void  Sync(System.String name)
 		{
 			EnsureOpen();
-			System.IO.FileInfo fullFile = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
+			System.IO.FileInfo fullFile = new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name));
 			bool success = false;
 			int retryCount = 0;
 			System.IO.IOException exc = null;
@@ -427,7 +427,7 @@ namespace Lucene.Net.Store
 	        System.String dirName; // name to be hashed
 	        try
 	        {
-	            dirName = directory.FullName;
+	            dirName = _directory.FullName;
 	        }
 	        catch (System.IO.IOException e)
 	        {
@@ -467,14 +467,14 @@ namespace Lucene.Net.Store
 	        get
 	        {
 	            EnsureOpen();
-	            return directory;
+	            return _directory;
 	        }
 	    }
 
 	    /// <summary>For debug output. </summary>
 		public override System.String ToString()
 		{
-            return this.GetType().FullName + "@" + directory + " lockFactory=" + LockFactory;
+            return this.GetType().FullName + "@" + _directory + " lockFactory=" + LockFactory;
 		}
 		
 		/// <summary> Default read chunk size.  This is a conditional

Modified: incubator/lucene.net/trunk/src/core/Store/FSLockFactory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Store/FSLockFactory.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Store/FSLockFactory.cs (original)
+++ incubator/lucene.net/trunk/src/core/Store/FSLockFactory.cs Fri Apr 13 21:09:17 2012
@@ -27,7 +27,7 @@ namespace Lucene.Net.Store
 	{
 		
 		/// <summary> Directory for the lock files.</summary>
-		protected internal System.IO.DirectoryInfo lockDir = null;
+		protected internal System.IO.DirectoryInfo _lockDir = null;
 
         /// <summary> Gets the lock directory.
         /// <para>Subclasses can use this to set the lock directory.
@@ -40,12 +40,12 @@ namespace Lucene.Net.Store
         /// </summary>
 	    public virtual DirectoryInfo LockDir
 	    {
-	        get { return lockDir; }
+	        get { return _lockDir; }
 	        protected internal set
 	        {
-	            if (this.lockDir != null)
+	            if (this._lockDir != null)
 	                throw new System.SystemException("You can set the lock directory for this factory only once.");
-	            this.lockDir = value;
+	            this._lockDir = value;
 	        }
 	    }
 	}

Modified: incubator/lucene.net/trunk/src/core/Store/LockFactory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Store/LockFactory.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Store/LockFactory.cs (original)
+++ incubator/lucene.net/trunk/src/core/Store/LockFactory.cs Fri Apr 13 21:09:17 2012
@@ -38,8 +38,7 @@ namespace Lucene.Net.Store
 	
 	public abstract class LockFactory
 	{
-		
-		protected internal System.String lockPrefix = null;
+		protected internal System.String _lockPrefix = null;
 
 	    /// <summary> Gets or sets the prefix in use for all locks created in this
 	    /// LockFactory.  This is normally called once, when a
@@ -52,8 +51,8 @@ namespace Lucene.Net.Store
 	    /// </summary>
 	    public virtual string LockPrefix
 	    {
-	        get { return this.lockPrefix; }
-	        set { this.lockPrefix = value; }
+	        get { return this._lockPrefix; }
+	        set { this._lockPrefix = value; }
 	    }
 
 	    /// <summary> Return a new Lock instance identified by lockName.</summary>

Modified: incubator/lucene.net/trunk/src/core/Store/MMapDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Store/MMapDirectory.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Store/MMapDirectory.cs (original)
+++ incubator/lucene.net/trunk/src/core/Store/MMapDirectory.cs Fri Apr 13 21:09:17 2012
@@ -504,7 +504,7 @@ namespace Lucene.Net.Store
 		public override IndexOutput CreateOutput(System.String name)
 		{
 			InitOutput(name);
-			return new SimpleFSDirectory.SimpleFSIndexOutput(new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name)));
+			return new SimpleFSDirectory.SimpleFSIndexOutput(new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name)));
 		}
 		static MMapDirectory()
 		{

Modified: incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs (original)
+++ incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs Fri Apr 13 21:09:17 2012
@@ -88,9 +88,9 @@ namespace Lucene.Net.Store
 		{
 			lock (this)
 			{
-				if (lockPrefix != null)
-					lockName = lockPrefix + "-" + lockName;
-				return new NativeFSLock(lockDir, lockName);
+				if (_lockPrefix != null)
+					lockName = _lockPrefix + "-" + lockName;
+				return new NativeFSLock(_lockDir, lockName);
 			}
 		}
 		
@@ -101,17 +101,17 @@ namespace Lucene.Net.Store
 			// they are locked, but, still do this in case people
 			// really want to see the files go away:
 			bool tmpBool;
-			if (System.IO.File.Exists(lockDir.FullName))
+			if (System.IO.File.Exists(_lockDir.FullName))
 				tmpBool = true;
 			else
-				tmpBool = System.IO.Directory.Exists(lockDir.FullName);
+				tmpBool = System.IO.Directory.Exists(_lockDir.FullName);
 			if (tmpBool)
 			{
-				if (lockPrefix != null)
+				if (_lockPrefix != null)
 				{
-					lockName = lockPrefix + "-" + lockName;
+					lockName = _lockPrefix + "-" + lockName;
 				}
-				System.IO.FileInfo lockFile = new System.IO.FileInfo(System.IO.Path.Combine(lockDir.FullName, lockName));
+				System.IO.FileInfo lockFile = new System.IO.FileInfo(System.IO.Path.Combine(_lockDir.FullName, lockName));
 				bool tmpBool2;
 				if (System.IO.File.Exists(lockFile.FullName))
 					tmpBool2 = true;

Modified: incubator/lucene.net/trunk/src/core/Store/SimpleFSDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Store/SimpleFSDirectory.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Store/SimpleFSDirectory.cs (original)
+++ incubator/lucene.net/trunk/src/core/Store/SimpleFSDirectory.cs Fri Apr 13 21:09:17 2012
@@ -56,7 +56,7 @@ namespace Lucene.Net.Store
 		public override IndexOutput CreateOutput(System.String name)
 		{
 			InitOutput(name);
-			return new SimpleFSIndexOutput(new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name)));
+			return new SimpleFSIndexOutput(new System.IO.FileInfo(System.IO.Path.Combine(_directory.FullName, name)));
 		}
 		
 		/// <summary>Creates an IndexInput for the file with the given name. </summary>
@@ -70,7 +70,7 @@ namespace Lucene.Net.Store
                 try
                 {
                     return new SimpleFSIndexInput(new System.IO.FileInfo(
-                        System.IO.Path.Combine(directory.FullName, name)), bufferSize, ReadChunkSize);
+                        System.IO.Path.Combine(_directory.FullName, name)), bufferSize, ReadChunkSize);
                 }
                 catch (System.UnauthorizedAccessException ex)
                 {

Modified: incubator/lucene.net/trunk/src/core/Store/SimpleFSLockFactory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Store/SimpleFSLockFactory.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Store/SimpleFSLockFactory.cs (original)
+++ incubator/lucene.net/trunk/src/core/Store/SimpleFSLockFactory.cs Fri Apr 13 21:09:17 2012
@@ -81,27 +81,27 @@ namespace Lucene.Net.Store
 		
 		public override Lock MakeLock(System.String lockName)
 		{
-			if (lockPrefix != null)
+			if (_lockPrefix != null)
 			{
-				lockName = lockPrefix + "-" + lockName;
+				lockName = _lockPrefix + "-" + lockName;
 			}
-			return new SimpleFSLock(lockDir, lockName);
+			return new SimpleFSLock(_lockDir, lockName);
 		}
 		
 		public override void  ClearLock(System.String lockName)
 		{
 			bool tmpBool;
-			if (System.IO.File.Exists(lockDir.FullName))
+			if (System.IO.File.Exists(_lockDir.FullName))
 				tmpBool = true;
 			else
-				tmpBool = System.IO.Directory.Exists(lockDir.FullName);
+				tmpBool = System.IO.Directory.Exists(_lockDir.FullName);
 			if (tmpBool)
 			{
-				if (lockPrefix != null)
+				if (_lockPrefix != null)
 				{
-					lockName = lockPrefix + "-" + lockName;
+					lockName = _lockPrefix + "-" + lockName;
 				}
-				System.IO.FileInfo lockFile = new System.IO.FileInfo(System.IO.Path.Combine(lockDir.FullName, lockName));
+				System.IO.FileInfo lockFile = new System.IO.FileInfo(System.IO.Path.Combine(_lockDir.FullName, lockName));
 				bool tmpBool2;
 				if (System.IO.File.Exists(lockFile.FullName))
 					tmpBool2 = true;

Modified: incubator/lucene.net/trunk/src/core/Util/BitUtil.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Util/BitUtil.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Util/BitUtil.cs (original)
+++ incubator/lucene.net/trunk/src/core/Util/BitUtil.cs Fri Apr 13 21:09:17 2012
@@ -702,8 +702,24 @@ namespace Lucene.Net.Util
 		return i
 		print ','.join([ str(ntz(i)) for i in range(256) ])
 		***/
-		/// <summary>table of number of trailing zeros in a byte </summary>
-		public static readonly sbyte[] ntzTable = new sbyte[]{8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0};
+
+	    /// <summary>table of number of trailing zeros in a byte </summary>
+	    //
+	    public static readonly byte[] ntzTable = new byte[]
+	                                                  {
+	                                                      8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1,
+	                                                      0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0,
+	                                                      1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2,
+	                                                      0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0,
+	                                                      2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1,
+	                                                      0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 7, 0, 1, 0, 2, 0, 1, 0, 3, 0,
+	                                                      1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5,
+	                                                      0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0,
+	                                                      3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1,
+	                                                      0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0,
+	                                                      1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2,
+	                                                      0, 1, 0
+	                                                  };
 		
 		
 		/// <summary>Returns number of trailing zeros in a 64 bit long value. </summary>

Modified: incubator/lucene.net/trunk/src/core/Util/OpenBitSetIterator.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Util/OpenBitSetIterator.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Util/OpenBitSetIterator.cs (original)
+++ incubator/lucene.net/trunk/src/core/Util/OpenBitSetIterator.cs Fri Apr 13 21:09:17 2012
@@ -37,7 +37,8 @@ namespace Lucene.Net.Util
 		// packed inside a 32 bit integer (8 4 bit numbers).  That
 		// should be faster than accessing an array for each index, and
 		// the total array size is kept smaller (256*sizeof(int))=1K
-	    protected internal static readonly uint[] bitlist = new uint[]
+        // NOTE: Removed protected access for CLS-Compliance
+	    /*protected*/ internal static readonly uint[] bitlist = new uint[]
 	                                                            {
 	                                                                0x0, 0x1, 0x2, 0x21, 0x3, 0x31, 0x32, 0x321, 0x4, 0x41,
 	                                                                0x42, 0x421, 0x43, 0x431, 0x432, 0x4321, 0x5, 0x51,

Modified: incubator/lucene.net/trunk/test/core/Index/TestConcurrentMergeScheduler.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Index/TestConcurrentMergeScheduler.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Index/TestConcurrentMergeScheduler.cs (original)
+++ incubator/lucene.net/trunk/test/core/Index/TestConcurrentMergeScheduler.cs Fri Apr 13 21:09:17 2012
@@ -38,22 +38,22 @@ namespace Lucene.Net.Index
 		
 		private class FailOnlyOnFlush:MockRAMDirectory.Failure
 		{
-			internal bool doFail;
-		    internal bool hitExc;
+			//internal new bool doFail;
+		    internal volatile bool hitExc;
 			
-			public virtual void  SetDoFail()
+			public override void SetDoFail()
 			{
                 this.doFail = true;
                 hitExc = false;
 			}
-			public virtual void  ClearDoFail()
+            public override void ClearDoFail()
 			{
 				this.doFail = false;
 			}
 			
 			public override void  Eval(MockRAMDirectory dir)
 			{
-				if (doFail)// && Thread.CurrentThread.Name.Equals("main")) // TODO: This does not work -cc
+                if (doFail && !(Thread.CurrentThread.Name ?? "").Contains("Merge Thread"))
 				{
 					System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace();
 					for (int i = 0; i < trace.FrameCount; i++)
@@ -62,7 +62,7 @@ namespace Lucene.Net.Index
 						if ("DoFlush".Equals(sf.GetMethod().Name))
 						{
 						    hitExc = true;
-							//new RuntimeException().printStackTrace(System.out);
+						    //Console.WriteLine(trace);
 							throw new System.IO.IOException("now failing during flush");
 						}
 					}
@@ -72,30 +72,29 @@ namespace Lucene.Net.Index
 		
 		// Make sure running BG merges still work fine even when
 		// we are hitting exceptions during flushing.
-		[Test]
-		public virtual void  TestFlushExceptions()
-		{
-			
-			MockRAMDirectory directory = new MockRAMDirectory();
-			FailOnlyOnFlush failure = new FailOnlyOnFlush();
-			directory.FailOn(failure);
+        [Test]
+        public virtual void TestFlushExceptions()
+        {
+            MockRAMDirectory directory = new MockRAMDirectory();
+            FailOnlyOnFlush failure = new FailOnlyOnFlush();
+            directory.FailOn(failure);
 
             IndexWriter writer = new IndexWriter(directory, ANALYZER, true, IndexWriter.MaxFieldLength.UNLIMITED);
-			ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
-			writer.SetMergeScheduler(cms);
-			writer.SetMaxBufferedDocs(2);
-			Document doc = new Document();
-			Field idField = new Field("id", "", Field.Store.YES, Field.Index.NOT_ANALYZED);
-			doc.Add(idField);
-		    int extraCount = 0;
+            ConcurrentMergeScheduler cms = new ConcurrentMergeScheduler();
+            writer.SetMergeScheduler(cms);
+            writer.SetMaxBufferedDocs(2);
+            Document doc = new Document();
+            Field idField = new Field("id", "", Field.Store.YES, Field.Index.NOT_ANALYZED);
+            doc.Add(idField);
+            int extraCount = 0;
 
-			for (int i = 0; i < 10; i++)
-			{
-				for (int j = 0; j < 20; j++)
-				{
-					idField.SetValue(System.Convert.ToString(i * 20 + j));
-					writer.AddDocument(doc);
-				}
+            for (int i = 0; i < 10; i++)
+            {
+                for (int j = 0; j < 20; j++)
+                {
+                    idField.SetValue(System.Convert.ToString(i*20 + j));
+                    writer.AddDocument(doc);
+                }
 
                 while (true)
                 {
@@ -107,7 +106,7 @@ namespace Lucene.Net.Index
                     try
                     {
                         writer.Flush(true, false, true);
-                        if(failure.hitExc)
+                        if (failure.hitExc)
                             Assert.Fail("failed to hit IOException");
                         extraCount++;
                     }
@@ -117,16 +116,16 @@ namespace Lucene.Net.Index
                         break;
                     }
                 }
-			}
-			
-			writer.Close();
-			IndexReader reader = IndexReader.Open(directory, true);
-			Assert.AreEqual(200+extraCount, reader.NumDocs());
-			reader.Close();
-			directory.Close();
-		}
-		
-		// Test that deletes committed after a merge started and
+            }
+
+            writer.Close();
+            IndexReader reader = IndexReader.Open(directory, true);
+            Assert.AreEqual(200 + extraCount, reader.NumDocs());
+            reader.Close();
+            directory.Close();
+        }
+
+	    // Test that deletes committed after a merge started and
 		// before it finishes, are correctly merged back:
 		[Test]
 		public virtual void  TestDeleteMerging()

Modified: incubator/lucene.net/trunk/test/core/Index/TestFieldsReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Index/TestFieldsReader.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Index/TestFieldsReader.cs (original)
+++ incubator/lucene.net/trunk/test/core/Index/TestFieldsReader.cs Fri Apr 13 21:09:17 2012
@@ -96,7 +96,7 @@ namespace Lucene.Net.Index
 		}
 
         [TearDown]
-        public void TearDown()
+        public override void TearDown()
         {
             fieldInfos = null;
             testDoc = new Document();

Modified: incubator/lucene.net/trunk/test/core/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Index/TestIndexWriter.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/trunk/test/core/Index/TestIndexWriter.cs Fri Apr 13 21:09:17 2012
@@ -2362,14 +2362,14 @@ namespace Lucene.Net.Index
 
         private class FailOnlyOnFlush : MockRAMDirectory.Failure
         {
-            internal bool doFail = false;
+            internal new bool doFail = false;
             internal int count;
 
-            public virtual void SetDoFail()
+            public override void SetDoFail()
             {
                 this.doFail = true;
             }
-            public virtual void ClearDoFail()
+            public override void ClearDoFail()
             {
                 this.doFail = false;
             }

Modified: incubator/lucene.net/trunk/test/core/Index/TestIsCurrent.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Index/TestIsCurrent.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Index/TestIsCurrent.cs (original)
+++ incubator/lucene.net/trunk/test/core/Index/TestIsCurrent.cs Fri Apr 13 21:09:17 2012
@@ -38,7 +38,7 @@ namespace Lucene.Net.Index
         private Random rand;
 
         [SetUp]
-        public void SetUp()
+        public override void SetUp()
         {
             base.SetUp();
 
@@ -54,7 +54,7 @@ namespace Lucene.Net.Index
         }
 
         [TearDown]
-        public void TearDown()
+        public override void TearDown()
         {
             base.TearDown();
             writer.Close();

Modified: incubator/lucene.net/trunk/test/core/Index/TestSegmentMerger.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Index/TestSegmentMerger.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Index/TestSegmentMerger.cs (original)
+++ incubator/lucene.net/trunk/test/core/Index/TestSegmentMerger.cs Fri Apr 13 21:09:17 2012
@@ -64,7 +64,7 @@ namespace Lucene.Net.Index
 		}
 
         [TearDown]
-        public void TearDown()
+        public override void TearDown()
         {
             mergedDir = new RAMDirectory();
             merge1Dir = new RAMDirectory();

Modified: incubator/lucene.net/trunk/test/core/Index/TestSegmentReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Index/TestSegmentReader.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Index/TestSegmentReader.cs (original)
+++ incubator/lucene.net/trunk/test/core/Index/TestSegmentReader.cs Fri Apr 13 21:09:17 2012
@@ -53,7 +53,7 @@ namespace Lucene.Net.Index
 		}
 
         [TearDown]
-        public void TearDown()
+        public override void TearDown()
         {
             dir = new RAMDirectory();
 		    testDoc = new Document();

Modified: incubator/lucene.net/trunk/test/core/Index/TestSegmentTermDocs.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Index/TestSegmentTermDocs.cs?rev=1325952&r1=1325951&r2=1325952&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Index/TestSegmentTermDocs.cs (original)
+++ incubator/lucene.net/trunk/test/core/Index/TestSegmentTermDocs.cs Fri Apr 13 21:09:17 2012
@@ -54,7 +54,7 @@ namespace Lucene.Net.Index
 		}
 
         [TearDown]
-        public void TearDown()
+        public override void TearDown()
         {
             testDoc = new Document();
 		    dir = new RAMDirectory();



Mime
View raw message