lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [13/15] lucenenet git commit: BUG: Lucene.Net.TestFramework.Util.LuceneTestCase: Use dir.OpenInput() to determine if a file exists, just like in Lucene and always catch exceptions so we can return false if it doesn't
Date Fri, 24 Mar 2017 02:02:45 GMT
BUG: Lucene.Net.TestFramework.Util.LuceneTestCase: Use dir.OpenInput() to determine if a file
exists, just like in Lucene and always catch exceptions so we can return false if it doesn't


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

Branch: refs/heads/api-work
Commit: 93f3f48315b8c87d0d63840a091468eae53f58f6
Parents: 3b122d0
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Fri Mar 24 05:05:32 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Fri Mar 24 06:28:23 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/93f3f483/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 878168a..8d2e0f8 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -2644,18 +2644,19 @@ namespace Lucene.Net.Util
         /// </summary>
         public static bool SlowFileExists(Directory dir, string fileName)
         {
-#pragma warning disable 612, 618
-            return dir.FileExists(fileName);
-#pragma warning restore 612, 618
-            /*try
+            try
             {
                 dir.OpenInput(fileName, IOContext.DEFAULT).Dispose();
                 return true;
             }
-            catch (FileNotFoundException e)
+            catch (FileNotFoundException)
             {
                 return false;
-            }*/
+            }
+            catch (NoSuchFileException)
+            {
+                return false;
+            }
         }
 
         /// <summary>


Mime
View raw message