lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [28/47] lucenenet git commit: Fixed bugs in Codecs.Pulsing (wrong disposing logic and key not found exception).
Date Tue, 11 Oct 2016 18:35:13 GMT
Fixed bugs in Codecs.Pulsing (wrong disposing logic and key not found exception).


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

Branch: refs/heads/master
Commit: a84f1734fde12ca03f57af4e71fa009c1453ea58
Parents: d5d18d0
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Mon Oct 10 14:37:31 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Tue Oct 11 00:26:24 2016 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a84f1734/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs b/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs
index 46e4eb9..acb3442 100644
--- a/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs
+++ b/src/Lucene.Net.Codecs/Pulsing/PulsingPostingsReader.cs
@@ -259,8 +259,10 @@ namespace Lucene.Net.Codecs.Pulsing
 
         protected override void Dispose(bool disposing)
         {
-            if (!disposing)
+            if (disposing)
+            {
                 _wrappedPostingsReader.Dispose();
+            }
         }
         
         /// <summary>
@@ -278,7 +280,9 @@ namespace Lucene.Net.Codecs.Pulsing
                 return null;
             
             var atts = de.Attributes();
-            return atts.AddAttribute<IPulsingEnumAttribute>().Enums()[this];
+            DocsEnum result;
+            atts.AddAttribute<IPulsingEnumAttribute>().Enums().TryGetValue(this, out
result);
+            return result;
         }
 
         /// <summary>


Mime
View raw message