Skip to content

Commit

Permalink
Update MutableLinkedList
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed Jun 6, 2024
1 parent 12be657 commit 6e2e80c
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.collection.mutable;

import kala.Conditions;
Expand All @@ -12,6 +27,7 @@
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.io.Serial;
import java.io.Serializable;
import java.util.Iterator;
import java.util.NoSuchElementException;
Expand All @@ -21,6 +37,7 @@

@Debug.Renderer(hasChildren = "isNotEmpty()", childrenArray = "toArray()")
public final class MutableLinkedList<E> extends AbstractMutableList<E> implements MutableStack<E>, MutableDeque<E>, Serializable {
@Serial
private static final long serialVersionUID = 8463536184690478447L;

private static final boolean enableAssertions = Boolean.getBoolean("kala.collection.mutable.MutableLinkedList.enableAssertions");
Expand Down Expand Up @@ -658,6 +675,7 @@ public void forEachNodeIndexed(@NotNull IndexedConsumer<? super Node<E>> action)
}
}

@Serial
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
out.writeInt(len);
Node<E> node = this.first;
Expand All @@ -667,6 +685,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws IOException {
}
}

@Serial
@SuppressWarnings("unchecked")
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException {
Expand Down

0 comments on commit 6e2e80c

Please sign in to comment.