8347121: Add missing @serial tags to module java.base

Reviewed-by: alanb
This commit is contained in:
Hannes Wallnöfer 2025-01-09 11:49:18 +00:00
parent 8c87ea2bdf
commit ceae2b977d
89 changed files with 301 additions and 222 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
@ -587,8 +587,10 @@ public abstract class AbstractMap<K,V> implements Map<K,V> {
@java.io.Serial
private static final long serialVersionUID = -8499721149061103585L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final K key;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private V value;
@ -733,8 +735,10 @@ public abstract class AbstractMap<K,V> implements Map<K,V> {
@java.io.Serial
private static final long serialVersionUID = 7138329143949025153L;
/** @serial */
@SuppressWarnings("serial") // Not statically typed as Serializable
private final K key;
/** @serial */
@SuppressWarnings("serial") // Not statically typed as Serializable
private final V value;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
@ -4189,6 +4189,7 @@ public final class Arrays {
{
@java.io.Serial
private static final long serialVersionUID = -2764017481108945198L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final E[] a;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
@ -1054,6 +1054,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 1820017752578914078L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Collection<? extends E> c;
@ -1337,6 +1338,7 @@ public class Collections {
implements SortedSet<E>, Serializable {
@java.io.Serial
private static final long serialVersionUID = -4929149591599911165L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final SortedSet<E> ss;
@ -1419,7 +1421,7 @@ public class Collections {
new EmptyNavigableSet<>();
/**
* The instance we are protecting.
* @serial The instance we are protecting.
*/
@SuppressWarnings("serial") // Conditionally serializable
private final NavigableSet<E> ns;
@ -1488,6 +1490,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -283967356065247728L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final List<? extends E> list;
@ -1641,6 +1644,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -1034234728574286014L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Map<? extends K, ? extends V> m;
@ -2068,6 +2072,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -8806743815996713206L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final SortedMap<K, ? extends V> sm;
@ -2149,7 +2154,7 @@ public class Collections {
new EmptyNavigableMap<>();
/**
* The instance we wrap and protect.
* @serial The instance we wrap and protect.
*/
@SuppressWarnings("serial") // Conditionally serializable
private final NavigableMap<K, ? extends V> nm;
@ -2283,8 +2288,10 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 3053995032091335093L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Collection<E> c; // Backing Collection
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Object mutex; // Object on which to synchronize
@ -2487,6 +2494,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 8695801310862127406L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final SortedSet<E> ss;
@ -2583,6 +2591,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -5505529816273629798L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final NavigableSet<E> ns;
@ -2694,6 +2703,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -7754090372962971524L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final List<E> list;
@ -2862,8 +2872,10 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 1978198479659022715L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final Map<K,V> m; // Backing Map
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Object mutex; // Object on which to synchronize
@ -3061,6 +3073,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -8798146769416483793L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final SortedMap<K,V> sm;
@ -3165,6 +3178,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 699392247599746807L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final NavigableMap<K,V> nm;
@ -3345,8 +3359,10 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 1578914078182001775L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Collection<E> c;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Class<E> type;
@ -3403,6 +3419,7 @@ public class Collections {
public boolean add(E e) { return c.add(typeCheck(e)); }
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private E[] zeroLengthElementArray; // Lazily initialized
@ -3497,6 +3514,7 @@ public class Collections {
{
@java.io.Serial
private static final long serialVersionUID = 1433151992604707767L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Queue<E> queue;
@ -3602,6 +3620,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 1599911165492914959L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final SortedSet<E> ss;
@ -3667,6 +3686,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -5429120189805438922L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final NavigableSet<E> ns;
@ -3751,6 +3771,7 @@ public class Collections {
{
@java.io.Serial
private static final long serialVersionUID = 65247728283967356L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final List<E> list;
@ -3901,10 +3922,13 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 5742860141034234728L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final Map<K, V> m;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Class<K> keyType;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Class<V> valueType;
@ -4301,6 +4325,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 1599671320688067438L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final SortedMap<K, V> sm;
@ -4377,6 +4402,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -4852462692372534096L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final NavigableMap<K, V> nm;
@ -5108,6 +5134,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 3193687207550431679L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final E element;
@ -5163,6 +5190,7 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 3093736618740652951L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final E element;
@ -5233,8 +5261,10 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = -6979724477215052911L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final K k;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final V v;
@ -5373,7 +5403,9 @@ public class Collections {
@java.io.Serial
private static final long serialVersionUID = 2739099268398711800L;
/** @serial */
final int n;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final E element;
@ -5914,6 +5946,7 @@ public class Collections {
private static class SetFromMap<E> extends AbstractSet<E>
implements Set<E>, Serializable
{
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final Map<E, Boolean> m; // The backing map
private transient Set<E> s; // Its keySet
@ -6088,6 +6121,7 @@ public class Collections {
implements Queue<E>, Serializable {
@java.io.Serial
private static final long serialVersionUID = 1802017725587941708L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final Deque<E> q;
AsLIFOQueue(Deque<E> q) { this.q = q; }

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -40,6 +40,7 @@ public non-sealed class DuplicateFormatFlagsException extends IllegalFormatExcep
@java.io.Serial
private static final long serialVersionUID = 18890531L;
/** @serial */
private String flags;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -40,8 +40,10 @@ public non-sealed class FormatFlagsConversionMismatchException
@java.io.Serial
private static final long serialVersionUID = 19120414L;
/** @serial */
private String f;
/** @serial */
private char c;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -41,6 +41,7 @@ public non-sealed class IllegalFormatCodePointException extends IllegalFormatExc
@java.io.Serial
private static final long serialVersionUID = 19080630L;
/** @serial */
private int c;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -40,7 +40,9 @@ public non-sealed class IllegalFormatConversionException extends IllegalFormatEx
@java.io.Serial
private static final long serialVersionUID = 17000126L;
/** @serial */
private char c;
/** @serial */
private Class<?> arg;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -39,6 +39,7 @@ public non-sealed class IllegalFormatFlagsException extends IllegalFormatExcepti
@java.io.Serial
private static final long serialVersionUID = 790824L;
/** @serial */
private String flags;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -39,6 +39,7 @@ public non-sealed class IllegalFormatPrecisionException extends IllegalFormatExc
@java.io.Serial
private static final long serialVersionUID = 18711008L;
/** @serial */
private int p;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -38,6 +38,7 @@ public non-sealed class IllegalFormatWidthException extends IllegalFormatExcepti
@java.io.Serial
private static final long serialVersionUID = 16660902L;
/** @serial */
private int w;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2025, 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
@ -44,6 +44,7 @@ public class IllformedLocaleException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -5245986824925681401L;
/** @serial */
private int _errIdx = -1;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -41,6 +41,7 @@ public non-sealed class MissingFormatArgumentException extends IllegalFormatExce
@java.io.Serial
private static final long serialVersionUID = 19190115L;
/** @serial */
private String s;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -39,6 +39,7 @@ public non-sealed class MissingFormatWidthException extends IllegalFormatExcepti
@java.io.Serial
private static final long serialVersionUID = 15560123L;
/** @serial */
private String s;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -103,12 +103,12 @@ public class PriorityQueue<E> extends AbstractQueue<E>
transient Object[] queue; // non-private to simplify nested class access
/**
* The number of elements in the priority queue.
* @serial The number of elements in the priority queue.
*/
int size;
/**
* The comparator, or null if priority queue uses elements'
* @serial The comparator, or null if priority queue uses elements'
* natural ordering.
*/
@SuppressWarnings("serial") // Conditionally serializable

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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
@ -1656,12 +1656,12 @@ public class TreeMap<K,V>
@java.io.Serial
private static final long serialVersionUID = -2102997345730753016L;
/**
* The backing map.
* @serial The backing map.
*/
final TreeMap<K,V> m;
/**
* Endpoints are represented as triples (fromStart, lo,
* @serial Endpoints are represented as triples (fromStart, lo,
* loInclusive) and (toEnd, hi, hiInclusive). If fromStart is
* true, then the low (absolute) bound is the start of the
* backing map, and the other values are ignored. Otherwise,
@ -1670,9 +1670,12 @@ public class TreeMap<K,V>
*/
@SuppressWarnings("serial") // Conditionally serializable
final K lo;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
final K hi;
/** @serial */
final boolean fromStart, toEnd;
/** @serial */
final boolean loInclusive, hiInclusive;
NavigableSubMap(TreeMap<K,V> m,
@ -2288,6 +2291,7 @@ public class TreeMap<K,V>
super(m, fromStart, lo, loInclusive, toEnd, hi, hiInclusive);
}
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final Comparator<? super K> reverseComparator =
Collections.reverseOrder(m.comparator);
@ -2376,9 +2380,12 @@ public class TreeMap<K,V>
implements SortedMap<K,V>, java.io.Serializable {
@java.io.Serial
private static final long serialVersionUID = -6520786458950516097L;
/** @serial */
private boolean fromStart = false, toEnd = false;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private K fromKey;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private K toKey;
@java.io.Serial

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -83,17 +83,13 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
@java.io.Serial
private static final long serialVersionUID = -4856846361193249489L;
/*
* The most significant 64 bits of this UUID.
*
* @serial
/**
* @serial The most significant 64 bits of this UUID.
*/
private final long mostSigBits;
/*
* The least significant 64 bits of this UUID.
*
* @serial
/**
* @serial The least significant 64 bits of this UUID.
*/
private final long leastSigBits;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -39,6 +39,7 @@ public non-sealed class UnknownFormatConversionException extends IllegalFormatEx
@java.io.Serial
private static final long serialVersionUID = 19060418L;
/** @serial */
private String s;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -39,6 +39,7 @@ public non-sealed class UnknownFormatFlagsException extends IllegalFormatExcepti
@java.io.Serial
private static final long serialVersionUID = 19370506L;
/** @serial */
private String flags;
/**

View file

@ -100,17 +100,17 @@ public class ArrayBlockingQueue<E> extends AbstractQueue<E>
*/
private static final long serialVersionUID = -817911632652898426L;
/** The queued items */
/** @serial The queued items */
@SuppressWarnings("serial") // Conditionally serializable
final Object[] items;
/** items index for next take, poll, peek or remove */
/** @serial items index for next take, poll, peek or remove */
int takeIndex;
/** items index for next put, offer, or add */
/** @serial items index for next put, offer, or add */
int putIndex;
/** Number of elements in the queue */
/** @serial Number of elements in the queue */
int count;
/*
@ -118,14 +118,14 @@ public class ArrayBlockingQueue<E> extends AbstractQueue<E>
* found in any textbook.
*/
/** Main lock guarding all access */
/** @serial Main lock guarding all access */
final ReentrantLock lock;
/** Condition for waiting takes */
/** @serial Condition for waiting takes */
@SuppressWarnings("serial") // Classes implementing Condition may be serializable.
private final Condition notEmpty;
/** Condition for waiting puts */
/** @serial Condition for waiting puts */
@SuppressWarnings("serial") // Classes implementing Condition may be serializable.
private final Condition notFull;

View file

@ -4611,6 +4611,7 @@ public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
public static final class KeySetView<K,V> extends CollectionView<K,V,K>
implements Set<K>, java.io.Serializable {
private static final long serialVersionUID = 7249069246763182397L;
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final V value;
KeySetView(ConcurrentHashMap<K,V> map, V value) { // non-public

View file

@ -2401,19 +2401,19 @@ public class ConcurrentSkipListMap<K,V> extends AbstractMap<K,V>
implements ConcurrentNavigableMap<K,V>, Serializable {
private static final long serialVersionUID = -7647078645895051609L;
/** Underlying map */
/** @serial Underlying map */
final ConcurrentSkipListMap<K,V> m;
/** lower bound key, or null if from start */
/** @serial lower bound key, or null if from start */
@SuppressWarnings("serial") // Conditionally serializable
private final K lo;
/** upper bound key, or null if to end */
/** @serial upper bound key, or null if to end */
@SuppressWarnings("serial") // Conditionally serializable
private final K hi;
/** inclusion flag for lo */
/** @serial inclusion flag for lo */
private final boolean loInclusive;
/** inclusion flag for hi */
/** @serial inclusion flag for hi */
private final boolean hiInclusive;
/** direction */
/** @serial direction */
final boolean isDescending;
// Lazily initialized view holders

View file

@ -99,7 +99,7 @@ public class ConcurrentSkipListSet<E>
private static final long serialVersionUID = -2479143111061671589L;
/**
* The underlying map. Uses Boolean.TRUE as value for each
* @serial The underlying map. Uses Boolean.TRUE as value for each
* element. This field is declared final for the sake of thread
* safety, which entails some ugliness in clone().
*/

View file

@ -99,6 +99,7 @@ public class CopyOnWriteArraySet<E> extends AbstractSet<E>
implements java.io.Serializable {
private static final long serialVersionUID = 5457747651344034263L;
/** @serial */
private final CopyOnWriteArrayList<E> al;
/**

View file

@ -427,9 +427,9 @@ import jdk.internal.misc.Unsafe;
public abstract class CountedCompleter<T> extends ForkJoinTask<T> {
private static final long serialVersionUID = 5232453752276485070L;
/** This task's completer, or null if none */
/** @serial This task's completer, or null if none */
final CountedCompleter<?> completer;
/** The number of pending tasks until completion */
/** @serial The number of pending tasks until completion */
volatile int pending;
/**

View file

@ -278,6 +278,7 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
static final int UNCOMPENSATE = 1 << 16; // helpJoin sentinel
// Fields
/** @serial */
volatile int status; // accessed directly by pool and workers
private transient volatile Aux aux; // either waiters or thrown Exception

View file

@ -152,17 +152,17 @@ public class LinkedBlockingDeque<E>
/** Number of items in the deque */
private transient int count;
/** Maximum number of items in the deque */
/** @serial Maximum number of items in the deque */
private final int capacity;
/** Main lock guarding all access */
/** @serial Main lock guarding all access */
final ReentrantLock lock = new ReentrantLock();
/** Condition for waiting takes */
/** @serial Condition for waiting takes */
@SuppressWarnings("serial") // Classes implementing Condition may be serializable.
private final Condition notEmpty = lock.newCondition();
/** Condition for waiting puts */
/** @serial Condition for waiting puts */
@SuppressWarnings("serial") // Classes implementing Condition may be serializable.
private final Condition notFull = lock.newCondition();

View file

@ -134,10 +134,10 @@ public class LinkedBlockingQueue<E> extends AbstractQueue<E>
Node(E x) { item = x; }
}
/** The capacity bound, or Integer.MAX_VALUE if none */
/** @serial The capacity bound, or Integer.MAX_VALUE if none */
private final int capacity;
/** Current number of elements */
/** @serial Current number of elements */
private final AtomicInteger count = new AtomicInteger();
/**
@ -152,17 +152,17 @@ public class LinkedBlockingQueue<E> extends AbstractQueue<E>
*/
private transient Node<E> last;
/** Lock held by take, poll, etc */
/** @serial Lock held by take, poll, etc */
private final ReentrantLock takeLock = new ReentrantLock();
/** Wait queue for waiting takes */
/** @serial Wait queue for waiting takes */
@SuppressWarnings("serial") // Classes implementing Condition may be serializable.
private final Condition notEmpty = takeLock.newCondition();
/** Lock held by put, offer, etc */
/** @serial Lock held by put, offer, etc */
private final ReentrantLock putLock = new ReentrantLock();
/** Wait queue for waiting puts */
/** @serial Wait queue for waiting puts */
@SuppressWarnings("serial") // Classes implementing Condition may be serializable.
private final Condition notFull = putLock.newCondition();

View file

@ -160,12 +160,12 @@ public class PriorityBlockingQueue<E> extends AbstractQueue<E>
private transient Comparator<? super E> comparator;
/**
* Lock used for all public operations.
* @serial Lock used for all public operations.
*/
private final ReentrantLock lock = new ReentrantLock();
/**
* Condition for blocking when empty.
* @serial Condition for blocking when empty.
*/
@SuppressWarnings("serial") // Classes implementing Condition may be serializable.
private final Condition notEmpty = lock.newCondition();
@ -176,7 +176,7 @@ public class PriorityBlockingQueue<E> extends AbstractQueue<E>
private transient volatile int allocationSpinLock;
/**
* A plain PriorityQueue used only for serialization,
* @serial A plain PriorityQueue used only for serialization,
* to maintain compatibility with previous versions
* of this class. Non-null only during serialization/deserialization.
*/

View file

@ -84,7 +84,7 @@ public abstract class RecursiveTask<V> extends ForkJoinTask<V> {
public RecursiveTask() {}
/**
* The result of the computation.
* @serial The result of the computation.
*/
@SuppressWarnings("serial") // Conditionally serializable
V result;

View file

@ -161,7 +161,7 @@ import java.util.concurrent.locks.AbstractQueuedSynchronizer;
*/
public class Semaphore implements java.io.Serializable {
private static final long serialVersionUID = -3222578661600680210L;
/** All mechanics via AbstractQueuedSynchronizer subclass */
/** @serial All mechanics via AbstractQueuedSynchronizer subclass */
private final Sync sync;
/**

View file

@ -555,8 +555,11 @@ public class SynchronousQueue<E> extends AbstractQueue<E>
static class FifoWaitQueue extends WaitQueue {
private static final long serialVersionUID = -3623113410248163686L;
}
/** @serial */
private ReentrantLock qlock;
/** @serial */
private WaitQueue waitingProducers;
/** @serial */
private WaitQueue waitingConsumers;
/**

View file

@ -55,6 +55,7 @@ public class AtomicBoolean implements java.io.Serializable {
private static final VarHandle VALUE = MhUtil.findVarHandle(
MethodHandles.lookup(), "value", int.class);
/** @serial */
private volatile int value;
/**

View file

@ -63,6 +63,7 @@ public class AtomicInteger extends Number implements java.io.Serializable {
private static final long VALUE
= U.objectFieldOffset(AtomicInteger.class, "value");
/** @serial */
private volatile int value;
/**

View file

@ -51,6 +51,7 @@ public class AtomicIntegerArray implements java.io.Serializable {
private static final long serialVersionUID = 2862133569453604235L;
private static final VarHandle AA
= MethodHandles.arrayElementVarHandle(int[].class);
/** @serial */
private final int[] array;
/**

View file

@ -63,6 +63,7 @@ public class AtomicLong extends Number implements java.io.Serializable {
private static final long VALUE
= U.objectFieldOffset(AtomicLong.class, "value");
/** @serial */
private volatile long value;
/**

View file

@ -51,6 +51,7 @@ public class AtomicLongArray implements java.io.Serializable {
private static final long serialVersionUID = -2308431214976778248L;
private static final VarHandle AA
= MethodHandles.arrayElementVarHandle(long[].class);
/** @serial */
private final long[] array;
/**

View file

@ -55,6 +55,7 @@ public class AtomicReference<V> implements java.io.Serializable {
private static final VarHandle VALUE = MhUtil.findVarHandle(
MethodHandles.lookup(), "value", Object.class);
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private volatile V value;

View file

@ -55,6 +55,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
private static final long serialVersionUID = -6209656149925076980L;
private static final VarHandle AA
= MethodHandles.arrayElementVarHandle(Object[].class);
/** @serial */
@SuppressWarnings("serial") // Conditionally serializable
private final Object[] array; // must have exact type Object[]

View file

@ -84,8 +84,10 @@ import java.util.function.DoubleBinaryOperator;
public class DoubleAccumulator extends Striped64 implements Serializable {
private static final long serialVersionUID = 7249069246863182397L;
/** @serial */
@SuppressWarnings("serial") // Not statically typed as Serializable
private final DoubleBinaryOperator function;
/** @serial */
private final long identity; // use long representation
/**

View file

@ -82,8 +82,10 @@ import java.util.function.LongBinaryOperator;
public class LongAccumulator extends Striped64 implements Serializable {
private static final long serialVersionUID = 7249069246863182397L;
/** @serial */
@SuppressWarnings("serial") // Not statically typed as Serializable
private final LongBinaryOperator function;
/** @serial */
private final long identity;
/**

View file

@ -152,7 +152,7 @@ public abstract class AbstractQueuedLongSynchronizer
private transient volatile Node tail;
/**
* The synchronization state.
* @serial The synchronization state.
*/
private volatile long state;

View file

@ -532,7 +532,7 @@ public abstract class AbstractQueuedSynchronizer
private transient volatile Node tail;
/**
* The synchronization state.
* @serial The synchronization state.
*/
private volatile int state;

View file

@ -108,7 +108,7 @@ import jdk.internal.vm.annotation.ReservedStackAccess;
*/
public class ReentrantLock implements Lock, java.io.Serializable {
private static final long serialVersionUID = 7373984872572414699L;
/** Synchronizer providing all implementation mechanics */
/** @serial Synchronizer providing all implementation mechanics */
private final Sync sync;
/**

View file

@ -217,11 +217,11 @@ import jdk.internal.vm.annotation.ReservedStackAccess;
public class ReentrantReadWriteLock
implements ReadWriteLock, java.io.Serializable {
private static final long serialVersionUID = -6992448646407690164L;
/** Inner class providing readlock */
/** @serial Inner class providing readlock */
private final ReentrantReadWriteLock.ReadLock readerLock;
/** Inner class providing writelock */
/** @serial Inner class providing writelock */
private final ReentrantReadWriteLock.WriteLock writerLock;
/** Performs all synchronization mechanics */
/** @serial Performs all synchronization mechanics */
final Sync sync;
/**
@ -713,6 +713,7 @@ public class ReentrantReadWriteLock
*/
public static class ReadLock implements Lock, java.io.Serializable {
private static final long serialVersionUID = -5992448646407690164L;
/** @serial */
private final Sync sync;
/**
@ -927,6 +928,7 @@ public class ReentrantReadWriteLock
*/
public static class WriteLock implements Lock, java.io.Serializable {
private static final long serialVersionUID = -4992448646407690164L;
/** @serial */
private final Sync sync;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2025, 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
@ -38,8 +38,11 @@ public class PatternSyntaxException
@java.io.Serial
private static final long serialVersionUID = -3864639126226059218L;
/** @serial */
private final String desc;
/** @serial */
private final String pattern;
/** @serial */
private final int index;
/**