lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [22/50] [abbrv] lucenenet git commit: Lucene.Net.Tests.Core.Index.TestTransactionRollback: Made RollbackDeletionPolicy, DeleteLastCommitPolicy, and KeepAllDeletionPolicy classes non-generic as they were in Lucene. The generic closing type name was collid
Date Wed, 25 Jan 2017 03:44:06 GMT
Lucene.Net.Tests.Core.Index.TestTransactionRollback: Made RollbackDeletionPolicy, DeleteLastCommitPolicy,
and KeepAllDeletionPolicy classes non-generic as they were in Lucene. The generic closing
type name was colliding with the name used on their methods.


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

Branch: refs/heads/api-work
Commit: 9c9cba2bf4ef21db1291cabf447fdbb8a535270b
Parents: 9aab47d
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Jan 25 05:41:12 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Jan 25 09:34:47 2017 +0700

----------------------------------------------------------------------
 .../core/Index/TestTransactionRollback.cs            | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9c9cba2b/src/Lucene.Net.Tests/core/Index/TestTransactionRollback.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestTransactionRollback.cs b/src/Lucene.Net.Tests/core/Index/TestTransactionRollback.cs
index cc43640..0ff979a 100644
--- a/src/Lucene.Net.Tests/core/Index/TestTransactionRollback.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestTransactionRollback.cs
@@ -70,7 +70,7 @@ namespace Lucene.Net.Index
                 throw new Exception("Couldn't find commit point " + id);
             }
 
-            IndexWriter w = new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(Random())).SetIndexDeletionPolicy(new RollbackDeletionPolicy<IndexCommit>(this,
id)).SetIndexCommit(last));
+            IndexWriter w = new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(Random())).SetIndexDeletionPolicy(new RollbackDeletionPolicy(this, id)).SetIndexCommit(last));
             IDictionary<string, string> data = new Dictionary<string, string>();
             data["index"] = "Rolled back to 1-" + id;
             w.CommitData = data;
@@ -139,7 +139,7 @@ namespace Lucene.Net.Index
             Dir = NewDirectory();
 
             //Build index, of records 1 to 100, committing after each batch of 10
-            IndexDeletionPolicy sdp = new KeepAllDeletionPolicy<IndexCommit>(this);
+            IndexDeletionPolicy sdp = new KeepAllDeletionPolicy(this);
             IndexWriter w = new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(Random())).SetIndexDeletionPolicy(sdp));
 
             for (int currentRecordId = 1; currentRecordId <= 100; currentRecordId++)
@@ -168,8 +168,7 @@ namespace Lucene.Net.Index
         }
 
         // Rolls back to previous commit point
-        internal class RollbackDeletionPolicy<T> : IndexDeletionPolicy
-            where T : IndexCommit
+        internal class RollbackDeletionPolicy : IndexDeletionPolicy
         {
             private readonly TestTransactionRollback OuterInstance;
 
@@ -217,8 +216,7 @@ namespace Lucene.Net.Index
             }
         }
 
-        internal class DeleteLastCommitPolicy<T> : IndexDeletionPolicy
-            where T : IndexCommit
+        internal class DeleteLastCommitPolicy : IndexDeletionPolicy
         {
             private readonly TestTransactionRollback OuterInstance;
 
@@ -244,7 +242,7 @@ namespace Lucene.Net.Index
             {
                 // Unless you specify a prior commit point, rollback
                 // should not work:
-                (new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetIndexDeletionPolicy(new
DeleteLastCommitPolicy<IndexCommit>(this)))).Dispose();
+                (new IndexWriter(Dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetIndexDeletionPolicy(new
DeleteLastCommitPolicy(this)))).Dispose();
                 IndexReader r = DirectoryReader.Open(Dir);
                 Assert.AreEqual(100, r.NumDocs);
                 r.Dispose();
@@ -252,8 +250,7 @@ namespace Lucene.Net.Index
         }
 
         // Keeps all commit points (used to build index)
-        internal class KeepAllDeletionPolicy<T> : IndexDeletionPolicy
-            where T : IndexCommit
+        internal class KeepAllDeletionPolicy : IndexDeletionPolicy
         {
             private readonly TestTransactionRollback OuterInstance;
 


Mime
View raw message