lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccurr...@apache.org
Subject [Lucene.Net] svn commit: r1235645 [1/2] - in /incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk: src/contrib/Analyzers/CJK/ src/core/ src/core/Analysis/ src/core/Index/ src/core/QueryParser/ src/core/Search/ src/core/Search/Function/ src/core/Store/ src/core/Sup...
Date Wed, 25 Jan 2012 07:01:47 GMT
Author: ccurrens
Date: Wed Jan 25 07:01:45 2012
New Revision: 1235645

URL: http://svn.apache.org/viewvc?rev=1235645&view=rev
Log:
[LUCENENET-468] - Implemented Dispose in Analyzer and Store namespaces, dabbled with Index namespace
[LUCENENET-446] - Fixed some naming issues for *some* CLS compliance, mainly with Index/TopDocs.cs 

Modified:
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/contrib/Analyzers/CJK/CJKTokenizer.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Analyzer.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/BaseCharFilter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharFilter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharReader.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharStream.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharTokenizer.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/MappingCharFilter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenFilter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenStream.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenizer.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/AbstractAllTermDocs.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ByteSliceReader.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/CompoundFileReader.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/LogMergePolicy.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MergePolicy.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MultiLevelSkipListReader.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermDocs.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Lucene.Net.csproj
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParser.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParserConstants.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilterManager.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSet.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSetIterator.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredTermEnum.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Function/FieldCacheSource.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FuzzyQuery.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiSearcher.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiTermQuery.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/ParallelMultiSearcher.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Similarity.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/TopDocs.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/WildcardQuery.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/BufferedIndexInput.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/CheckSumIndexInput.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/Directory.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FSDirectory.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FileSwitchDirectory.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/IndexInput.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/Lock.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/MMapDirectory.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/RAMDirectory.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/RAMFile.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/RAMInputStream.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/SimpleFSDirectory.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Support/CloseableThreadLocalProfiler.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/contrib/Highlighter/HighlighterTest.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Analysis/TestCharFilter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/MockIndexInput.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestFieldsReader.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestLazyProxSkipping.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestMultiLevelSkipList.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestPayloads.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestFieldCacheRangeFilter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestFuzzyQuery.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestTermRangeFilter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/MockRAMDirectory.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/MockRAMInputStream.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Store/TestBufferedIndexInput.cs

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/contrib/Analyzers/CJK/CJKTokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/contrib/Analyzers/CJK/CJKTokenizer.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/contrib/Analyzers/CJK/CJKTokenizer.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/contrib/Analyzers/CJK/CJKTokenizer.cs Wed Jan 25 07:01:45 2012
@@ -293,7 +293,7 @@ namespace Lucene.Net.Analysis.CJK
                         }
                         else if (length > 0)
                         {
-                            if (preIsTokened == true)
+                            if (preIsTokened)
                             {
                                 length = 0;
                                 preIsTokened = false;

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Analyzer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Analyzer.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Analyzer.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Analyzer.cs Wed Jan 25 07:01:45 2012
@@ -50,6 +50,7 @@ namespace Lucene.Net.Analysis
 		}
 		
 		private CloseableThreadLocal<Object> tokenStreams = new CloseableThreadLocal<Object>();
+	    private bool isDisposed;
 		
 		/// <summary>Used by Analyzers that implement reusableTokenStream
 		/// to retrieve previously saved TokenStreams for re-use
@@ -175,20 +176,29 @@ namespace Lucene.Net.Analysis
 		}
 		
 		/// <summary>Frees persistent resources used by this Analyzer </summary>
-		public virtual void  Close()
+		public void  Close()
 		{
 		    Dispose();
 		}
 
-        // TODO: The whole Close calling Dispose thing isn't a good idea
-        //       We should convert all Close methods to Dispose; .net friendly
         public virtual void Dispose()
         {
-            if (tokenStreams != null)
+            Dispose(true);
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (isDisposed) return;
+
+            if (disposing)
             {
-                tokenStreams.Close();
-                tokenStreams = null;
+                if (tokenStreams != null)
+                {
+                    tokenStreams.Close();
+                    tokenStreams = null;
+                }
             }
+            isDisposed = true;
         }
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/BaseCharFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/BaseCharFilter.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/BaseCharFilter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/BaseCharFilter.cs Wed Jan 25 07:01:45 2012
@@ -35,13 +35,13 @@ namespace Lucene.Net.Analysis
         private int[] diffs;
         private int size = 0;
 
-        public BaseCharFilter(CharStream @in) : base(@in)
+        protected BaseCharFilter(CharStream @in) : base(@in)
         {
         }
 
         /** Retrieve the corrected offset. */
         //@Override
-        public override int Correct(int currentOff)
+        protected internal override int Correct(int currentOff)
         {
             if (offsets == null || currentOff < offsets[0])
             {

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharFilter.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharFilter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharFilter.cs Wed Jan 25 07:01:45 2012
@@ -32,7 +32,7 @@ namespace Lucene.Net.Analysis
 	public abstract class CharFilter : CharStream
 	{
         private long currentPosition = -1;
-		
+	    private bool isDisposed;
 		protected internal CharStream input;
 		
 		protected internal CharFilter(CharStream in_Renamed) : base(in_Renamed)
@@ -40,15 +40,11 @@ namespace Lucene.Net.Analysis
 			input = in_Renamed;
 		}
 		
-		/// <summary> Subclass may want to override to correct the current offset.
-		/// 
-		/// </summary>
-		/// <param name="currentOff">current offset
-		/// </param>
-		/// <returns> corrected offset
-		/// </returns>
-		public /*protected internal*/ virtual int Correct(int currentOff)
-		{
+		/// <summary>Subclass may want to override to correct the current offset.</summary>
+		/// <param name="currentOff">current offset</param>
+		/// <returns>corrected offset</returns>
+		protected internal virtual int Correct(int currentOff)
+        {
 			return currentOff;
 		}
 		
@@ -59,30 +55,42 @@ namespace Lucene.Net.Analysis
 		{
 			return input.CorrectOffset(Correct(currentOff));
 		}
+
+        protected override void Dispose(bool disposing)
+        {
+            if (isDisposed) return;
+
+            if (disposing)
+            {
+                if (input != null)
+                {
+                    input.Close();
+                }
+            }
+
+            input = null;
+            isDisposed = true;
+            base.Dispose(disposing);
+        }
 		
-		public override void  Close()
-		{
-			input.Close();
-		}
-		
-		public  override int Read(System.Char[] cbuf, int off, int len)
-		{
+		public override int Read(System.Char[] cbuf, int off, int len)
+        {
 			return input.Read(cbuf, off, len);
 		}
 		
 		public bool MarkSupported()
-		{
+        {
             return input.BaseStream.CanSeek;
 		}
 		
-		public void  Mark(int readAheadLimit)
-		{
+		public void Mark(int readAheadLimit)
+        {
             currentPosition = input.BaseStream.Position;
 			input.BaseStream.Position = readAheadLimit;
 		}
 		
-		public void  Reset()
-		{
+		public void Reset()
+        {
 			input.BaseStream.Position = currentPosition;
 		}
 	}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharReader.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharReader.cs Wed Jan 25 07:01:45 2012
@@ -28,7 +28,9 @@ namespace Lucene.Net.Analysis
 	public sealed class CharReader:CharStream
 	{
         private long currentPosition = -1;
-		
+
+	    private bool isDisposed;
+
 		internal System.IO.StreamReader input;
 		
 		public static CharStream Get(System.IO.TextReader input)
@@ -53,11 +55,23 @@ namespace Lucene.Net.Analysis
 		{
 			return currentOff;
 		}
-		
-		public override void  Close()
-		{
-			input.Close();
-		}
+
+        protected override void Dispose(bool disposing)
+        {
+            if (isDisposed) return;
+
+            if (disposing)
+            {
+                if (input != null)
+                {
+                    input.Close();
+                }
+            }
+
+            input = null;
+            isDisposed = true;
+            base.Dispose(disposing);
+        }
 		
 		public  override int Read(System.Char[] cbuf, int off, int len)
 		{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharStream.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharStream.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharStream.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharStream.cs Wed Jan 25 07:01:45 2012
@@ -29,9 +29,9 @@ namespace Lucene.Net.Analysis
 	/// reported in the tokens match the character offsets of the
 	/// original Reader.
     /// </summary>
-	public abstract class CharStream:System.IO.StreamReader
+	public abstract class CharStream : System.IO.StreamReader
 	{
-        public CharStream(System.IO.StreamReader reader) : base(reader.BaseStream)
+	    protected CharStream(System.IO.StreamReader reader) : base(reader.BaseStream)
         {
         }
 		

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharTokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharTokenizer.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharTokenizer.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/CharTokenizer.cs Wed Jan 25 07:01:45 2012
@@ -27,19 +27,19 @@ namespace Lucene.Net.Analysis
 	/// <summary>An abstract base class for simple, character-oriented tokenizers.</summary>
 	public abstract class CharTokenizer:Tokenizer
 	{
-		public CharTokenizer(System.IO.TextReader input):base(input)
+	    protected CharTokenizer(System.IO.TextReader input):base(input)
 		{
 			offsetAtt = AddAttribute<OffsetAttribute>();
             termAtt = AddAttribute<TermAttribute>();
 		}
-		
-		public CharTokenizer(AttributeSource source, System.IO.TextReader input):base(source, input)
+
+	    protected CharTokenizer(AttributeSource source, System.IO.TextReader input):base(source, input)
 		{
             offsetAtt = AddAttribute<OffsetAttribute>();
             termAtt = AddAttribute<TermAttribute>();
 		}
-		
-		public CharTokenizer(AttributeFactory factory, System.IO.TextReader input):base(factory, input)
+
+	    protected CharTokenizer(AttributeFactory factory, System.IO.TextReader input):base(factory, input)
 		{
             offsetAtt = AddAttribute<OffsetAttribute>();
             termAtt = AddAttribute<TermAttribute>();

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/MappingCharFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/MappingCharFilter.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/MappingCharFilter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/MappingCharFilter.cs Wed Jan 25 07:01:45 2012
@@ -28,7 +28,6 @@ namespace Lucene.Net.Analysis
 	/// </summary>
 	public class MappingCharFilter : BaseCharFilter
 	{
-		
 		private NormalizeCharMap normMap;
 		private System.Collections.Generic.LinkedList<char> buffer;
 		private System.String replacement;

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenFilter.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenFilter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenFilter.cs Wed Jan 25 07:01:45 2012
@@ -31,8 +31,10 @@ namespace Lucene.Net.Analysis
 	{
 		/// <summary>The source of tokens for this filter. </summary>
 		protected internal TokenStream input;
-		
-		/// <summary>Construct a token stream filtering the given input. </summary>
+
+	    private bool isDisposed;
+
+	    /// <summary>Construct a token stream filtering the given input. </summary>
 		protected internal TokenFilter(TokenStream input):base(input)
 		{
 			this.input = input;
@@ -46,12 +48,22 @@ namespace Lucene.Net.Analysis
 		{
 			input.End();
 		}
-		
-		/// <summary>Close the input TokenStream. </summary>
-		public override void  Close()
-		{
-			input.Close();
-		}
+
+        protected override void Dispose(bool disposing)
+        {
+            if (isDisposed) return;
+
+            if (disposing)
+            {
+                if (input != null)
+                {
+                    input.Close();
+                }
+            }
+
+            //input = null;
+            isDisposed = true;
+        }
 		
 		/// <summary>Reset the filter as well as the input TokenStream. </summary>
 		public override void  Reset()

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenStream.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenStream.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenStream.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/TokenStream.cs Wed Jan 25 07:01:45 2012
@@ -148,14 +148,18 @@ namespace Lucene.Net.Analysis
 		}
 		
 		/// <summary>Releases resources associated with this stream. </summary>
-		public virtual void  Close()
+		[Obsolete("Use Dispose() instead")]
+		public void  Close()
 		{
             Dispose();
 		}
 
-        public virtual void Dispose()
+        public void Dispose()
         {
-            
+            Dispose(true);
         }
+
+	    protected virtual void Dispose(bool disposing)
+	    { }
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenizer.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenizer.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenizer.cs Wed Jan 25 07:01:45 2012
@@ -34,6 +34,8 @@ namespace Lucene.Net.Analysis
 	{
 		/// <summary>The text source for this Tokenizer. </summary>
 		protected internal System.IO.TextReader input;
+
+	    private bool isDisposed;
 		
 		/// <summary>Construct a tokenizer with null input. </summary>
 		protected internal Tokenizer()
@@ -68,17 +70,23 @@ namespace Lucene.Net.Analysis
 			this.input = CharReader.Get(input);
 		}
 		
-		/// <summary>By default, closes the input Reader. </summary>
-		public override void  Close()
-		{
-            if (input != null) {
-                input.Close();
-                // LUCENE-2387: don't hold onto Reader after close, so
-                // GC can reclaim
-                input = null;
+        protected override void Dispose(bool disposing)
+        {
+            if (isDisposed) return;
+
+            if (disposing)
+            {
+                if (input != null)
+                {
+                    input.Close();
+                }
             }
 
-		}
+            // LUCENE-2387: don't hold onto Reader after close, so
+            // GC can reclaim
+            input = null;
+            isDisposed = true;
+        }
   
 		/// <summary>Return the corrected offset. If <see cref="input" /> is a <see cref="CharStream" /> subclass
 		/// this method calls <see cref="CharStream.CorrectOffset" />, else returns <c>currentOff</c>.

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt Wed Jan 25 07:01:45 2012
@@ -9,4 +9,80 @@ store\NIOFSDirectory.java - Text files a
 
 util\DummyConcurrentLock.java - New in 3.x (NOT NEEDED IN .NET?  Can just use new Object() for a dummy lock) (used in MultiSearcher)
 util\NamedThreadFactory.java - New in 3.x
-util\ThreadInterruptedException.java - new in 3.x (NOT NEEDED IN .NET?)
\ No newline at end of file
+util\ThreadInterruptedException.java - new in 3.x (NOT NEEDED IN .NET?)
+
+LUCENENET-468
+
+Analyzer - Implemented Dispose
+CharFilter - Implemented Dispose
+CharReader
+TokenFilter
+Tokenizer
+TokenStream
+AbstractAllTermDocs
+ByteSliceReader
+CompoundFileReader
+CompundFileWriter
+ConcurrentMergeScheduler
+DirectoryReader
+DocumentsWriter
+FieldsReader
+FieldsWriter
+FilterIndexReader
+FormatPostingsDocsWriter
+FormatPostingsPositionsWriter
+FormatPostingsTermsWriter
+IndexFileDeleter
+IndexReader
+IdnexWriter
+InvertedDocConsumer
+InvertedDocEndConsumer
+LogMergePolicy
+MergePolicy
+MergeScheduler
+MultiLevelSkipListReader
+MultipleTermPositions
+NormsWriter
+ParallelReader
+ReusableStringReader
+SegmentMergeInfo
+SegmentMergeQueue
+SegmentMerger
+SegmentReader
+SegmentTermDocs
+SegmentTermEnum
+SegmentTermPositions
+SerialMergeScheduler
+StoredFieldsWriter
+TermDocs
+TermEnum
+TermInfosReader
+TermInfosWriter
+TermVectorsReader
+TermVectorsWriter
+FilteredTermEnum
+FuzzyTermEnum
+indexSearcher
+MultiSearcher
+NumericRangeQuery
+Searchable
+BufferedIndexOutput
+CheckSumIndexInput
+CheckSumIndexOutput
+Directory
+FileSwitchDirectory
+FSDirectory
+FileSwitchDirectory
+FSDirectory
+IndexInput
+IndexOutput
+MMapDirectory
+NIOFSDirectory
+RAMDirectory
+RAMInputStream
+RAMOutputStream
+SimpleFSDirectory
+Cache
+SimpleMapCache
+CloseableThreadLocal
+

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/AbstractAllTermDocs.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/AbstractAllTermDocs.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/AbstractAllTermDocs.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/AbstractAllTermDocs.cs Wed Jan 25 07:01:45 2012
@@ -110,6 +110,11 @@ namespace Lucene.Net.Index
 
         public void Dispose()
         {
+            Dispose(true);
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
             
         }
 

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ByteSliceReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ByteSliceReader.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ByteSliceReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ByteSliceReader.cs Wed Jan 25 07:01:45 2012
@@ -169,10 +169,11 @@ namespace Lucene.Net.Index
 		{
 			throw new System.SystemException("not implemented");
 		}
-		public override void  Close()
-		{
-			throw new System.SystemException("not implemented");
-		}
+
+        protected override void Dispose(bool disposing)
+        {
+            // Do nothing...
+        }
 		
 		override public System.Object Clone()
 		{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/CompoundFileReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/CompoundFileReader.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/CompoundFileReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/CompoundFileReader.cs Wed Jan 25 07:01:45 2012
@@ -42,7 +42,8 @@ namespace Lucene.Net.Index
 			internal long offset;
 			internal long length;
 		}
-		
+
+	    private bool isDisposed;
 		
 		// Base info
 		private Directory directory;
@@ -119,26 +120,28 @@ namespace Lucene.Net.Index
 		{
 			return fileName;
 		}
-		
-		public override void  Close()
-		{
-			lock (this)
-			{
-				if (stream == null)
-					throw new System.IO.IOException("Already closed");
-				
-				entries.Clear();
-				stream.Close();
-				stream = null;
-			}
-		}
 
-        /// <summary>
-        /// .NET
-        /// </summary>
-        public override void Dispose()
+        protected override void Dispose(bool disposing)
         {
-            Close();
+            lock (this)
+            {
+                if (isDisposed) return;
+                if (disposing)
+                {
+                    if (entries != null)
+                    {
+                        entries.Clear();
+                    }
+                    if (stream != null)
+                    {
+                        stream.Close();
+                    }
+                }
+
+                entries = null;
+                stream = null;
+                isDisposed = true;
+            }
         }
 		
 		public override IndexInput OpenInput(System.String id)
@@ -232,12 +235,13 @@ namespace Lucene.Net.Index
 		/// this helps with testing since JUnit test cases in a different class
 		/// can then access package fields of this class.
 		/// </summary>
-		public /*internal*/ sealed class CSIndexInput:BufferedIndexInput, System.ICloneable
+		public /*internal*/ sealed class CSIndexInput : BufferedIndexInput
 		{
-			
 			internal IndexInput base_Renamed;
 			internal long fileOffset;
 			internal long length;
+
+		    private bool isDisposed;
 			
 			internal CSIndexInput(IndexInput base_Renamed, long fileOffset, long length):this(base_Renamed, fileOffset, length, BufferedIndexInput.BUFFER_SIZE)
 			{
@@ -285,12 +289,21 @@ namespace Lucene.Net.Index
 			public override void  SeekInternal(long pos)
 			{
 			}
-			
-			/// <summary>Closes the stream to further operations. </summary>
-			public override void  Close()
-			{
-				base_Renamed.Close();
-			}
+
+            protected override void Dispose(bool disposing)
+            {
+                if (isDisposed) return;
+
+                if (disposing)
+                {
+                    if (base_Renamed != null)
+                    {
+                        base_Renamed.Close();
+                    }
+                }
+                
+                isDisposed = true;
+            }
 			
 			public override long Length()
 			{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/LogMergePolicy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/LogMergePolicy.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/LogMergePolicy.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/LogMergePolicy.cs Wed Jan 25 07:01:45 2012
@@ -78,8 +78,8 @@ namespace Lucene.Net.Index
 		
 		private bool useCompoundFile = true;
 		private bool useCompoundDocStore = true;
-		
-		public LogMergePolicy(IndexWriter writer):base(writer)
+
+	    protected LogMergePolicy(IndexWriter writer):base(writer)
 		{
 		}
 		

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MergePolicy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MergePolicy.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MergePolicy.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MergePolicy.cs Wed Jan 25 07:01:45 2012
@@ -238,8 +238,8 @@ namespace Lucene.Net.Index
 		}
 		
 		protected internal IndexWriter writer;
-		
-		public MergePolicy(IndexWriter writer)
+
+	    protected MergePolicy(IndexWriter writer)
 		{
 			this.writer = writer;
 		}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MultiLevelSkipListReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MultiLevelSkipListReader.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MultiLevelSkipListReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/MultiLevelSkipListReader.cs Wed Jan 25 07:01:45 2012
@@ -265,11 +265,13 @@ namespace Lucene.Net.Index
 		
 		
 		/// <summary>used to buffer the top skip levels </summary>
-		private sealed class SkipBuffer:IndexInput
+		private sealed class SkipBuffer : IndexInput
 		{
 			private byte[] data;
 			private long pointer;
 			private int pos;
+
+		    private bool isDisposed;
 			
 			internal SkipBuffer(IndexInput input, int length)
 			{
@@ -277,11 +279,17 @@ namespace Lucene.Net.Index
 				pointer = input.GetFilePointer();
 				input.ReadBytes(data, 0, length);
 			}
-			
-			public override void  Close()
-			{
-				data = null;
-			}
+
+            protected override void Dispose(bool disposing)
+            {
+                if (isDisposed) return;
+                if (disposing)
+                {
+                    data = null;
+                }
+
+                isDisposed = true;
+            }
 			
 			public override long GetFilePointer()
 			{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs Wed Jan 25 07:01:45 2012
@@ -583,8 +583,8 @@ namespace Lucene.Net.Index
 		{
 			
 			internal Directory directory;
-			
-			public FindSegmentsFile(Directory directory)
+
+		    protected FindSegmentsFile(Directory directory)
 			{
 				this.directory = directory;
 			}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermDocs.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermDocs.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermDocs.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermDocs.cs Wed Jan 25 07:01:45 2012
@@ -19,16 +19,13 @@ using System;
 
 namespace Lucene.Net.Index
 {
-	
 	/// <summary>TermDocs provides an interface for enumerating &lt;document, frequency&gt;
 	/// pairs for a term.  <p/> The document portion names each document containing
 	/// the term.  Documents are indicated by number.  The frequency portion gives
 	/// the number of times the term occurred in each document.  <p/> The pairs are
 	/// ordered by document number.
 	/// </summary>
-	/// <seealso cref="IndexReader.TermDocs()">
-	/// </seealso>
-	
+	/// <seealso cref="IndexReader.TermDocs()" />
 	public interface TermDocs : IDisposable
 	{
 		/// <summary>Sets this to the data for a term.
@@ -82,6 +79,7 @@ namespace Lucene.Net.Index
 		bool SkipTo(int target);
 		
 		/// <summary>Frees associated resources. </summary>
+		[Obsolete("Use Dispose() instead")]
 		void  Close();
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Lucene.Net.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Lucene.Net.csproj?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Lucene.Net.csproj (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Lucene.Net.csproj Wed Jan 25 07:01:45 2012
@@ -86,6 +86,8 @@
     <WarningLevel>4</WarningLevel>
     <DebugType>full</DebugType>
     <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>BasicDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>
+    <RunCodeAnalysis>true</RunCodeAnalysis>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <OutputPath>..\..\build\bin\core\Release\</OutputPath>
@@ -98,7 +100,7 @@
     <DocumentationFile>..\..\build\bin\core\Release\Lucene.Net.XML</DocumentationFile>
     <FileAlignment>4096</FileAlignment>
     <NoStdLib>false</NoStdLib>
-    <NoWarn>618</NoWarn>
+    <NoWarn>618,1591</NoWarn>
     <Optimize>true</Optimize>
     <RegisterForComInterop>false</RegisterForComInterop>
     <RemoveIntegerChecks>false</RemoveIntegerChecks>

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParser.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParser.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParser.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParser.cs Wed Jan 25 07:01:45 2012
@@ -1282,18 +1282,18 @@ namespace Lucene.Net.QueryParsers
 			int ret = CONJ_NONE;
 			switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 			{
-				case Lucene.Net.QueryParsers.QueryParserConstants.AND: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.OR: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.AndToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.OrToken: 
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.AND: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.AND);
+						case Lucene.Net.QueryParsers.QueryParserConstants.AndToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.AndToken);
 							ret = CONJ_AND;
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.OR: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.OR);
+						case Lucene.Net.QueryParsers.QueryParserConstants.OrToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.OrToken);
 							ret = CONJ_OR;
 							break;
 						
@@ -1324,24 +1324,24 @@ namespace Lucene.Net.QueryParsers
 			switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 			{
 				
-				case Lucene.Net.QueryParsers.QueryParserConstants.NOT: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.PLUS: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.MINUS: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.NotToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.PlusToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.MinusToken: 
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.PLUS: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.PLUS);
+						case Lucene.Net.QueryParsers.QueryParserConstants.PlusToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.PlusToken);
 							ret = MOD_REQ;
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.MINUS: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.MINUS);
+						case Lucene.Net.QueryParsers.QueryParserConstants.MinusToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.MinusToken);
 							ret = MOD_NOT;
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.NOT: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NOT);
+						case Lucene.Net.QueryParsers.QueryParserConstants.NotToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NotToken);
 							ret = MOD_NOT;
 							break;
 						
@@ -1394,20 +1394,20 @@ namespace Lucene.Net.QueryParsers
 				switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 				{
 					
-					case Lucene.Net.QueryParsers.QueryParserConstants.AND: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.OR: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.NOT: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.PLUS: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.MINUS: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.LPAREN: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.STAR: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.QUOTED: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.TERM: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.PREFIXTERM: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.WILDTERM: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_START: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_START: 
-					case Lucene.Net.QueryParsers.QueryParserConstants.NUMBER: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.AndToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.OrToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.NotToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.PlusToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.MinusToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.LParanToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.StarToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.QuotedToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.TermToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.PrefixTermToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.WildTermToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.RangeInStartToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.RangeExStartToken: 
+					case Lucene.Net.QueryParsers.QueryParserConstants.NumberToken: 
 						;
 						break;
 					
@@ -1448,15 +1448,15 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 				switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 				{
 					
-					case Lucene.Net.QueryParsers.QueryParserConstants.TERM: 
-						fieldToken = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.TERM);
-						Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.COLON);
+					case Lucene.Net.QueryParsers.QueryParserConstants.TermToken: 
+						fieldToken = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.TermToken);
+						Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.ColonToken);
 						field = DiscardEscapeChar(fieldToken.image);
 						break;
 					
-					case Lucene.Net.QueryParsers.QueryParserConstants.STAR: 
-						Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.STAR);
-						Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.COLON);
+					case Lucene.Net.QueryParsers.QueryParserConstants.StarToken: 
+						Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.StarToken);
+						Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.ColonToken);
 						field = "*";
 						break;
 					
@@ -1474,27 +1474,27 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 			switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 			{
 				
-				case Lucene.Net.QueryParsers.QueryParserConstants.STAR: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.QUOTED: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.TERM: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.PREFIXTERM: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.WILDTERM: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_START: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_START: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.NUMBER: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.StarToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.QuotedToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.TermToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.PrefixTermToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.WildTermToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.RangeInStartToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.RangeExStartToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.NumberToken: 
 					q = Term(field);
 					break;
 				
-				case Lucene.Net.QueryParsers.QueryParserConstants.LPAREN: 
-					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.LPAREN);
+				case Lucene.Net.QueryParsers.QueryParserConstants.LParanToken: 
+					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.LParanToken);
 					q = Query(field);
-					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RPAREN);
+					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RParenToken);
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.CARAT: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CARAT);
-							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NUMBER);
+						case Lucene.Net.QueryParsers.QueryParserConstants.CaratToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CaratToken);
+							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NumberToken);
 							break;
 						
 						default: 
@@ -1540,35 +1540,35 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 			switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 			{
 				
-				case Lucene.Net.QueryParsers.QueryParserConstants.STAR: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.TERM: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.PREFIXTERM: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.WILDTERM: 
-				case Lucene.Net.QueryParsers.QueryParserConstants.NUMBER: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.StarToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.TermToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.PrefixTermToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.WildTermToken: 
+				case Lucene.Net.QueryParsers.QueryParserConstants.NumberToken: 
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.TERM: 
-							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.TERM);
+						case Lucene.Net.QueryParsers.QueryParserConstants.TermToken: 
+							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.TermToken);
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.STAR: 
-							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.STAR);
+						case Lucene.Net.QueryParsers.QueryParserConstants.StarToken: 
+							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.StarToken);
 							wildcard = true;
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.PREFIXTERM: 
-							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.PREFIXTERM);
+						case Lucene.Net.QueryParsers.QueryParserConstants.PrefixTermToken: 
+							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.PrefixTermToken);
 							prefix = true;
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.WILDTERM: 
-							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.WILDTERM);
+						case Lucene.Net.QueryParsers.QueryParserConstants.WildTermToken: 
+							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.WildTermToken);
 							wildcard = true;
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.NUMBER: 
-							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NUMBER);
+						case Lucene.Net.QueryParsers.QueryParserConstants.NumberToken: 
+							term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NumberToken);
 							break;
 						
 						default: 
@@ -1580,8 +1580,8 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.FUZZY_SLOP: 
-							fuzzySlop = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.FUZZY_SLOP);
+						case Lucene.Net.QueryParsers.QueryParserConstants.FuzzySlopToken: 
+							fuzzySlop = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.FuzzySlopToken);
 							fuzzy = true;
 							break;
 						
@@ -1594,14 +1594,14 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.CARAT: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CARAT);
-							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NUMBER);
+						case Lucene.Net.QueryParsers.QueryParserConstants.CaratToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CaratToken);
+							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NumberToken);
 							switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 							{
 								
-								case Lucene.Net.QueryParsers.QueryParserConstants.FUZZY_SLOP: 
-									fuzzySlop = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.FUZZY_SLOP);
+								case Lucene.Net.QueryParsers.QueryParserConstants.FuzzySlopToken: 
+									fuzzySlop = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.FuzzySlopToken);
 									fuzzy = true;
 									break;
 								
@@ -1653,17 +1653,17 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					}
 					break;
 				
-				case Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_START: 
-					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_START);
+				case Lucene.Net.QueryParsers.QueryParserConstants.RangeInStartToken: 
+					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeInStartToken);
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_GOOP: 
-							goop1 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_GOOP);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeInGoopToken: 
+							goop1 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeInGoopToken);
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_QUOTED: 
-							goop1 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_QUOTED);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeInQuotedToken: 
+							goop1 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeInQuotedToken);
 							break;
 						
 						default: 
@@ -1675,8 +1675,8 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_TO: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_TO);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeInToToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeInToToken);
 							break;
 						
 						default: 
@@ -1688,12 +1688,12 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_GOOP: 
-							goop2 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_GOOP);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeInGoopToken: 
+							goop2 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeInGoopToken);
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_QUOTED: 
-							goop2 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_QUOTED);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeInQuotedToken: 
+							goop2 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeInQuotedToken);
 							break;
 						
 						default: 
@@ -1702,13 +1702,13 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 							throw new ParseException();
 						
 					}
-					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_END);
+					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeInEndToken);
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.CARAT: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CARAT);
-							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NUMBER);
+						case Lucene.Net.QueryParsers.QueryParserConstants.CaratToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CaratToken);
+							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NumberToken);
 							break;
 						
 						default: 
@@ -1717,28 +1717,28 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 							break;
 						
 					}
-					if (goop1.kind == Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_QUOTED)
+					if (goop1.kind == Lucene.Net.QueryParsers.QueryParserConstants.RangeInQuotedToken)
 					{
 						goop1.image = goop1.image.Substring(1, (goop1.image.Length - 1) - (1));
 					}
-					if (goop2.kind == Lucene.Net.QueryParsers.QueryParserConstants.RANGEIN_QUOTED)
+					if (goop2.kind == Lucene.Net.QueryParsers.QueryParserConstants.RangeInQuotedToken)
 					{
 						goop2.image = goop2.image.Substring(1, (goop2.image.Length - 1) - (1));
 					}
 					q = GetRangeQuery(field, DiscardEscapeChar(goop1.image), DiscardEscapeChar(goop2.image), true);
 					break;
 				
-				case Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_START: 
-					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_START);
+				case Lucene.Net.QueryParsers.QueryParserConstants.RangeExStartToken: 
+					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeExStartToken);
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_GOOP: 
-							goop1 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_GOOP);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeExGoopToken: 
+							goop1 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeExGoopToken);
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_QUOTED: 
-							goop1 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_QUOTED);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeExQuotedToken: 
+							goop1 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeExQuotedToken);
 							break;
 						
 						default: 
@@ -1750,8 +1750,8 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_TO: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_TO);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeExToToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeExToToken);
 							break;
 						
 						default: 
@@ -1763,12 +1763,12 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_GOOP: 
-							goop2 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_GOOP);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeExGoopToken: 
+							goop2 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeExGoopToken);
 							break;
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_QUOTED: 
-							goop2 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_QUOTED);
+						case Lucene.Net.QueryParsers.QueryParserConstants.RangeExQuotedToken: 
+							goop2 = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeExQuotedToken);
 							break;
 						
 						default: 
@@ -1777,13 +1777,13 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 							throw new ParseException();
 						
 					}
-					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_END);
+					Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.RangeExEndToken);
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.CARAT: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CARAT);
-							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NUMBER);
+						case Lucene.Net.QueryParsers.QueryParserConstants.CaratToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CaratToken);
+							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NumberToken);
 							break;
 						
 						default: 
@@ -1792,11 +1792,11 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 							break;
 						
 					}
-					if (goop1.kind == Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_QUOTED)
+					if (goop1.kind == Lucene.Net.QueryParsers.QueryParserConstants.RangeExQuotedToken)
 					{
 						goop1.image = goop1.image.Substring(1, (goop1.image.Length - 1) - (1));
 					}
-					if (goop2.kind == Lucene.Net.QueryParsers.QueryParserConstants.RANGEEX_QUOTED)
+					if (goop2.kind == Lucene.Net.QueryParsers.QueryParserConstants.RangeExQuotedToken)
 					{
 						goop2.image = goop2.image.Substring(1, (goop2.image.Length - 1) - (1));
 					}
@@ -1804,13 +1804,13 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					q = GetRangeQuery(field, DiscardEscapeChar(goop1.image), DiscardEscapeChar(goop2.image), false);
 					break;
 				
-				case Lucene.Net.QueryParsers.QueryParserConstants.QUOTED: 
-					term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.QUOTED);
+				case Lucene.Net.QueryParsers.QueryParserConstants.QuotedToken: 
+					term = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.QuotedToken);
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.FUZZY_SLOP: 
-							fuzzySlop = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.FUZZY_SLOP);
+						case Lucene.Net.QueryParsers.QueryParserConstants.FuzzySlopToken: 
+							fuzzySlop = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.FuzzySlopToken);
 							break;
 						
 						default: 
@@ -1822,9 +1822,9 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 					switch ((jj_ntk == - 1)?Jj_ntk():jj_ntk)
 					{
 						
-						case Lucene.Net.QueryParsers.QueryParserConstants.CARAT: 
-							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CARAT);
-							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NUMBER);
+						case Lucene.Net.QueryParsers.QueryParserConstants.CaratToken: 
+							Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.CaratToken);
+							boost = Jj_consume_token(Lucene.Net.QueryParsers.QueryParserConstants.NumberToken);
 							break;
 						
 						default: 
@@ -1900,9 +1900,9 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 		
 		private bool Jj_3R_2()
 		{
-			if (Jj_scan_token(Lucene.Net.QueryParsers.QueryParserConstants.TERM))
+			if (Jj_scan_token(Lucene.Net.QueryParsers.QueryParserConstants.TermToken))
 				return true;
-			if (Jj_scan_token(Lucene.Net.QueryParsers.QueryParserConstants.COLON))
+			if (Jj_scan_token(Lucene.Net.QueryParsers.QueryParserConstants.ColonToken))
 				return true;
 			return false;
 		}
@@ -1922,9 +1922,9 @@ label_1_brk: ;  // {{Aroush-2.9}} this l
 		
 		private bool Jj_3R_3()
 		{
-			if (Jj_scan_token(Lucene.Net.QueryParsers.QueryParserConstants.STAR))
+			if (Jj_scan_token(Lucene.Net.QueryParsers.QueryParserConstants.StarToken))
 				return true;
-			if (Jj_scan_token(Lucene.Net.QueryParsers.QueryParserConstants.COLON))
+			if (Jj_scan_token(Lucene.Net.QueryParsers.QueryParserConstants.ColonToken))
 				return true;
 			return false;
 		}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParserConstants.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParserConstants.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParserConstants.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/QueryParser/QueryParserConstants.cs Wed Jan 25 07:01:45 2012
@@ -29,81 +29,81 @@ namespace Lucene.Net.QueryParsers
 	public class QueryParserConstants
 	{
 		/// <summary>End of File. </summary>
-		public const int EOF = 0;
+		protected internal const int EndOfFileToken = 0;
 		/// <summary>RegularExpression Id. </summary>
-		public const int _NUM_CHAR = 1;
+		protected internal const int NumCharToken = 1;
 		/// <summary>RegularExpression Id. </summary>
-		public const int _ESCAPED_CHAR = 2;
+		protected internal const int EscapedCharToken = 2;
 		/// <summary>RegularExpression Id. </summary>
-		public const int _TERM_START_CHAR = 3;
+		protected internal const int TermStartCharToken = 3;
 		/// <summary>RegularExpression Id. </summary>
-		public const int _TERM_CHAR = 4;
+		protected internal const int TermCharToken = 4;
 		/// <summary>RegularExpression Id. </summary>
-		public const int _WHITESPACE = 5;
+		protected internal const int WhitespaceToken = 5;
 		/// <summary>RegularExpression Id. </summary>
-		public const int _QUOTED_CHAR = 6;
+		protected internal const int QuotedCharToken = 6;
 		/// <summary>RegularExpression Id. </summary>
-		public const int AND = 8;
+		protected internal const int AndToken = 8;
 		/// <summary>RegularExpression Id. </summary>
-		public const int OR = 9;
+		protected internal const int OrToken = 9;
 		/// <summary>RegularExpression Id. </summary>
-		public const int NOT = 10;
+		protected internal const int NotToken = 10;
 		/// <summary>RegularExpression Id. </summary>
-		public const int PLUS = 11;
+		protected internal const int PlusToken = 11;
 		/// <summary>RegularExpression Id. </summary>
-		public const int MINUS = 12;
+		protected internal const int MinusToken = 12;
 		/// <summary>RegularExpression Id. </summary>
-		public const int LPAREN = 13;
+		protected internal const int LParanToken = 13;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RPAREN = 14;
+		protected internal const int RParenToken = 14;
 		/// <summary>RegularExpression Id. </summary>
-		public const int COLON = 15;
+		protected internal const int ColonToken = 15;
 		/// <summary>RegularExpression Id. </summary>
-		public const int STAR = 16;
+		protected internal const int StarToken = 16;
 		/// <summary>RegularExpression Id. </summary>
-		public const int CARAT = 17;
+		protected internal const int CaratToken = 17;
 		/// <summary>RegularExpression Id. </summary>
-		public const int QUOTED = 18;
+		protected internal const int QuotedToken = 18;
 		/// <summary>RegularExpression Id. </summary>
-		public const int TERM = 19;
+		protected internal const int TermToken = 19;
 		/// <summary>RegularExpression Id. </summary>
-		public const int FUZZY_SLOP = 20;
+		protected internal const int FuzzySlopToken = 20;
 		/// <summary>RegularExpression Id. </summary>
-		public const int PREFIXTERM = 21;
+		protected internal const int PrefixTermToken = 21;
 		/// <summary>RegularExpression Id. </summary>
-		public const int WILDTERM = 22;
+		protected internal const int WildTermToken = 22;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEIN_START = 23;
+		protected internal const int RangeInStartToken = 23;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEEX_START = 24;
+		protected internal const int RangeExStartToken = 24;
 		/// <summary>RegularExpression Id. </summary>
-		public const int NUMBER = 25;
+		protected internal const int NumberToken = 25;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEIN_TO = 26;
+		protected internal const int RangeInToToken = 26;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEIN_END = 27;
+		protected internal const int RangeInEndToken = 27;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEIN_QUOTED = 28;
+		protected internal const int RangeInQuotedToken = 28;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEIN_GOOP = 29;
+		protected internal const int RangeInGoopToken = 29;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEEX_TO = 30;
+		protected internal const int RangeExToToken = 30;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEEX_END = 31;
+		protected internal const int RangeExEndToken = 31;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEEX_QUOTED = 32;
+		protected internal const int RangeExQuotedToken = 32;
 		/// <summary>RegularExpression Id. </summary>
-		public const int RANGEEX_GOOP = 33;
+		protected internal const int RangeExGoopToken = 33;
 		/// <summary>Lexical state. </summary>
-		public const int Boost = 0;
+		protected internal const int BoostToken = 0;
 		/// <summary>Lexical state. </summary>
-		public const int RangeEx = 1;
+		protected const int RangeExToken = 1;
 		/// <summary>Lexical state. </summary>
-		public const int RangeIn = 2;
+		protected internal const int RangeInToken = 2;
 		/// <summary>Lexical state. </summary>
-		public const int DEFAULT = 3;
+		protected internal const int DefaultToken = 3;
 		/// <summary>Literal token values. </summary>
-		public static System.String[] tokenImage = new System.String[] {
+		protected internal static System.String[] tokenImage = new System.String[] {
             "<EOF>", 
             "<_NUM_CHAR>", 
             "<_ESCAPED_CHAR>", 

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilterManager.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilterManager.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilterManager.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilterManager.cs Wed Jan 25 07:01:45 2012
@@ -51,7 +51,7 @@ namespace Lucene.Net.Search
 		/// <summary>Cache cleaning frequency </summary>
 		protected internal long cleanSleepTime;
 		/// <summary>Cache cleaner that runs in a separate thread </summary>
-		protected internal FilterCleaner filterCleaner;
+		protected internal FilterCleaner _filterCleaner;
 		
 		public static FilterManager GetInstance()
 		{
@@ -72,8 +72,8 @@ namespace Lucene.Net.Search
 			cacheCleanSize = DEFAULT_CACHE_CLEAN_SIZE; // Let the cache get to 100 items
 			cleanSleepTime = DEFAULT_CACHE_SLEEP_TIME; // 10 minutes between cleanings
 			
-			filterCleaner = new FilterCleaner(this);
-			ThreadClass fcThread = new ThreadClass(new System.Threading.ThreadStart(filterCleaner.Run));
+			_filterCleaner = new FilterCleaner(this);
+			ThreadClass fcThread = new ThreadClass(new System.Threading.ThreadStart(_filterCleaner.Run));
 			// setto be a Daemon so it doesn't have to be stopped
 			fcThread.IsBackground = true;
 			fcThread.Start();

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSet.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSet.cs Wed Jan 25 07:01:45 2012
@@ -75,7 +75,7 @@ namespace Lucene.Net.Search
 		/// <summary> Constructor.</summary>
 		/// <param name="innerSet">Underlying DocIdSet
 		/// </param>
-		public FilteredDocIdSet(DocIdSet innerSet)
+		protected FilteredDocIdSet(DocIdSet innerSet)
 		{
 			_innerSet = innerSet;
 		}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSetIterator.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSetIterator.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSetIterator.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredDocIdSetIterator.cs Wed Jan 25 07:01:45 2012
@@ -33,7 +33,7 @@ namespace Lucene.Net.Search
 		/// <summary> Constructor.</summary>
 		/// <param name="innerIter">Underlying DocIdSetIterator.
 		/// </param>
-		public FilteredDocIdSetIterator(DocIdSetIterator innerIter)
+		protected FilteredDocIdSetIterator(DocIdSetIterator innerIter)
 		{
 			if (innerIter == null)
 			{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredTermEnum.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredTermEnum.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredTermEnum.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FilteredTermEnum.cs Wed Jan 25 07:01:45 2012
@@ -34,8 +34,8 @@ namespace Lucene.Net.Search
 		
 		/// <summary>the delegate enum - to set this member use <see cref="SetEnum" /> </summary>
 		protected internal TermEnum actualEnum = null;
-		
-		public FilteredTermEnum()
+
+	    protected FilteredTermEnum()
 		{
 		}
 		

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Function/FieldCacheSource.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Function/FieldCacheSource.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Function/FieldCacheSource.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Function/FieldCacheSource.cs Wed Jan 25 07:01:45 2012
@@ -52,7 +52,7 @@ namespace Lucene.Net.Search.Function
 		private System.String field;
 		
 		/// <summary> Create a cached field source for the input field.  </summary>
-		public FieldCacheSource(System.String field)
+		protected FieldCacheSource(System.String field)
 		{
 			this.field = field;
 		}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FuzzyQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FuzzyQuery.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FuzzyQuery.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FuzzyQuery.cs Wed Jan 25 07:01:45 2012
@@ -47,7 +47,7 @@ namespace Lucene.Net.Search
 		private int prefixLength;
 		private bool termLongEnough = false;
 		
-		new protected internal Term term;
+		protected internal Term term;
 		
 		/// <summary> Create a new FuzzyQuery that will match terms with a similarity 
 		/// of at least <c>minimumSimilarity</c> to <c>term</c>.

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiSearcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiSearcher.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiSearcher.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiSearcher.cs Wed Jan 25 07:01:45 2012
@@ -394,7 +394,7 @@ namespace Lucene.Net.Search
 	        (theLock, searchable, weight, filter, nDocs, hq, i, starts) =>
 	            {
 	                TopDocs docs = searchable.Search(weight, filter, nDocs);
-	                ScoreDoc[] scoreDocs = docs.scoreDocs;
+	                ScoreDoc[] scoreDocs = docs.ScoreDocs;
                     for(int j = 0; j < scoreDocs.Length; j++) // merge scoreDocs into hq
                     {
                         ScoreDoc scoreDoc = scoreDocs[j];
@@ -421,9 +421,9 @@ namespace Lucene.Net.Search
                                                         if (docs.fields[j].GetType() == SortField.DOC)
                                                         {
                                                             // iterate over the score docs and change their fields value
-                                                            for (int j2 = 0; j2 < docs.scoreDocs.Length; j2++)
+                                                            for (int j2 = 0; j2 < docs.ScoreDocs.Length; j2++)
                                                             {
-                                                                FieldDoc fd = (FieldDoc) docs.scoreDocs[j2];
+                                                                FieldDoc fd = (FieldDoc) docs.ScoreDocs[j2];
                                                                 fd.fields[j] = (int)fd.fields[j] + starts[i];
                                                             }
                                                             break;
@@ -435,7 +435,7 @@ namespace Lucene.Net.Search
                                                         hq.SetFields(docs.fields);
                                                     }
 
-	                                                ScoreDoc[] scoreDocs = docs.scoreDocs;
+	                                                ScoreDoc[] scoreDocs = docs.ScoreDocs;
                                                     for (int j = 0; j < scoreDocs.Length; j++) // merge scoreDocs into hq
                                                     {
                                                         FieldDoc fieldDoc = (FieldDoc) scoreDocs[j];

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiTermQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiTermQuery.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiTermQuery.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/MultiTermQuery.cs Wed Jan 25 07:01:45 2012
@@ -384,7 +384,7 @@ namespace Lucene.Net.Search
 		/// <summary> Constructs a query matching terms that cannot be represented with a single
 		/// Term.
 		/// </summary>
-		public MultiTermQuery()
+		protected MultiTermQuery()
 		{
 		}
 		

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/ParallelMultiSearcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/ParallelMultiSearcher.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/ParallelMultiSearcher.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/ParallelMultiSearcher.cs Wed Jan 25 07:01:45 2012
@@ -125,7 +125,7 @@ namespace Lucene.Net.Search
 		    Task.WaitAll(tasks);
             foreach(TopDocs topDocs in tasks.Select(x => x.Result))
             {
-                totalHits += topDocs.totalHits;
+                totalHits += topDocs.TotalHits;
                 maxScore = Math.Max(maxScore, topDocs.GetMaxScore());
             }
 
@@ -162,7 +162,7 @@ namespace Lucene.Net.Search
             Task.WaitAll(tasks);
             foreach (TopFieldDocs topFieldDocs in tasks.Select(x => x.Result))
             {
-                totalHits += topFieldDocs.totalHits;
+                totalHits += topFieldDocs.TotalHits;
                 maxScore = Math.Max(maxScore, topFieldDocs.GetMaxScore());
             }
             ScoreDoc[] scoreDocs = new ScoreDoc[hq.Size()];

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs Wed Jan 25 07:01:45 2012
@@ -33,7 +33,7 @@ namespace Lucene.Net.Search
 	/// </summary>
 	public abstract class Searcher : System.MarshalByRefObject, Searchable, System.IDisposable
 	{
-		public Searcher()
+	    protected Searcher()
 		{
 			InitBlock();
 		}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Similarity.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Similarity.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Similarity.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Similarity.cs Wed Jan 25 07:01:45 2012
@@ -291,7 +291,7 @@ namespace Lucene.Net.Search
 	[Serializable]
 	public abstract class Similarity
 	{
-		public Similarity()
+	    protected Similarity()
 		{
 			InitBlock();
 		}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/TopDocs.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/TopDocs.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/TopDocs.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/TopDocs.cs Wed Jan 25 07:01:45 2012
@@ -26,34 +26,31 @@ namespace Lucene.Net.Search
 	[Serializable]
 	public class TopDocs
 	{
-		/// <summary>The total number of hits for the query.</summary>
-		/// <seealso cref="Hits.Length()">
-		/// </seealso>
-        [Obsolete("For backward compatibility. Use TotalHits instead")]
-		public int totalHits;
-		/// <summary>The top hits for the query. </summary>
-        [Obsolete("For backward compatibility. Use ScoreDocs instead")]
-		public ScoreDoc[] scoreDocs;
-		/// <summary>Stores the maximum score value encountered, needed for normalizing. </summary>
-        [Obsolete("For backward compatibility. Use MaxScore instead")]
-		private float maxScore;
+		private int _totalHits;
+        private ScoreDoc[] _scoreDocs;
+        private float _maxScore;
 
+        /// <summary>The total number of hits for the query.</summary>
+        /// <seealso cref="Hits.Length()">
+        /// </seealso>
         public int TotalHits
         {
-            get { return totalHits; }
-            set { totalHits = value; }
+            get { return _totalHits; }
+            set { _totalHits = value; }
         }
 
+        /// <summary>The top hits for the query. </summary>
         public ScoreDoc[] ScoreDocs
         {
-            get { return scoreDocs; }
-            set { scoreDocs = value; }
+            get { return _scoreDocs; }
+            set { _scoreDocs = value; }
         }
 
+        /// <summary>Stores the maximum score value encountered, needed for normalizing. </summary>
         public float MaxScore
         {
-            get { return maxScore; }
-            set { maxScore = value; }
+            get { return _maxScore; }
+            set { _maxScore = value; }
         }
 
 

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/WildcardQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/WildcardQuery.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/WildcardQuery.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/WildcardQuery.cs Wed Jan 25 07:01:45 2012
@@ -43,7 +43,7 @@ namespace Lucene.Net.Search
 	{
 		private bool termContainsWildcard;
 	    private bool termIsPrefix;
-		new protected internal Term term;
+		protected internal Term term;
 		
 		public WildcardQuery(Term term)
 		{ 

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/BufferedIndexInput.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/BufferedIndexInput.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/BufferedIndexInput.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/BufferedIndexInput.cs Wed Jan 25 07:01:45 2012
@@ -41,13 +41,13 @@ namespace Lucene.Net.Store
 				Refill();
 			return buffer[bufferPosition++];
 		}
-		
-		public BufferedIndexInput()
+
+	    protected BufferedIndexInput()
 		{
 		}
 		
 		/// <summary>Inits BufferedIndexInput with a specific bufferSize </summary>
-		public BufferedIndexInput(int bufferSize)
+		protected BufferedIndexInput(int bufferSize)
 		{
 			CheckBufferSize(bufferSize);
 			this.bufferSize = bufferSize;

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/CheckSumIndexInput.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/CheckSumIndexInput.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/CheckSumIndexInput.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/CheckSumIndexInput.cs Wed Jan 25 07:01:45 2012
@@ -24,10 +24,12 @@ namespace Lucene.Net.Store
 	/// <summary>Writes bytes through to a primary IndexOutput, computing
 	/// checksum as it goes. Note that you cannot use seek(). 
 	/// </summary>
-	public class ChecksumIndexInput:IndexInput
+	public class ChecksumIndexInput : IndexInput
 	{
 		internal IndexInput main;
 		internal IChecksum digest;
+
+	    private bool isDisposed;
 		
 		public ChecksumIndexInput(IndexInput main)
 		{
@@ -53,11 +55,22 @@ namespace Lucene.Net.Store
 		{
 			return digest.GetValue();
 		}
-		
-		public override void  Close()
-		{
-			main.Close();
-		}
+
+        protected override void Dispose(bool disposing)
+        {
+            if (isDisposed) return;
+
+            if (disposing)
+            {
+                if (main != null)
+                {
+                    main.Dispose();
+                }
+            }
+
+            main = null;
+            isDisposed = true;
+        }
 		
 		public override long GetFilePointer()
 		{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/Directory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/Directory.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/Directory.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/Directory.cs Wed Jan 25 07:01:45 2012
@@ -119,12 +119,21 @@ namespace Lucene.Net.Store
 			}
 		}
 		
-		/// <summary>Closes the store. </summary>
-		public abstract void  Close();
+		[Obsolete("Use Dispose() instead")]
+		public void Close()
+		{
+		    Dispose();
+		}
 
-        public abstract void Dispose();
-		
-		/// <summary> Set the LockFactory that this Directory instance should
+        /// <summary>Closes the store. </summary>
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+
+	    protected abstract void Dispose(bool disposing);
+
+	    /// <summary> Set the LockFactory that this Directory instance should
 		/// use for its locking implementation.  Each * instance of
 		/// LockFactory should only be used for one directory (ie,
 		/// do not share a single instance across multiple

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FSDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FSDirectory.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FSDirectory.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FSDirectory.cs Wed Jan 25 07:01:45 2012
@@ -449,22 +449,13 @@ namespace Lucene.Net.Store
 			
 			return buf.ToString();
 		}
-		
-		/// <summary>Closes the store to future operations. </summary>
-		public override void  Close()
-		{
-			lock (this)
-			{
-			    isOpen = false;
-			}
-		}
 
-        /// <summary>
-        /// .NET
-        /// </summary>
-        public override void Dispose()
+	    protected override void Dispose(bool disposing)
         {
-            Close();
+            lock (this)
+            {
+                isOpen = false;
+            }
         }
 
         // Java Lucene implements GetFile() which returns a FileInfo.

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FileSwitchDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FileSwitchDirectory.cs?rev=1235645&r1=1235644&r2=1235645&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FileSwitchDirectory.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/FileSwitchDirectory.cs Wed Jan 25 07:01:45 2012
@@ -38,6 +38,7 @@ namespace Lucene.Net.Store
 		private Directory primaryDir;
 		private System.Collections.Generic.HashSet<string> primaryExtensions;
 		private bool doClose;
+	    private bool isDisposed;
 		
 		public FileSwitchDirectory(System.Collections.Generic.HashSet<string> primaryExtensions,
                                     Directory primaryDir, 
@@ -62,29 +63,33 @@ namespace Lucene.Net.Store
 		{
 			return secondaryDir;
 		}
-		
-		public override void  Close()
-		{
-			if (doClose)
-			{
-				try
-				{
-					secondaryDir.Close();
-				}
-				finally
-				{
-					primaryDir.Close();
-				}
-				doClose = false;
-			}
-		}
 
-        /// <summary>
-        /// .NET
-        /// </summary>
-        public override void Dispose()
+	    protected override void Dispose(bool disposing)
         {
-            Close();
+            if (isDisposed) return;
+
+            if (doClose)
+            {
+                try
+                {
+                    if (secondaryDir != null)
+                    {
+                        secondaryDir.Close();
+                    }
+                }
+                finally
+                {
+                    if (primaryDir != null)
+                    {
+                        primaryDir.Close();
+                    }
+                }
+                doClose = false;
+            }
+
+            secondaryDir = null;
+            primaryDir = null;
+            isDisposed = true;
         }
 		
 		public override System.String[] ListAll()



Mime
View raw message