You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2023/10/19 05:16:54 UTC
[lucenenet] branch master updated: 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. (#876)
This is an automated email from the ASF dual-hosted git repository.
nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
The following commit(s) were added to refs/heads/master by this push:
new b8aabe36b 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. (#876)
b8aabe36b is described below
commit b8aabe36b5a10f8843004958ab769faf28fc5462
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Thu Oct 19 12:16:49 2023 +0700
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. (#876)
---
src/Lucene.Net.Tests/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 4b789a5a0..b41d658af 100644
--- a/src/Lucene.Net.Tests/Util/TestPriorityQueue.cs
+++ b/src/Lucene.Net.Tests/Util/TestPriorityQueue.cs
@@ -1191,32 +1191,6 @@ namespace Lucene.Net.Util
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 9ab1f2f4e..e0906122d 100644
--- a/src/Lucene.Net/Util/PriorityQueue.cs
+++ b/src/Lucene.Net/Util/PriorityQueue.cs
@@ -482,9 +482,6 @@ namespace Lucene.Net.Util
/// <para/>
/// @lucene.internal
/// </summary>
-#if FEATURE_SERIALIZABLE
- [Serializable]
-#endif
public abstract class PriorityQueue<T>
{
private int size = 0;