lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhern...@apache.org
Subject [29/50] [abbrv] git commit: Fix bug with detecting fields
Date Tue, 24 Sep 2013 18:33:05 GMT
Fix bug with detecting fields


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

Branch: refs/heads/branch_4x
Commit: 12606ffb2955b01fe8b72acdd4c613161f6aeb02
Parents: ec36d0d
Author: Paul Irwin <paulirwin@gmail.com>
Authored: Tue Aug 6 18:43:23 2013 -0400
Committer: Paul Irwin <paulirwin@gmail.com>
Committed: Tue Aug 6 18:43:23 2013 -0400

----------------------------------------------------------------------
 src/core/Codecs/BlockTreeTermsReader.cs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/12606ffb/src/core/Codecs/BlockTreeTermsReader.cs
----------------------------------------------------------------------
diff --git a/src/core/Codecs/BlockTreeTermsReader.cs b/src/core/Codecs/BlockTreeTermsReader.cs
index 0c42784..f0148ce 100644
--- a/src/core/Codecs/BlockTreeTermsReader.cs
+++ b/src/core/Codecs/BlockTreeTermsReader.cs
@@ -100,11 +100,12 @@ namespace Lucene.Net.Codecs
                         throw new CorruptIndexException("invalid sumTotalTermFreq: " + sumTotalTermFreq
+ " sumDocFreq: " + sumDocFreq + " (resource=" + input + ")");
                     }
                     long indexStartFP = indexDivisor != -1 ? indexIn.ReadVLong() : 0;
-                    FieldReader previous = fields[fieldInfo.name] = new FieldReader(this,
fieldInfo, numTerms, rootCode, sumTotalTermFreq, sumDocFreq, docCount, indexStartFP, indexIn);
-                    if (previous != null)
+                    FieldReader previous;
+                    if (fields.TryGetValue(fieldInfo.name, out previous))
                     {
                         throw new CorruptIndexException("duplicate field: " + fieldInfo.name
+ " (resource=" + input + ")");
                     }
+                    fields[fieldInfo.name] = new FieldReader(this, fieldInfo, numTerms, rootCode,
sumTotalTermFreq, sumDocFreq, docCount, indexStartFP, indexIn);
                 }
                 if (indexDivisor != -1)
                 {


Mime
View raw message