You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2014/11/14 12:06:50 UTC

[2/7] lucenenet git commit: NRE on file without extension

NRE on file without extension


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

Branch: refs/heads/master
Commit: a4e8a7a0614b6ecdfd060fdbf862a955ca817900
Parents: a3f23a7
Author: mdissel <ma...@gmail.com>
Authored: Tue Nov 4 22:45:27 2014 +0100
Committer: mdissel <ma...@gmail.com>
Committed: Tue Nov 4 22:45:27 2014 +0100

----------------------------------------------------------------------
 .../Index/BaseIndexFileFormatTestCase.cs                       | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a4e8a7a0/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
index 693540e..95cb4e1 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
@@ -64,11 +64,13 @@ namespace Lucene.Net.Index
             IDictionary<string, long> bytesUsedByExtension = new Dictionary<string, long>();
             foreach (string file in d.ListAll())
             {
-                string ext = IndexFileNames.GetExtension(file);
+								string ext = IndexFileNames.GetExtension(file) ?? string.Empty;
                 long previousLength = bytesUsedByExtension.ContainsKey(ext) ? bytesUsedByExtension[ext] : 0;
                 bytesUsedByExtension[ext] = previousLength + d.FileLength(file);
             }
-            bytesUsedByExtension.Keys.RemoveAll(ExcludedExtensionsFromByteCounts());
+						foreach (string item in ExcludedExtensionsFromByteCounts()) {
+							bytesUsedByExtension.Remove(item);							
+						}
             return bytesUsedByExtension;
         }