Skip to content

Commit

Permalink
Lucene.Net.Util.PriorityQueue: Removed [Serializable] attribute. Bina…
Browse files Browse the repository at this point in the history
…ry 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.
  • Loading branch information
NightOwl888 committed Oct 19, 2023
1 parent 96b6862 commit 98a922e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
26 changes: 0 additions & 26 deletions src/Lucene.Net.Tests/Util/TestPriorityQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions src/Lucene.Net/Util/PriorityQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,6 @@ public static int GetArrayHeapSize(int maxSize)
/// <para/>
/// @lucene.internal
/// </summary>
#if FEATURE_SERIALIZABLE
[Serializable]
#endif
public abstract class PriorityQueue<T>
{
private int size = 0;
Expand Down

0 comments on commit 98a922e

Please sign in to comment.