lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [13/18] lucenenet git commit: Fix possible endless recursive call
Date Tue, 06 Jan 2015 03:46:29 GMT
Fix possible endless recursive call


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/b0bbd9e0
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/b0bbd9e0
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/b0bbd9e0

Branch: refs/heads/master
Commit: b0bbd9e0b85ec9ddb457a82f6d720ffbe1bb91a9
Parents: dae38d4
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Mon Jan 5 18:39:56 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Mon Jan 5 18:39:56 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Store/BaseDirectory.cs         |  2 --
 src/Lucene.Net.Core/Store/CompoundFileDirectory.cs |  8 ++++----
 src/Lucene.Net.Core/Store/Directory.cs             | 11 ++++-------
 src/Lucene.Net.Core/Store/FSDirectory.cs           |  5 +----
 src/Lucene.Net.Core/Store/RAMDirectory.cs          |  2 +-
 5 files changed, 10 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b0bbd9e0/src/Lucene.Net.Core/Store/BaseDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/BaseDirectory.cs b/src/Lucene.Net.Core/Store/BaseDirectory.cs
index 4fc9d75..120c072 100644
--- a/src/Lucene.Net.Core/Store/BaseDirectory.cs
+++ b/src/Lucene.Net.Core/Store/BaseDirectory.cs
@@ -25,8 +25,6 @@ namespace Lucene.Net.Store
     /// </summary>
     public abstract class BaseDirectory : Directory
     {
-        volatile protected internal bool IsOpen = true;
-
         /// <summary>
         /// Holds the LockFactory instance (implements locking for
         /// this Directory instance).

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b0bbd9e0/src/Lucene.Net.Core/Store/CompoundFileDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/CompoundFileDirectory.cs b/src/Lucene.Net.Core/Store/CompoundFileDirectory.cs
index cbb42f9..061048f 100644
--- a/src/Lucene.Net.Core/Store/CompoundFileDirectory.cs
+++ b/src/Lucene.Net.Core/Store/CompoundFileDirectory.cs
@@ -99,7 +99,7 @@ namespace Lucene.Net.Store
             this.Directory_Renamed = directory;
             this.FileName = fileName;
             this.ReadBufferSize = BufferedIndexInput.BufferSize(context);
-            this.IsOpen = false;
+            this.isOpen = false;
             this.OpenForWrite = openForWrite;
             if (!openForWrite)
             {
@@ -117,14 +117,14 @@ namespace Lucene.Net.Store
                         IOUtils.CloseWhileHandlingException(Handle);
                     }
                 }
-                this.IsOpen = true;
+                this.isOpen = true;
                 Writer = null;
             }
             else
             {
                 Debug.Assert(!(directory is CompoundFileDirectory), "compound file inside
of compound file: " + fileName);
                 this.Entries = SENTINEL;
-                this.IsOpen = true;
+                this.isOpen = true;
                 Writer = new CompoundFileWriter(directory, fileName);
                 Handle = null;
             }
@@ -301,7 +301,7 @@ namespace Lucene.Net.Store
                     // allow double close - usually to be consistent with other closeables
                     return; // already closed
                 }
-                IsOpen = false;
+                isOpen = false;
                 if (Writer != null)
                 {
                     Debug.Assert(OpenForWrite);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b0bbd9e0/src/Lucene.Net.Core/Store/Directory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/Directory.cs b/src/Lucene.Net.Core/Store/Directory.cs
index 7c341a1..82f2582 100644
--- a/src/Lucene.Net.Core/Store/Directory.cs
+++ b/src/Lucene.Net.Core/Store/Directory.cs
@@ -323,9 +323,9 @@ namespace Lucene.Net.Store
         /// </summary>
         private sealed class SlicedIndexInput : BufferedIndexInput
         {
-            internal IndexInput @base;
-            internal long FileOffset;
-            internal long Length_Renamed;
+            private IndexInput @base;
+            private long FileOffset;
+            private long Length_Renamed;
 
             internal SlicedIndexInput(string sliceDescription, IndexInput @base, long fileOffset,
long length)
                 : this(sliceDescription, @base, fileOffset, length, BufferedIndexInput.BUFFER_SIZE)
@@ -385,9 +385,6 @@ namespace Lucene.Net.Store
             }
         }
 
-        public virtual bool IsOpen
-        {
-            get { return IsOpen; }
-        }
+        public virtual bool IsOpen { get { return isOpen; }}
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b0bbd9e0/src/Lucene.Net.Core/Store/FSDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/FSDirectory.cs b/src/Lucene.Net.Core/Store/FSDirectory.cs
index 4e70822..0eb6c3f 100644
--- a/src/Lucene.Net.Core/Store/FSDirectory.cs
+++ b/src/Lucene.Net.Core/Store/FSDirectory.cs
@@ -434,10 +434,7 @@ namespace Lucene.Net.Store
         /// Closes the store to future operations. </summary>
         public override void Dispose()
         {
-            lock (this)
-            {
-                IsOpen = false;
-            }
+            isOpen = false;
         }
 
         /// <returns> the underlying filesystem directory </returns>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b0bbd9e0/src/Lucene.Net.Core/Store/RAMDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/RAMDirectory.cs b/src/Lucene.Net.Core/Store/RAMDirectory.cs
index 83da12a..7ced79b 100644
--- a/src/Lucene.Net.Core/Store/RAMDirectory.cs
+++ b/src/Lucene.Net.Core/Store/RAMDirectory.cs
@@ -252,7 +252,7 @@ namespace Lucene.Net.Store
         /// Closes the store to future operations, releasing associated memory. </summary>
         public override void Dispose()
         {
-            IsOpen = false;
+            isOpen = false;
             FileMap.Clear();
         }
     }


Mime
View raw message