提交 341cd762 编写于 作者: S smarks

8213432: Better copies of CopiesList

Reviewed-by: rriggs, skoivu, ahgross, robm, rhalade, jeff
上级 885e5c97
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
package java.util; package java.util;
import java.io.Serializable; import java.io.Serializable;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream; import java.io.ObjectOutputStream;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Array; import java.lang.reflect.Array;
...@@ -37,6 +38,7 @@ import java.util.function.UnaryOperator; ...@@ -37,6 +38,7 @@ import java.util.function.UnaryOperator;
import java.util.stream.IntStream; import java.util.stream.IntStream;
import java.util.stream.Stream; import java.util.stream.Stream;
import java.util.stream.StreamSupport; import java.util.stream.StreamSupport;
import sun.misc.SharedSecrets;
/** /**
* This class consists exclusively of static methods that operate on or return * This class consists exclusively of static methods that operate on or return
...@@ -5075,6 +5077,11 @@ public class Collections { ...@@ -5075,6 +5077,11 @@ public class Collections {
public Spliterator<E> spliterator() { public Spliterator<E> spliterator() {
return stream().spliterator(); return stream().spliterator();
} }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
ois.defaultReadObject();
SharedSecrets.getJavaOISAccess().checkArray(ois, Object[].class, n);
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册