lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/2] lucenenet git commit: The checks in the stack trace to decide where the error was from were using the wrong variables to get the type of the object the method in the stack was calling from. Changed frame.GetType().Name to method.DeclaringType.Name
Date Tue, 03 Feb 2015 23:56:33 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 0275b4daf -> 511507fbb


The checks in the stack trace to decide where the error was from were using the wrong variables
to get the type of the object the method in the stack was calling from. Changed frame.GetType().Name
to method.DeclaringType.Name and fixed some casing problems in the constants.


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

Branch: refs/heads/master
Commit: 692b43c3dcd3c93bc1ec216fc309c581c991a65e
Parents: 0275b4d
Author: Chand2048 <Chand@Microsoft.com>
Authored: Mon Feb 2 09:53:29 2015 -0800
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Wed Feb 4 01:48:18 2015 +0200

----------------------------------------------------------------------
 .../core/Index/TestIndexWriterExceptions.cs     | 23 ++++++++++----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/692b43c3/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
index 2a4963b..aec7be5 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
@@ -705,7 +705,7 @@ namespace Lucene.Net.Index
                         {
                             break;
                         }
-                        if (typeof(FreqProxTermsWriterPerField).Name.Equals(frame.GetType().Name)
&& "Flush".Equals(method.Name))
+                        if (typeof(FreqProxTermsWriterPerField).Name.Equals(method.DeclaringType.Name)
&& "Flush".Equals(method.Name))
                         {
                             sawAppend = true;
                         }
@@ -1055,7 +1055,7 @@ namespace Lucene.Net.Index
                     foreach (var frame in trace.GetFrames())
                     {
                         var method = frame.GetMethod();
-                        if (DoFail && typeof(MockDirectoryWrapper).Name.Equals(frame.GetType().Name)
&& "Sync".Equals(method.Name))
+                        if (DoFail && typeof(MockDirectoryWrapper).Name.Equals(method.DeclaringType.Name)
&& "Sync".Equals(method.Name))
                         {
                             DidFail = true;
                             if (VERBOSE)
@@ -1120,8 +1120,8 @@ namespace Lucene.Net.Index
         {
             internal bool FailOnCommit, FailOnDeleteFile;
             internal readonly bool DontFailDuringGlobalFieldMap;
-            internal const string PREPARE_STAGE = "prepareCommit";
-            internal const string FINISH_STAGE = "finishCommit";
+            internal const string PREPARE_STAGE = "PrepareCommit";
+            internal const string FINISH_STAGE = "FinishCommit";
             internal readonly string Stage;
 
             public FailOnlyInCommit(bool dontFailDuringGlobalFieldMap, string stage)
@@ -1132,7 +1132,7 @@ namespace Lucene.Net.Index
 
             public override void Eval(MockDirectoryWrapper dir)
             {
-                var trace = new StackTrace(new Exception());
+                var trace = new StackTrace();
                 bool isCommit = false;
                 bool isDelete = false;
                 bool isInGlobalFieldMap = false;
@@ -1143,15 +1143,16 @@ namespace Lucene.Net.Index
                     {
                         break;
                     }
-                    if (typeof(SegmentInfos).Name.Equals(frame.GetType().Name) &&
Stage.Equals(method.Name))
+
+                    if (typeof(SegmentInfos).Name.Equals(method.DeclaringType.Name) &&
Stage.Equals(method.Name))
                     {
                         isCommit = true;
                     }
-                    if (typeof(MockDirectoryWrapper).Name.Equals(frame.GetType().Name) &&
"DeleteFile".Equals(method.Name))
+                    if (typeof(MockDirectoryWrapper).Name.Equals(method.DeclaringType.Name)
&& "DeleteFile".Equals(method.Name))
                     {
                         isDelete = true;
                     }
-                    if (typeof(SegmentInfos).Name.Equals(frame.GetType().Name) &&
"WriteGlobalFieldMap".Equals(method.Name))
+                    if (typeof(SegmentInfos).Name.Equals(method.DeclaringType.Name) &&
"WriteGlobalFieldMap".Equals(method.Name))
                     {
                         isInGlobalFieldMap = true;
                     }
@@ -1660,8 +1661,8 @@ namespace Lucene.Net.Index
 
         private class FailOnTermVectors : MockDirectoryWrapper.Failure
         {
-            internal const string INIT_STAGE = "initTermVectorsWriter";
-            internal const string AFTER_INIT_STAGE = "finishDocument";
+            internal const string INIT_STAGE = "InitTermVectorsWriter";
+            internal const string AFTER_INIT_STAGE = "FinishDocument";
             internal const string EXC_MSG = "FOTV";
             internal readonly string Stage;
 
@@ -1677,7 +1678,7 @@ namespace Lucene.Net.Index
                 foreach (var frame in trace.GetFrames())
                 {
                     var method = frame.GetMethod();
-                    if (typeof(TermVectorsConsumer).Name.Equals(frame.GetType().Name) &&
Stage.Equals(method.Name))
+                    if (typeof(TermVectorsConsumer).Name.Equals(method.DeclaringType.Name)
&& Stage.Equals(method.Name))
                     {
                         fail = true;
                         break;


Mime
View raw message