lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/7] lucenenet git commit: NRE on file without extension
Date Fri, 14 Nov 2014 11:06:50 GMT
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 <marco.dissel@gmail.com>
Authored: Tue Nov 4 22:45:27 2014 +0100
Committer: mdissel <marco.dissel@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;
         }
 


Mime
View raw message