mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
Merge
This commit is contained in:
commit
8d141f1048
561 changed files with 10985 additions and 8895 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, Azul Systems, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -2004,6 +2005,17 @@ public abstract class ClassLoader {
|
|||
return scl;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize default paths for native libraries search.
|
||||
* Must be done early as JDK may load libraries during bootstrap.
|
||||
*
|
||||
* @see java.lang.System#initPhase1
|
||||
*/
|
||||
static void initLibraryPaths() {
|
||||
usr_paths = initializePath("java.library.path");
|
||||
sys_paths = initializePath("sun.boot.library.path");
|
||||
}
|
||||
|
||||
// Returns true if the specified class loader can be found in this class
|
||||
// loader's delegation chain.
|
||||
boolean isAncestor(ClassLoader cl) {
|
||||
|
@ -2473,8 +2485,7 @@ public abstract class ClassLoader {
|
|||
*
|
||||
* We use a static stack to hold the list of libraries we are
|
||||
* loading because this can happen only when called by the
|
||||
* same thread because Runtime.load and Runtime.loadLibrary
|
||||
* are synchronous.
|
||||
* same thread because this block is synchronous.
|
||||
*
|
||||
* If there is a pending load operation for the library, we
|
||||
* immediately return success; otherwise, we raise
|
||||
|
@ -2619,10 +2630,9 @@ public abstract class ClassLoader {
|
|||
boolean isAbsolute) {
|
||||
ClassLoader loader =
|
||||
(fromClass == null) ? null : fromClass.getClassLoader();
|
||||
if (sys_paths == null) {
|
||||
usr_paths = initializePath("java.library.path");
|
||||
sys_paths = initializePath("sun.boot.library.path");
|
||||
}
|
||||
assert sys_paths != null : "should be initialized at this point";
|
||||
assert usr_paths != null : "should be initialized at this point";
|
||||
|
||||
if (isAbsolute) {
|
||||
if (loadLibrary0(fromClass, new File(name))) {
|
||||
return;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, Azul Systems, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -732,7 +733,7 @@ public class Runtime {
|
|||
load0(Reflection.getCallerClass(), filename);
|
||||
}
|
||||
|
||||
synchronized void load0(Class<?> fromClass, String filename) {
|
||||
void load0(Class<?> fromClass, String filename) {
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null) {
|
||||
security.checkLink(filename);
|
||||
|
@ -794,14 +795,14 @@ public class Runtime {
|
|||
loadLibrary0(Reflection.getCallerClass(), libname);
|
||||
}
|
||||
|
||||
synchronized void loadLibrary0(Class<?> fromClass, String libname) {
|
||||
void loadLibrary0(Class<?> fromClass, String libname) {
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null) {
|
||||
security.checkLink(libname);
|
||||
}
|
||||
if (libname.indexOf((int)File.separatorChar) != -1) {
|
||||
throw new UnsatisfiedLinkError(
|
||||
"Directory separator should not appear in library name: " + libname);
|
||||
"Directory separator should not appear in library name: " + libname);
|
||||
}
|
||||
ClassLoader.loadLibrary(fromClass, libname, false);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -191,6 +191,12 @@ class StringCoding {
|
|||
return result.with(StringLatin1.inflate(ba, off, len), UTF16);
|
||||
}
|
||||
}
|
||||
// fastpath for always Latin1 decodable single byte
|
||||
if (COMPACT_STRINGS && cd instanceof ArrayDecoder && ((ArrayDecoder)cd).isLatin1Decodable()) {
|
||||
byte[] dst = new byte[len];
|
||||
((ArrayDecoder)cd).decodeToLatin1(ba, off, len, dst);
|
||||
return result.with(dst, LATIN1);
|
||||
}
|
||||
int en = scale(len, cd.maxCharsPerByte());
|
||||
char[] ca = new char[en];
|
||||
if (cd instanceof ArrayDecoder) {
|
||||
|
@ -278,6 +284,13 @@ class StringCoding {
|
|||
((ArrayDecoder)cd).isASCIICompatible() && !hasNegatives(ba, off, len)) {
|
||||
return decodeLatin1(ba, off, len);
|
||||
}
|
||||
// fastpath for always Latin1 decodable single byte
|
||||
if (COMPACT_STRINGS && cd instanceof ArrayDecoder && ((ArrayDecoder)cd).isLatin1Decodable()) {
|
||||
byte[] dst = new byte[len];
|
||||
((ArrayDecoder)cd).decodeToLatin1(ba, off, len, dst);
|
||||
return new Result().with(dst, LATIN1);
|
||||
}
|
||||
|
||||
int en = scale(len, cd.maxCharsPerByte());
|
||||
if (len == 0) {
|
||||
return new Result().with();
|
||||
|
|
|
@ -2045,6 +2045,8 @@ public final class System {
|
|||
// register shared secrets
|
||||
setJavaLangAccess();
|
||||
|
||||
ClassLoader.initLibraryPaths();
|
||||
|
||||
// Subsystems that are invoked during initialization can invoke
|
||||
// VM.isBooted() in order to avoid doing things that should
|
||||
// wait until the VM is fully initialized. The initialization level
|
||||
|
|
|
@ -230,6 +230,7 @@ public class Throwable implements Serializable {
|
|||
* @serial
|
||||
* @since 1.7
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private List<Throwable> suppressedExceptions = SUPPRESSED_SENTINEL;
|
||||
|
||||
/** Message for trying to suppress a null exception. */
|
||||
|
|
|
@ -76,6 +76,7 @@ public final class SerializedLambda implements Serializable {
|
|||
private final String implMethodSignature;
|
||||
private final int implMethodKind;
|
||||
private final String instantiatedMethodType;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final Object[] capturedArgs;
|
||||
|
||||
/**
|
||||
|
|
|
@ -308,6 +308,7 @@ public class Proxy implements java.io.Serializable {
|
|||
* the invocation handler for this proxy instance.
|
||||
* @serial
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
protected InvocationHandler h;
|
||||
|
||||
/**
|
||||
|
|
|
@ -434,14 +434,15 @@ class DatagramSocket implements java.io.Closeable {
|
|||
* verify that datagrams are permitted to be sent and received
|
||||
* respectively.
|
||||
*
|
||||
* <p> When a socket is connected, {@link #receive receive} and
|
||||
* {@link #send send} <b>will not perform any security checks</b>
|
||||
* on incoming and outgoing packets, other than matching the packet's
|
||||
* and the socket's address and port. On a send operation, if the
|
||||
* packet's address is set and the packet's address and the socket's
|
||||
* address do not match, an {@code IllegalArgumentException} will be
|
||||
* thrown. A socket connected to a multicast address may only be used
|
||||
* to send packets.
|
||||
* <p> Care should be taken to ensure that a connected datagram socket
|
||||
* is not shared with untrusted code. When a socket is connected,
|
||||
* {@link #receive receive} and {@link #send send} <b>will not perform
|
||||
* any security checks</b> on incoming and outgoing packets, other than
|
||||
* matching the packet's and the socket's address and port. On a send
|
||||
* operation, if the packet's address is set and the packet's address
|
||||
* and the socket's address do not match, an {@code IllegalArgumentException}
|
||||
* will be thrown. A socket connected to a multicast address may only
|
||||
* be used to send packets.
|
||||
*
|
||||
* @param address the remote address for the socket
|
||||
*
|
||||
|
@ -708,9 +709,11 @@ class DatagramSocket implements java.io.Closeable {
|
|||
* the length of the received message. If the message is longer than
|
||||
* the packet's length, the message is truncated.
|
||||
* <p>
|
||||
* If there is a security manager, a packet cannot be received if the
|
||||
* security manager's {@code checkAccept} method
|
||||
* does not allow it.
|
||||
* If there is a security manager, and the socket is not currently
|
||||
* connected to a remote address, a packet cannot be received if the
|
||||
* security manager's {@code checkAccept} method does not allow it.
|
||||
* Datagrams that are not permitted by the security manager are silently
|
||||
* discarded.
|
||||
*
|
||||
* @param p the {@code DatagramPacket} into which to place
|
||||
* the incoming data.
|
||||
|
@ -896,12 +899,15 @@ class DatagramSocket implements java.io.Closeable {
|
|||
*
|
||||
* @param timeout the specified timeout in milliseconds.
|
||||
* @throws SocketException if there is an error in the underlying protocol, such as an UDP error.
|
||||
* @throws IllegalArgumentException if {@code timeout} is negative
|
||||
* @since 1.1
|
||||
* @see #getSoTimeout()
|
||||
*/
|
||||
public synchronized void setSoTimeout(int timeout) throws SocketException {
|
||||
if (isClosed())
|
||||
throw new SocketException("Socket is closed");
|
||||
if (timeout < 0)
|
||||
throw new IllegalArgumentException("timeout < 0");
|
||||
getImpl().setOption(SocketOptions.SO_TIMEOUT, timeout);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -265,7 +265,10 @@ public abstract class DatagramChannel
|
|||
* java.lang.SecurityManager#checkAccept checkAccept} and {@link
|
||||
* java.lang.SecurityManager#checkConnect checkConnect} methods permit
|
||||
* datagrams to be received from and sent to, respectively, the given
|
||||
* remote address.
|
||||
* remote address. Once connected, no further security checks are performed
|
||||
* for datagrams received from, or sent to, the given remote address. Care
|
||||
* should be taken to ensure that a connected datagram channel is not shared
|
||||
* with untrusted code.
|
||||
*
|
||||
* <p> This method may be invoked at any time. It will not have any effect
|
||||
* on read or write operations that are already in progress at the moment
|
||||
|
@ -325,6 +328,10 @@ public abstract class DatagramChannel
|
|||
* <p> If this channel's socket is not connected, or if the channel is
|
||||
* closed, then invoking this method has no effect. </p>
|
||||
*
|
||||
* @apiNote If this method throws an IOException, the channel's socket
|
||||
* may be left in an unspecified state. It is strongly recommended that
|
||||
* the channel be closed when disconnect fails.
|
||||
*
|
||||
* @return This datagram channel
|
||||
*
|
||||
* @throws IOException
|
||||
|
@ -369,9 +376,10 @@ public abstract class DatagramChannel
|
|||
* to a specific remote address and a security manager has been installed
|
||||
* then for each datagram received this method verifies that the source's
|
||||
* address and port number are permitted by the security manager's {@link
|
||||
* java.lang.SecurityManager#checkAccept checkAccept} method. The overhead
|
||||
* of this security check can be avoided by first connecting the socket via
|
||||
* the {@link #connect connect} method.
|
||||
* java.lang.SecurityManager#checkAccept checkAccept} method. Datagrams
|
||||
* that are not permitted by the security manager are silently discarded.
|
||||
* The overhead of this security check can be avoided by first connecting
|
||||
* the socket via the {@link #connect connect} method.
|
||||
*
|
||||
* <p> This method may be invoked at any time. If another thread has
|
||||
* already initiated a read operation upon this channel, however, then an
|
||||
|
@ -401,11 +409,6 @@ public abstract class DatagramChannel
|
|||
* closing the channel and setting the current thread's
|
||||
* interrupt status
|
||||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager has been installed
|
||||
* and it does not permit datagrams to be accepted
|
||||
* from the datagram's sender
|
||||
*
|
||||
* @throws IOException
|
||||
* If some other I/O error occurs
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -25,7 +25,8 @@
|
|||
|
||||
package java.nio.channels;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
/**
|
||||
* A token representing the registration of a {@link SelectableChannel} with a
|
||||
|
@ -428,13 +429,17 @@ public abstract class SelectionKey {
|
|||
|
||||
// -- Attachments --
|
||||
|
||||
private static final VarHandle ATTACHMENT;
|
||||
static {
|
||||
try {
|
||||
MethodHandles.Lookup l = MethodHandles.lookup();
|
||||
ATTACHMENT = l.findVarHandle(SelectionKey.class, "attachment", Object.class);
|
||||
} catch (Exception e) {
|
||||
throw new InternalError(e);
|
||||
}
|
||||
}
|
||||
private volatile Object attachment;
|
||||
|
||||
private static final AtomicReferenceFieldUpdater<SelectionKey,Object>
|
||||
attachmentUpdater = AtomicReferenceFieldUpdater.newUpdater(
|
||||
SelectionKey.class, Object.class, "attachment"
|
||||
);
|
||||
|
||||
/**
|
||||
* Attaches the given object to this key.
|
||||
*
|
||||
|
@ -450,7 +455,7 @@ public abstract class SelectionKey {
|
|||
* otherwise {@code null}
|
||||
*/
|
||||
public final Object attach(Object ob) {
|
||||
return attachmentUpdater.getAndSet(this, ob);
|
||||
return ATTACHMENT.getAndSet(this, ob);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3550,8 +3550,8 @@ public final class Files {
|
|||
// ensure lines is not null before opening file
|
||||
Objects.requireNonNull(lines);
|
||||
CharsetEncoder encoder = cs.newEncoder();
|
||||
OutputStream out = newOutputStream(path, options);
|
||||
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) {
|
||||
try (OutputStream out = newOutputStream(path, options);
|
||||
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) {
|
||||
for (CharSequence line: lines) {
|
||||
writer.append(line);
|
||||
writer.newLine();
|
||||
|
|
|
@ -52,7 +52,9 @@ public class GuardedObject implements java.io.Serializable {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -5240450096227834308L;
|
||||
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Object object; // the object we are guarding
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Guard guard; // the guard
|
||||
|
||||
/**
|
||||
|
|
|
@ -1043,6 +1043,7 @@ public class SecureRandom extends java.util.Random {
|
|||
/**
|
||||
* @serial
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private MessageDigest digest = null;
|
||||
/**
|
||||
* @serial
|
||||
|
|
|
@ -641,6 +641,7 @@ public abstract class Clock {
|
|||
static final class OffsetClock extends Clock implements Serializable {
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 2007484719125426256L;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final Clock baseClock;
|
||||
private final Duration offset;
|
||||
|
||||
|
@ -692,6 +693,7 @@ public abstract class Clock {
|
|||
static final class TickClock extends Clock implements Serializable {
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 6504659149906368850L;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final Clock baseClock;
|
||||
private final long tickNanos;
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ final class ChronoPeriodImpl
|
|||
/**
|
||||
* The chronology.
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final Chronology chrono;
|
||||
/**
|
||||
* The number of years.
|
||||
|
|
|
@ -607,7 +607,9 @@ public abstract class AbstractMap<K,V> implements Map<K,V> {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -8499721149061103585L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final K key;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private V value;
|
||||
|
||||
/**
|
||||
|
@ -738,7 +740,9 @@ public abstract class AbstractMap<K,V> implements Map<K,V> {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 7138329143949025153L;
|
||||
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final K key;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final V value;
|
||||
|
||||
/**
|
||||
|
|
|
@ -103,10 +103,15 @@ class ArrayPrefixHelpers {
|
|||
static final int MIN_PARTITION = 16;
|
||||
|
||||
static final class CumulateTask<T> extends CountedCompleter<Void> {
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final T[] array;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final BinaryOperator<T> function;
|
||||
CumulateTask<T> left, right;
|
||||
T in, out;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
T in;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
T out;
|
||||
final int lo, hi, origin, fence, threshold;
|
||||
|
||||
/** Root task constructor */
|
||||
|
@ -257,6 +262,7 @@ class ArrayPrefixHelpers {
|
|||
|
||||
static final class LongCumulateTask extends CountedCompleter<Void> {
|
||||
final long[] array;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final LongBinaryOperator function;
|
||||
LongCumulateTask left, right;
|
||||
long in, out;
|
||||
|
@ -408,6 +414,7 @@ class ArrayPrefixHelpers {
|
|||
|
||||
static final class DoubleCumulateTask extends CountedCompleter<Void> {
|
||||
final double[] array;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final DoubleBinaryOperator function;
|
||||
DoubleCumulateTask left, right;
|
||||
double in, out;
|
||||
|
@ -559,6 +566,7 @@ class ArrayPrefixHelpers {
|
|||
|
||||
static final class IntCumulateTask extends CountedCompleter<Void> {
|
||||
final int[] array;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final IntBinaryOperator function;
|
||||
IntCumulateTask left, right;
|
||||
int in, out;
|
||||
|
|
|
@ -4339,6 +4339,7 @@ public class Arrays {
|
|||
{
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -2764017481108945198L;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final E[] a;
|
||||
|
||||
ArrayList(E[] array) {
|
||||
|
|
|
@ -115,8 +115,12 @@ import java.util.concurrent.CountedCompleter;
|
|||
static final class Sorter<T> extends CountedCompleter<Void> {
|
||||
@java.io.Serial
|
||||
static final long serialVersionUID = 2446542900576103244L;
|
||||
final T[] a, w;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final T[] a;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final T[] w;
|
||||
final int base, size, wbase, gran;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
Comparator<? super T> comparator;
|
||||
Sorter(CountedCompleter<?> par, T[] a, T[] w, int base, int size,
|
||||
int wbase, int gran,
|
||||
|
@ -153,8 +157,13 @@ import java.util.concurrent.CountedCompleter;
|
|||
static final class Merger<T> extends CountedCompleter<Void> {
|
||||
@java.io.Serial
|
||||
static final long serialVersionUID = 2446542900576103244L;
|
||||
final T[] a, w; // main and workspace arrays
|
||||
// main and workspace arrays
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final T[] a;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
final T[] w;
|
||||
final int lbase, lsize, rbase, rsize, wbase, gran;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
Comparator<? super T> comparator;
|
||||
Merger(CountedCompleter<?> par, T[] a, T[] w,
|
||||
int lbase, int lsize, int rbase,
|
||||
|
|
|
@ -188,6 +188,38 @@ import java.util.stream.StreamSupport;
|
|||
* or if the only reference to the backing collection is through an
|
||||
* unmodifiable view, the view can be considered effectively immutable.
|
||||
*
|
||||
* <h2><a id="serializable">Serializability of Collections</a></h2>
|
||||
*
|
||||
* <p>Serializability of collections is optional. As such, none of the collections
|
||||
* interfaces are declared to implement the {@link java.io.Serializable} interface.
|
||||
* However, serializability is regarded as being generally useful, so most collection
|
||||
* implementations are serializable.
|
||||
*
|
||||
* <p>The collection implementations that are public classes (such as {@code ArrayList}
|
||||
* or {@code HashMap}) are declared to implement the {@code Serializable} interface if they
|
||||
* are in fact serializable. Some collections implementations are not public classes,
|
||||
* such as the <a href="#unmodifiable">unmodifiable collections.</a> In such cases, the
|
||||
* serializability of such collections is described in the specification of the method
|
||||
* that creates them, or in some other suitable place. In cases where the serializability
|
||||
* of a collection is not specified, there is no guarantee about the serializability of such
|
||||
* collections. In particular, many <a href="#view">view collections</a> are not serializable.
|
||||
*
|
||||
* <p>A collection implementation that implements the {@code Serializable} interface cannot
|
||||
* be guaranteed to be serializable. The reason is that in general, collections
|
||||
* contain elements of other types, and it is not possible to determine statically
|
||||
* whether instances of some element type are actually serializable. For example, consider
|
||||
* a serializable {@code Collection<E>}, where {@code E} does not implement the
|
||||
* {@code Serializable} interface. The collection may be serializable, if it contains only
|
||||
* elements of some serializable subtype of {@code E}, or if it is empty. Collections are
|
||||
* thus said to be <i>conditionally serializable,</i> as the serializability of the collection
|
||||
* as a whole depends on whether the collection itself is serializable and on whether all
|
||||
* contained elements are also serializable.
|
||||
*
|
||||
* <p>An additional case occurs with instances of {@link SortedSet} and {@link SortedMap}.
|
||||
* These collections can be created with a {@link Comparator} that imposes an ordering on
|
||||
* the set elements or map keys. Such a collection is serializable only if the provided
|
||||
* {@code Comparator} is also serializable.
|
||||
*
|
||||
* <p>This interface is a member of the
|
||||
* <a href="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework">
|
||||
* Java Collections Framework</a>.
|
||||
|
|
|
@ -1024,6 +1024,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 1820017752578914078L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Collection<? extends E> c;
|
||||
|
||||
UnmodifiableCollection(Collection<? extends E> c) {
|
||||
|
@ -1164,6 +1165,7 @@ public class Collections {
|
|||
implements SortedSet<E>, Serializable {
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -4929149591599911165L;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final SortedSet<E> ss;
|
||||
|
||||
UnmodifiableSortedSet(SortedSet<E> s) {super(s); ss = s;}
|
||||
|
@ -1244,6 +1246,7 @@ public class Collections {
|
|||
/**
|
||||
* The instance we are protecting.
|
||||
*/
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final NavigableSet<E> ns;
|
||||
|
||||
UnmodifiableNavigableSet(NavigableSet<E> s) {super(s); ns = s;}
|
||||
|
@ -1304,6 +1307,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -283967356065247728L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final List<? extends E> list;
|
||||
|
||||
UnmodifiableList(List<? extends E> list) {
|
||||
|
@ -1450,6 +1454,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -1034234728574286014L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final Map<? extends K, ? extends V> m;
|
||||
|
||||
UnmodifiableMap(Map<? extends K, ? extends V> m) {
|
||||
|
@ -1809,6 +1814,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -8806743815996713206L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final SortedMap<K, ? extends V> sm;
|
||||
|
||||
UnmodifiableSortedMap(SortedMap<K, ? extends V> m) {super(m); sm = m; }
|
||||
|
@ -1886,6 +1892,7 @@ public class Collections {
|
|||
/**
|
||||
* The instance we wrap and protect.
|
||||
*/
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final NavigableMap<K, ? extends V> nm;
|
||||
|
||||
UnmodifiableNavigableMap(NavigableMap<K, ? extends V> m)
|
||||
|
@ -2017,7 +2024,9 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 3053995032091335093L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Collection<E> c; // Backing Collection
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Object mutex; // Object on which to synchronize
|
||||
|
||||
SynchronizedCollection(Collection<E> c) {
|
||||
|
@ -2219,6 +2228,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 8695801310862127406L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final SortedSet<E> ss;
|
||||
|
||||
SynchronizedSortedSet(SortedSet<E> s) {
|
||||
|
@ -2314,6 +2324,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -5505529816273629798L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final NavigableSet<E> ns;
|
||||
|
||||
SynchronizedNavigableSet(NavigableSet<E> s) {
|
||||
|
@ -2424,6 +2435,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -7754090372962971524L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final List<E> list;
|
||||
|
||||
SynchronizedList(List<E> list) {
|
||||
|
@ -2591,7 +2603,9 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 1978198479659022715L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final Map<K,V> m; // Backing Map
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Object mutex; // Object on which to synchronize
|
||||
|
||||
SynchronizedMap(Map<K,V> m) {
|
||||
|
@ -2788,6 +2802,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -8798146769416483793L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final SortedMap<K,V> sm;
|
||||
|
||||
SynchronizedSortedMap(SortedMap<K,V> m) {
|
||||
|
@ -2891,6 +2906,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 699392247599746807L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final NavigableMap<K,V> nm;
|
||||
|
||||
SynchronizedNavigableMap(NavigableMap<K,V> m) {
|
||||
|
@ -3070,7 +3086,9 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 1578914078182001775L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Collection<E> c;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Class<E> type;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -3126,6 +3144,7 @@ public class Collections {
|
|||
|
||||
public boolean add(E e) { return c.add(typeCheck(e)); }
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private E[] zeroLengthElementArray; // Lazily initialized
|
||||
|
||||
private E[] zeroLengthElementArray() {
|
||||
|
@ -3219,6 +3238,7 @@ public class Collections {
|
|||
{
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 1433151992604707767L;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Queue<E> queue;
|
||||
|
||||
CheckedQueue(Queue<E> queue, Class<E> elementType) {
|
||||
|
@ -3323,6 +3343,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 1599911165492914959L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final SortedSet<E> ss;
|
||||
|
||||
CheckedSortedSet(SortedSet<E> s, Class<E> type) {
|
||||
|
@ -3387,6 +3408,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -5429120189805438922L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final NavigableSet<E> ns;
|
||||
|
||||
CheckedNavigableSet(NavigableSet<E> s, Class<E> type) {
|
||||
|
@ -3470,6 +3492,7 @@ public class Collections {
|
|||
{
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 65247728283967356L;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final List<E> list;
|
||||
|
||||
CheckedList(List<E> list, Class<E> type) {
|
||||
|
@ -3619,8 +3642,11 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 5742860141034234728L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final Map<K, V> m;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Class<K> keyType;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Class<V> valueType;
|
||||
|
||||
private void typeCheck(Object key, Object value) {
|
||||
|
@ -4019,6 +4045,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 1599671320688067438L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final SortedMap<K, V> sm;
|
||||
|
||||
CheckedSortedMap(SortedMap<K, V> m,
|
||||
|
@ -4094,6 +4121,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -4852462692372534096L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final NavigableMap<K, V> nm;
|
||||
|
||||
CheckedNavigableMap(NavigableMap<K, V> m,
|
||||
|
@ -4825,6 +4853,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 3193687207550431679L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final E element;
|
||||
|
||||
SingletonSet(E e) {element = e;}
|
||||
|
@ -4879,6 +4908,7 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 3093736618740652951L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final E element;
|
||||
|
||||
SingletonList(E obj) {element = obj;}
|
||||
|
@ -4948,7 +4978,9 @@ public class Collections {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -6979724477215052911L;
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final K k;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final V v;
|
||||
|
||||
SingletonMap(K key, V value) {
|
||||
|
@ -5087,6 +5119,7 @@ public class Collections {
|
|||
private static final long serialVersionUID = 2739099268398711800L;
|
||||
|
||||
final int n;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final E element;
|
||||
|
||||
CopiesList(int n, E e) {
|
||||
|
@ -5320,6 +5353,7 @@ public class Collections {
|
|||
*
|
||||
* @serial
|
||||
*/
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final Comparator<T> cmp;
|
||||
|
||||
ReverseComparator2(Comparator<T> cmp) {
|
||||
|
@ -5601,6 +5635,7 @@ public class Collections {
|
|||
private static class SetFromMap<E> extends AbstractSet<E>
|
||||
implements Set<E>, Serializable
|
||||
{
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final Map<E, Boolean> m; // The backing map
|
||||
private transient Set<E> s; // Its keySet
|
||||
|
||||
|
@ -5686,6 +5721,7 @@ public class Collections {
|
|||
implements Queue<E>, Serializable {
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 1802017725587941708L;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final Deque<E> q;
|
||||
AsLIFOQueue(Deque<E> q) { this.q = q; }
|
||||
public boolean add(E e) { q.addFirst(e); return true; }
|
||||
|
|
|
@ -66,6 +66,7 @@ class Comparators {
|
|||
private static final long serialVersionUID = -7569533591570686392L;
|
||||
private final boolean nullFirst;
|
||||
// if null, non-null Ts are considered equal
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final Comparator<T> real;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -111,6 +111,7 @@ public class PriorityQueue<E> extends AbstractQueue<E>
|
|||
* The comparator, or null if priority queue uses elements'
|
||||
* natural ordering.
|
||||
*/
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final Comparator<? super E> comparator;
|
||||
|
||||
/**
|
||||
|
|
|
@ -118,6 +118,7 @@ public class TreeMap<K,V>
|
|||
*
|
||||
* @serial
|
||||
*/
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final Comparator<? super K> comparator;
|
||||
|
||||
private transient Entry<K,V> root;
|
||||
|
@ -1353,7 +1354,10 @@ public class TreeMap<K,V>
|
|||
* if loInclusive is true, lo is the inclusive bound, else lo
|
||||
* is the exclusive bound. Similarly for the upper bound.
|
||||
*/
|
||||
final K lo, hi;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final K lo;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
final K hi;
|
||||
final boolean fromStart, toEnd;
|
||||
final boolean loInclusive, hiInclusive;
|
||||
|
||||
|
@ -1936,6 +1940,7 @@ public class TreeMap<K,V>
|
|||
super(m, fromStart, lo, loInclusive, toEnd, hi, hiInclusive);
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final Comparator<? super K> reverseComparator =
|
||||
Collections.reverseOrder(m.comparator);
|
||||
|
||||
|
@ -2024,7 +2029,10 @@ public class TreeMap<K,V>
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = -6520786458950516097L;
|
||||
private boolean fromStart = false, toEnd = false;
|
||||
private K fromKey, toKey;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private K fromKey;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private K toKey;
|
||||
@java.io.Serial
|
||||
private Object readResolve() {
|
||||
return new AscendingSubMap<>(TreeMap.this,
|
||||
|
|
|
@ -102,6 +102,7 @@ public class Vector<E>
|
|||
*
|
||||
* @serial
|
||||
*/
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
protected Object[] elementData;
|
||||
|
||||
/**
|
||||
|
|
|
@ -590,6 +590,7 @@ class JarVerifier {
|
|||
URL vlocation;
|
||||
CodeSigner[] vsigners;
|
||||
java.security.cert.Certificate[] vcerts;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
Object csdomain;
|
||||
|
||||
VerifierCodeSource(Object csdomain, URL location, CodeSigner[] signers) {
|
||||
|
|
|
@ -55,6 +55,7 @@ class CryptoPermission extends java.security.Permission {
|
|||
private String alg;
|
||||
private int maxKeySize = Integer.MAX_VALUE; // no restriction on maxKeySize
|
||||
private String exemptionMechanism = null;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private AlgorithmParameterSpec algParamSpec = null;
|
||||
private boolean checkParam = false; // no restriction on param
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ public final class PrivateCredentialPermission extends Permission {
|
|||
* The set contains elements of type,
|
||||
* {@code PrivateCredentialPermission.CredOwner}.
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Set<Principal> principals; // ignored - kept around for compatibility
|
||||
private transient CredOwner[] credOwners;
|
||||
|
||||
|
|
|
@ -111,6 +111,7 @@ public final class Subject implements java.io.Serializable {
|
|||
* {@code java.security.Principal}.
|
||||
* The set is a {@code Subject.SecureSet}.
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
Set<Principal> principals;
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,6 +39,7 @@ public class UnsupportedCallbackException extends Exception {
|
|||
/**
|
||||
* @serial
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Callback callback;
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,6 +49,7 @@ class NegotiateAuthentication extends AuthenticationInfo {
|
|||
private static final long serialVersionUID = 100L;
|
||||
private static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
|
||||
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final HttpCallerInfo hci;
|
||||
|
||||
// These maps are used to manage the GSS availability for diffrent
|
||||
|
@ -67,6 +68,7 @@ class NegotiateAuthentication extends AuthenticationInfo {
|
|||
}
|
||||
|
||||
// The HTTP Negotiate Helper
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Negotiator negotiator = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -875,6 +875,11 @@ class DatagramChannelImpl
|
|||
if (state == ST_CONNECTED)
|
||||
throw new AlreadyConnectedException();
|
||||
|
||||
// ensure that the socket is bound
|
||||
if (localAddress == null) {
|
||||
bindInternal(null);
|
||||
}
|
||||
|
||||
int n = Net.connect(family,
|
||||
fd,
|
||||
isa.getAddress(),
|
||||
|
@ -932,8 +937,21 @@ class DatagramChannelImpl
|
|||
remoteAddress = null;
|
||||
state = ST_UNCONNECTED;
|
||||
|
||||
// refresh local address
|
||||
localAddress = Net.localAddress(fd);
|
||||
// check whether rebind is needed
|
||||
InetSocketAddress isa = Net.localAddress(fd);
|
||||
if (isa.getPort() == 0) {
|
||||
// On Linux, if bound to ephemeral port,
|
||||
// disconnect does not preserve that port.
|
||||
// In this case, try to rebind to the previous port.
|
||||
int port = localAddress.getPort();
|
||||
localAddress = isa; // in case Net.bind fails
|
||||
Net.bind(family, fd, isa.getAddress(), port);
|
||||
isa = Net.localAddress(fd); // refresh address
|
||||
assert isa.getPort() == port;
|
||||
}
|
||||
|
||||
// refresh localAddress
|
||||
localAddress = isa;
|
||||
}
|
||||
} finally {
|
||||
writeLock.unlock();
|
||||
|
|
|
@ -208,7 +208,8 @@ public abstract class SelectorImpl
|
|||
if (!(ch instanceof SelChImpl))
|
||||
throw new IllegalSelectorException();
|
||||
SelectionKeyImpl k = new SelectionKeyImpl((SelChImpl)ch, this);
|
||||
k.attach(attachment);
|
||||
if (attachment != null)
|
||||
k.attach(attachment);
|
||||
|
||||
// register (if needed) before adding to key set
|
||||
implRegister(k);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -28,6 +28,9 @@ package sun.nio.cs;
|
|||
/*
|
||||
* FastPath byte[]->char[] decoder, REPLACE on malformed or
|
||||
* unmappable input.
|
||||
*
|
||||
* FastPath encoded byte[]-> "String Latin1 coding" byte[] decoder for use when
|
||||
* charset is always decodable to the internal String Latin1 coding byte[], ie. all mappings <=0xff
|
||||
*/
|
||||
|
||||
public interface ArrayDecoder {
|
||||
|
@ -36,4 +39,14 @@ public interface ArrayDecoder {
|
|||
default boolean isASCIICompatible() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is always decodable to internal String Latin1 coding, ie. all mappings <= 0xff
|
||||
default boolean isLatin1Decodable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Decode to internal String Latin1 coding byte[] fastpath for when isLatin1Decodable == true
|
||||
default int decodeToLatin1(byte[] src, int sp, int len, byte[] dst) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -50,17 +50,27 @@ public class SingleByte
|
|||
implements ArrayDecoder {
|
||||
private final char[] b2c;
|
||||
private final boolean isASCIICompatible;
|
||||
private final boolean isLatin1Decodable;
|
||||
|
||||
public Decoder(Charset cs, char[] b2c) {
|
||||
super(cs, 1.0f, 1.0f);
|
||||
this.b2c = b2c;
|
||||
this.isASCIICompatible = false;
|
||||
this.isLatin1Decodable = false;
|
||||
}
|
||||
|
||||
public Decoder(Charset cs, char[] b2c, boolean isASCIICompatible) {
|
||||
super(cs, 1.0f, 1.0f);
|
||||
this.b2c = b2c;
|
||||
this.isASCIICompatible = isASCIICompatible;
|
||||
this.isLatin1Decodable = false;
|
||||
}
|
||||
|
||||
public Decoder(Charset cs, char[] b2c, boolean isASCIICompatible, boolean isLatin1Decodable) {
|
||||
super(cs, 1.0f, 1.0f);
|
||||
this.b2c = b2c;
|
||||
this.isASCIICompatible = isASCIICompatible;
|
||||
this.isLatin1Decodable = isLatin1Decodable;
|
||||
}
|
||||
|
||||
private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
|
||||
|
@ -124,6 +134,18 @@ public class SingleByte
|
|||
repl = newReplacement.charAt(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decodeToLatin1(byte[] src, int sp, int len, byte[] dst) {
|
||||
if (len > dst.length)
|
||||
len = dst.length;
|
||||
|
||||
int dp = 0;
|
||||
while (dp < len) {
|
||||
dst[dp++] = (byte)decode(src[sp++]);
|
||||
}
|
||||
return dp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decode(byte[] src, int sp, int len, char[] dst) {
|
||||
if (len > dst.length)
|
||||
|
@ -143,6 +165,11 @@ public class SingleByte
|
|||
public boolean isASCIICompatible() {
|
||||
return isASCIICompatible;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLatin1Decodable() {
|
||||
return isLatin1Decodable;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class Encoder extends CharsetEncoder
|
||||
|
|
|
@ -44,6 +44,7 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
|
|||
@java.io.Serial
|
||||
private static final long serialVersionUID = 6182022883658399397L;
|
||||
private final Class<? extends Annotation> type;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final Map<String, Object> memberValues;
|
||||
|
||||
AnnotationInvocationHandler(Class<? extends Annotation> type, Map<String, Object> memberValues) {
|
||||
|
|
|
@ -36,7 +36,8 @@ import java.lang.reflect.Method;
|
|||
class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy {
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 7844069490309503934L;
|
||||
private Method member;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Method member; // Would be more robust to null-out in a writeObject method.
|
||||
private final String foundType;
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,7 +50,11 @@ public class TlsKeyMaterialSpec implements KeySpec, SecretKey {
|
|||
|
||||
private final SecretKey clientMacKey, serverMacKey;
|
||||
private final SecretKey clientCipherKey, serverCipherKey;
|
||||
private final IvParameterSpec clientIv, serverIv;
|
||||
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final IvParameterSpec clientIv;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final IvParameterSpec serverIv;
|
||||
|
||||
/**
|
||||
* Constructs a new TlsKeymaterialSpec from the client and server MAC
|
||||
|
|
|
@ -1315,7 +1315,9 @@ public class PolicyParser {
|
|||
private static final long serialVersionUID = -4330692689482574072L;
|
||||
|
||||
private String i18nMessage;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private LocalizedMessage localizedMsg;
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Object[] source;
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,6 +54,7 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
|
|||
private static final Class<?>[] PARAMS = { String.class };
|
||||
private static final sun.security.util.Debug debug =
|
||||
sun.security.util.Debug.getInstance("auth", "\t[Auth Access]");
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private ClassLoader sysClassLoader;
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,6 +69,7 @@ public class X509CertPath extends CertPath {
|
|||
/**
|
||||
* List of certificates in this chain
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private List<X509Certificate> certs;
|
||||
|
||||
/**
|
||||
|
|
|
@ -70,6 +70,7 @@ public final class RSAPrivateCrtKeyImpl
|
|||
// Optional parameters associated with this RSA key
|
||||
// specified in the encoding of its AlgorithmId.
|
||||
// Must be null for "RSA" keys.
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private AlgorithmParameterSpec keyParams;
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,6 +61,7 @@ public final class RSAPrivateKeyImpl extends PKCS8Key implements RSAPrivateKey {
|
|||
// optional parameters associated with this RSA key
|
||||
// specified in the encoding of its AlgorithmId.
|
||||
// must be null for "RSA" keys.
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final AlgorithmParameterSpec keyParams;
|
||||
|
||||
/**
|
||||
|
|
|
@ -62,6 +62,7 @@ public final class RSAPublicKeyImpl extends X509Key implements RSAPublicKey {
|
|||
// optional parameters associated with this RSA key
|
||||
// specified in the encoding of its AlgorithmId
|
||||
// must be null for "RSA" keys.
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private AlgorithmParameterSpec keyParams;
|
||||
|
||||
/**
|
||||
|
|
|
@ -98,6 +98,7 @@ class ObjectIdentifier implements Serializable
|
|||
* Changed to Object
|
||||
* @serial
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Object components = null; // path from root
|
||||
/**
|
||||
* @serial
|
||||
|
|
|
@ -62,6 +62,7 @@ public class ValidatorException extends CertificateException {
|
|||
public static final Object T_UNTRUSTED_CERT =
|
||||
"Untrusted certificate";
|
||||
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private Object type;
|
||||
private X509Certificate cert;
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
private ObjectIdentifier algid;
|
||||
|
||||
// The (parsed) parameters
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private AlgorithmParameters algParams;
|
||||
private boolean constructedFromDer = true;
|
||||
|
||||
|
@ -80,6 +81,7 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
* DER-encoded form; subclasses can be made to automaticaly parse
|
||||
* them so there is fast access to these parameters.
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
protected DerValue params;
|
||||
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ import sun.security.provider.X509Factory;
|
|||
* @author Hemma Prafullchandra
|
||||
* @see X509CertInfo
|
||||
*/
|
||||
@SuppressWarnings("serial") // See writeReplace method in Certificate
|
||||
public class X509CertImpl extends X509Certificate implements DerEncoder {
|
||||
|
||||
@java.io.Serial
|
||||
|
|
|
@ -84,7 +84,7 @@ public class X509Key implements PublicKey {
|
|||
private int unusedBits = 0;
|
||||
|
||||
/* BitArray form of key */
|
||||
private BitArray bitStringKey = null;
|
||||
private transient BitArray bitStringKey = null;
|
||||
|
||||
/* The encoding for the key. */
|
||||
protected byte[] encodedKey;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue