From 98a922e308db6d4d122cce55b67648251b3ed19d Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 19 Oct 2023 11:51:21 +0700 Subject: [PATCH] Lucene.Net.Util.PriorityQueue: Removed [Serializable] attribute. Binary serialization is obsolete in .NET 6+, and serialization didn't technically support extension anyway because it was missing the virtual GetObjectData and OnDeserialization methods and deserialization constructor. --- .../Util/TestPriorityQueue.cs | 26 ------------------- src/Lucene.Net/Util/PriorityQueue.cs | 3 --- 2 files changed, 29 deletions(-) diff --git a/src/Lucene.Net.Tests/Util/TestPriorityQueue.cs b/src/Lucene.Net.Tests/Util/TestPriorityQueue.cs index 4b789a5a09..b41d658af7 100644 --- a/src/Lucene.Net.Tests/Util/TestPriorityQueue.cs +++ b/src/Lucene.Net.Tests/Util/TestPriorityQueue.cs @@ -1191,32 +1191,6 @@ public static void ValuePriorityQueue_Benchmarks() pq.Clear(); } -#if FEATURE_SERIALIZABLE - - [Test, LuceneNetSpecific] - public void TestSerialization() - { - var queue = new IntegerQueue(10); - var expected = new int?[11]; - - for (int i = 0; i < 10; i++) - { - queue.Add(i); - expected[i + 1] = i; - } - - Assert.AreEqual(10, queue.maxSize); - Assert.AreEqual(expected, queue.heap); - Assert.AreEqual(10, queue.Count); - - var clone = Clone(queue); - - Assert.AreEqual(10, clone.maxSize); - Assert.AreEqual(expected, clone.heap); - Assert.AreEqual(10, clone.Count); - } -#endif - private static int GetArrayHeapSize(int maxSize) { return PriorityQueue.GetArrayHeapSize(maxSize); diff --git a/src/Lucene.Net/Util/PriorityQueue.cs b/src/Lucene.Net/Util/PriorityQueue.cs index 9ab1f2f4ed..e0906122d8 100644 --- a/src/Lucene.Net/Util/PriorityQueue.cs +++ b/src/Lucene.Net/Util/PriorityQueue.cs @@ -482,9 +482,6 @@ public static int GetArrayHeapSize(int maxSize) /// /// @lucene.internal /// -#if FEATURE_SERIALIZABLE - [Serializable] -#endif public abstract class PriorityQueue { private int size = 0;