diff --git a/make/langtools/tools/javacserver/server/CompilerThreadPool.java b/make/langtools/tools/javacserver/server/CompilerThreadPool.java index 1f9e3a195b60f..460adcfba2816 100644 --- a/make/langtools/tools/javacserver/server/CompilerThreadPool.java +++ b/make/langtools/tools/javacserver/server/CompilerThreadPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -61,7 +61,7 @@ public void shutdown() { } catch (InterruptedException ie) { // (Re-)Cancel if current thread also interrupted pool.shutdownNow(); - // Preserve interrupt status + // Preserve interrupted status Thread.currentThread().interrupt(); } } diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java index 11dcab1b005e1..185882cc7cce3 100644 --- a/src/java.base/share/classes/java/lang/Object.java +++ b/src/java.base/share/classes/java/lang/Object.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 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 @@ -383,7 +383,7 @@ public final void wait(long timeoutMillis) throws InterruptedException { try { wait0(timeoutMillis); } catch (InterruptedException e) { - // virtual thread's interrupt status needs to be cleared + // virtual thread's interrupted status needs to be cleared vthread.getAndClearInterrupt(); throw e; } diff --git a/src/java.base/share/classes/java/lang/Process.java b/src/java.base/share/classes/java/lang/Process.java index 0a55343926f43..577ee53832609 100644 --- a/src/java.base/share/classes/java/lang/Process.java +++ b/src/java.base/share/classes/java/lang/Process.java @@ -774,7 +774,7 @@ public long pid() { * @implSpec * This implementation executes {@link #waitFor()} in a separate thread * repeatedly until it returns successfully. If the execution of - * {@code waitFor} is interrupted, the thread's interrupt status is preserved. + * {@code waitFor} is interrupted, the thread's interrupted status is preserved. *

* When {@link #waitFor()} returns successfully the CompletableFuture is * {@linkplain java.util.concurrent.CompletableFuture#complete completed} regardless diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index 40f2dacadd21a..ace29f30a560f 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -228,7 +228,7 @@ public class Thread implements Runnable { // thread name private volatile String name; - // interrupt status (read/written by VM) + // interrupted status (read/written by VM) volatile boolean interrupted; // context ClassLoader @@ -355,7 +355,7 @@ void inheritScopedValueBindings(ThreadContainer container) { /* The object in which this thread is blocked in an interruptible I/O * operation, if any. The blocker's interrupt method should be invoked - * after setting this thread's interrupt status. + * after setting this thread's interrupted status. */ private Interruptible nioBlocker; @@ -1535,22 +1535,22 @@ private void exit() { * Object#wait(long, int) wait(long, int)} methods of the {@link Object} * class, or of the {@link #join()}, {@link #join(long)}, {@link * #join(long, int)}, {@link #sleep(long)}, or {@link #sleep(long, int)} - * methods of this class, then its interrupt status will be cleared and it + * methods of this class, then its interrupted status will be cleared and it * will receive an {@link InterruptedException}. * *

If this thread is blocked in an I/O operation upon an {@link * java.nio.channels.InterruptibleChannel InterruptibleChannel} - * then the channel will be closed, the thread's interrupt + * then the channel will be closed, the thread's interrupted * status will be set, and the thread will receive a {@link * java.nio.channels.ClosedByInterruptException}. * *

If this thread is blocked in a {@link java.nio.channels.Selector} - * then the thread's interrupt status will be set and it will return + * then the thread's interrupted status will be set and it will return * immediately from the selection operation, possibly with a non-zero * value, just as if the selector's {@link * java.nio.channels.Selector#wakeup wakeup} method were invoked. * - *

If none of the previous conditions hold then this thread's interrupt + *

If none of the previous conditions hold then this thread's interrupted * status will be set.

* *

Interrupting a thread that is not alive need not have any effect. @@ -1560,7 +1560,7 @@ private void exit() { * will report it via {@link #interrupted()} and {@link #isInterrupted()}. */ public void interrupt() { - // Setting the interrupt status must be done before reading nioBlocker. + // Setting the interrupted status must be done before reading nioBlocker. interrupted = true; interrupt0(); // inform VM of interrupt diff --git a/src/java.base/share/classes/java/lang/VirtualThread.java b/src/java.base/share/classes/java/lang/VirtualThread.java index 19465eb32db79..a23cbb72a6c8a 100644 --- a/src/java.base/share/classes/java/lang/VirtualThread.java +++ b/src/java.base/share/classes/java/lang/VirtualThread.java @@ -483,12 +483,12 @@ private void mount() { Thread carrier = Thread.currentCarrierThread(); setCarrierThread(carrier); - // sync up carrier thread interrupt status if needed + // sync up carrier thread interrupted status if needed if (interrupted) { carrier.setInterrupt(); } else if (carrier.isInterrupted()) { synchronized (interruptLock) { - // need to recheck interrupt status + // need to recheck interrupted status if (!interrupted) { carrier.clearInterrupt(); } @@ -721,7 +721,7 @@ public void run() { /** * Parks until unparked or interrupted. If already unparked then the parking * permit is consumed and this method completes immediately (meaning it doesn't - * yield). It also completes immediately if the interrupt status is set. + * yield). It also completes immediately if the interrupted status is set. */ @Override void park() { @@ -756,7 +756,7 @@ void park() { * Parks up to the given waiting time or until unparked or interrupted. * If already unparked then the parking permit is consumed and this method * completes immediately (meaning it doesn't yield). It also completes immediately - * if the interrupt status is set or the waiting time is {@code <= 0}. + * if the interrupted status is set or the waiting time is {@code <= 0}. * * @param nanos the maximum number of nanoseconds to wait. */ @@ -799,7 +799,7 @@ void parkNanos(long nanos) { /** * Parks the current carrier thread up to the given waiting time or until * unparked or interrupted. If the virtual thread is interrupted then the - * interrupt status will be propagated to the carrier thread. + * interrupted status will be propagated to the carrier thread. * @param timed true for a timed park, false for untimed * @param nanos the waiting time in nanoseconds */ diff --git a/src/java.base/share/classes/java/net/DatagramSocket.java b/src/java.base/share/classes/java/net/DatagramSocket.java index 87b52699993a6..20b4d8a96f127 100644 --- a/src/java.base/share/classes/java/net/DatagramSocket.java +++ b/src/java.base/share/classes/java/net/DatagramSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -611,13 +611,13 @@ public void send(DatagramPacket p) throws IOException { * with a {@link DatagramChannel DatagramChannel}. In that case, * interrupting a thread receiving a datagram packet will close the * underlying channel and cause this method to throw {@link - * java.nio.channels.ClosedByInterruptException} with the interrupt - * status set. + * java.nio.channels.ClosedByInterruptException} with the thread's + * interrupted status set. *

  • The datagram socket uses the system-default socket implementation and * a {@linkplain Thread#isVirtual() virtual thread} is receiving a * datagram packet. In that case, interrupting the virtual thread will * cause it to wakeup and close the socket. This method will then throw - * {@code SocketException} with the interrupt status set. + * {@code SocketException} with the thread's interrupted status set. * * * @param p the {@code DatagramPacket} into which to place diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java index 945693ef65ed6..af7cedfd966a2 100644 --- a/src/java.base/share/classes/java/net/ServerSocket.java +++ b/src/java.base/share/classes/java/net/ServerSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -406,13 +406,13 @@ public SocketAddress getLocalSocketAddress() { * with a {@link ServerSocketChannel ServerSocketChannel}. In that * case, interrupting a thread accepting a connection will close the * underlying channel and cause this method to throw {@link - * java.nio.channels.ClosedByInterruptException} with the interrupt - * status set. + * java.nio.channels.ClosedByInterruptException} with the thread's + * interrupted status set. *
  • The socket uses the system-default socket implementation and a * {@linkplain Thread#isVirtual() virtual thread} is accepting a * connection. In that case, interrupting the virtual thread will * cause it to wakeup and close the socket. This method will then throw - * {@code SocketException} with the interrupt status set. + * {@code SocketException} with the thread's interrupted status set. * * * @implNote diff --git a/src/java.base/share/classes/java/net/Socket.java b/src/java.base/share/classes/java/net/Socket.java index 692c3395f781b..a2aee2e45a19d 100644 --- a/src/java.base/share/classes/java/net/Socket.java +++ b/src/java.base/share/classes/java/net/Socket.java @@ -573,12 +573,13 @@ void setConnected() { * a {@link SocketChannel SocketChannel}. * In that case, interrupting a thread establishing a connection will * close the underlying channel and cause this method to throw - * {@link ClosedByInterruptException} with the interrupt status set. + * {@link ClosedByInterruptException} with the thread's interrupted + * status set. *
  • The socket uses the system-default socket implementation and a * {@linkplain Thread#isVirtual() virtual thread} is establishing a * connection. In that case, interrupting the virtual thread will * cause it to wakeup and close the socket. This method will then throw - * {@code SocketException} with the interrupt status set. + * {@code SocketException} with the thread's interrupted status set. * * * @param endpoint the {@code SocketAddress} @@ -613,12 +614,13 @@ public void connect(SocketAddress endpoint) throws IOException { * a {@link SocketChannel SocketChannel}. * In that case, interrupting a thread establishing a connection will * close the underlying channel and cause this method to throw - * {@link ClosedByInterruptException} with the interrupt status set. + * {@link ClosedByInterruptException} with the thread's interrupted + * status set. *
  • The socket uses the system-default socket implementation and a * {@linkplain Thread#isVirtual() virtual thread} is establishing a * connection. In that case, interrupting the virtual thread will * cause it to wakeup and close the socket. This method will then throw - * {@code SocketException} with the interrupt status set. + * {@code SocketException} with the thread's interrupted status set. * * * @apiNote Establishing a TCP/IP connection is subject to connect timeout settings @@ -886,13 +888,14 @@ public SocketChannel getChannel() { * a {@link SocketChannel SocketChannel}. * In that case, interrupting a thread reading from the input stream * will close the underlying channel and cause the read method to - * throw {@link ClosedByInterruptException} with the interrupt - * status set. + * throw {@link ClosedByInterruptException} with the thread's + * interrupted status set. *
  • The socket uses the system-default socket implementation and a * {@linkplain Thread#isVirtual() virtual thread} is reading from the * input stream. In that case, interrupting the virtual thread will * cause it to wakeup and close the socket. The read method will then - * throw {@code SocketException} with the interrupt status set. + * throw {@code SocketException} with the thread's interrupted + * status set. * * *

    Under abnormal conditions the underlying connection may be @@ -1026,13 +1029,14 @@ public void close() throws IOException { * a {@link SocketChannel SocketChannel}. * In that case, interrupting a thread writing to the output stream * will close the underlying channel and cause the write method to - * throw {@link ClosedByInterruptException} with the interrupt status - * set. + * throw {@link ClosedByInterruptException} with the thread's + * interrupted status set. *

  • The socket uses the system-default socket implementation and a * {@linkplain Thread#isVirtual() virtual thread} is writing to the * output stream. In that case, interrupting the virtual thread will * cause it to wakeup and close the socket. The write method will then - * throw {@code SocketException} with the interrupt status set. + * throw {@code SocketException} with the thread's interrupted + * status set. * * *

    Closing the returned {@link java.io.OutputStream OutputStream} diff --git a/src/java.base/share/classes/java/nio/channels/ClosedByInterruptException.java b/src/java.base/share/classes/java/nio/channels/ClosedByInterruptException.java index c612458c9e419..a2f62aaed3260 100644 --- a/src/java.base/share/classes/java/nio/channels/ClosedByInterruptException.java +++ b/src/java.base/share/classes/java/nio/channels/ClosedByInterruptException.java @@ -28,7 +28,7 @@ /** * Checked exception received by a thread when another thread interrupts it * while it is blocked in an I/O operation upon a channel. Before this - * exception is thrown the channel will have been closed and the interrupt + * exception is thrown the channel will have been closed and the interrupted * status of the previously-blocked thread will have been set. * * @since 1.4 diff --git a/src/java.base/share/classes/java/nio/channels/DatagramChannel.java b/src/java.base/share/classes/java/nio/channels/DatagramChannel.java index 392d9add37fe2..5e72efcdea6c2 100644 --- a/src/java.base/share/classes/java/nio/channels/DatagramChannel.java +++ b/src/java.base/share/classes/java/nio/channels/DatagramChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -290,7 +290,7 @@ public abstract DatagramChannel setOption(SocketOption name, T value) * If another thread interrupts the current thread * while the connect operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws UnresolvedAddressException * If the given remote address is not fully resolved @@ -389,7 +389,7 @@ public abstract DatagramChannel connect(SocketAddress remote) * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs @@ -443,7 +443,7 @@ public abstract DatagramChannel connect(SocketAddress remote) * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws UnresolvedAddressException * If the given remote address is not fully resolved diff --git a/src/java.base/share/classes/java/nio/channels/FileChannel.java b/src/java.base/share/classes/java/nio/channels/FileChannel.java index 6e78eefcca623..e31d01b34c0ce 100644 --- a/src/java.base/share/classes/java/nio/channels/FileChannel.java +++ b/src/java.base/share/classes/java/nio/channels/FileChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -662,7 +662,7 @@ public final long write(ByteBuffer[] srcs) throws IOException { * @throws ClosedByInterruptException * If another thread interrupts the current thread while the * transfer is in progress, thereby closing both channels and - * setting the current thread's interrupt status + * setting the current thread's interrupted status * * @throws IOException * If some other I/O error occurs @@ -732,7 +732,7 @@ public abstract long transferTo(long position, long count, * @throws ClosedByInterruptException * If another thread interrupts the current thread while the * transfer is in progress, thereby closing both channels and - * setting the current thread's interrupt status + * setting the current thread's interrupted status * * @throws IOException * If some other I/O error occurs @@ -780,7 +780,7 @@ public abstract long transferFrom(ReadableByteChannel src, * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs @@ -829,7 +829,7 @@ public abstract long transferFrom(ReadableByteChannel src, * If another thread interrupts the current thread * while the write operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs @@ -1093,10 +1093,10 @@ public MemorySegment map(MapMode mode, long offset, long size, Arena arena) * this method then an {@link AsynchronousCloseException} will be thrown. * *

    If the invoking thread is interrupted while waiting to acquire the - * lock then its interrupt status will be set and a {@link + * lock then its interrupted status will be set and a {@link * FileLockInterruptionException} will be thrown. If the invoker's - * interrupt status is set when this method is invoked then that exception - * will be thrown immediately; the thread's interrupt status will not be + * interrupted status is set when this method is invoked then that exception + * will be thrown immediately; the thread's interrupted status will not be * changed. * *

    The region specified by the {@code position} and {@code size} diff --git a/src/java.base/share/classes/java/nio/channels/FileLockInterruptionException.java b/src/java.base/share/classes/java/nio/channels/FileLockInterruptionException.java index 7ecae1b4a4601..ae1f12f15fce5 100644 --- a/src/java.base/share/classes/java/nio/channels/FileLockInterruptionException.java +++ b/src/java.base/share/classes/java/nio/channels/FileLockInterruptionException.java @@ -28,7 +28,7 @@ /** * Checked exception received by a thread when another thread interrupts it * while it is waiting to acquire a file lock. Before this exception is thrown - * the interrupt status of the previously-blocked thread will have been set. + * the interrupted status of the previously-blocked thread will have been set. * * @since 1.4 */ diff --git a/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java b/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java index e2e97562dee79..0b03b9c81961c 100644 --- a/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java +++ b/src/java.base/share/classes/java/nio/channels/GatheringByteChannel.java @@ -123,7 +123,7 @@ public interface GatheringByteChannel * If another thread interrupts the current thread * while the write operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs @@ -161,7 +161,7 @@ public long write(ByteBuffer[] srcs, int offset, int length) * If another thread interrupts the current thread * while the write operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs diff --git a/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java b/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java index d13a37aeae466..c1c3628f7a475 100644 --- a/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java +++ b/src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -45,11 +45,11 @@ * another thread may invoke the blocked thread's {@link Thread#interrupt() * interrupt} method. This will cause the channel to be closed, the blocked * thread to receive a {@link ClosedByInterruptException}, and the blocked - * thread's interrupt status to be set. + * thread's interrupted status to be set. * - *

    If a thread's interrupt status is already set and it invokes a blocking + *

    If a thread's interrupted status is already set and it invokes a blocking * I/O operation upon a channel then the channel will be closed and the thread - * will immediately receive a {@link ClosedByInterruptException}; its interrupt + * will immediately receive a {@link ClosedByInterruptException}; its interrupted * status will remain set. * *

    A channel supports asynchronous closing and interruption if, and only diff --git a/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java b/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java index 7d54445839065..37b3a5442bc47 100644 --- a/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java +++ b/src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -101,7 +101,7 @@ public interface ReadableByteChannel extends Channel { * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs diff --git a/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java b/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java index 27fce3c1e091f..66ff5047d7071 100644 --- a/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java +++ b/src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -119,7 +119,7 @@ public interface ScatteringByteChannel * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs @@ -160,7 +160,7 @@ public long read(ByteBuffer[] dsts, int offset, int length) * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs diff --git a/src/java.base/share/classes/java/nio/channels/Selector.java b/src/java.base/share/classes/java/nio/channels/Selector.java index d8c0dc261bd6a..b90b8929a517d 100644 --- a/src/java.base/share/classes/java/nio/channels/Selector.java +++ b/src/java.base/share/classes/java/nio/channels/Selector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -236,7 +236,7 @@ * *

  • By invoking the blocked thread's {@link * java.lang.Thread#interrupt() interrupt} method, in which case its - * interrupt status will be set and the selector's {@link #wakeup wakeup} + * interrupted status will be set and the selector's {@link #wakeup wakeup} * method will be invoked.

  • * * diff --git a/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java b/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java index b2ee728cf7fd1..6cf2520fd7868 100644 --- a/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java +++ b/src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -328,7 +328,7 @@ public abstract ServerSocketChannel setOption(SocketOption name, T value) * If another thread interrupts the current thread * while the accept operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws NotYetBoundException * If this channel's socket has not yet been bound diff --git a/src/java.base/share/classes/java/nio/channels/SocketChannel.java b/src/java.base/share/classes/java/nio/channels/SocketChannel.java index 26878ab4006ed..493f9e88ebfd6 100644 --- a/src/java.base/share/classes/java/nio/channels/SocketChannel.java +++ b/src/java.base/share/classes/java/nio/channels/SocketChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -250,7 +250,7 @@ public static SocketChannel open(ProtocolFamily family) throws IOException { * If another thread interrupts the current thread * while the connect operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws UnresolvedAddressException * If the given remote address is an InetSocketAddress that is not fully @@ -485,7 +485,7 @@ public abstract SocketChannel setOption(SocketOption name, T value) * If another thread interrupts the current thread * while the connect operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws UnresolvedAddressException * If the given remote address is an InetSocketAddress that is not fully resolved @@ -542,7 +542,7 @@ public abstract SocketChannel setOption(SocketOption name, T value) * If another thread interrupts the current thread * while the connect operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs diff --git a/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java b/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java index 5284c72b37b00..063cd5eb938e6 100644 --- a/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java +++ b/src/java.base/share/classes/java/nio/channels/WritableByteChannel.java @@ -98,7 +98,7 @@ public interface WritableByteChannel * If another thread interrupts the current thread * while the write operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs diff --git a/src/java.base/share/classes/java/util/concurrent/ExecutorService.java b/src/java.base/share/classes/java/util/concurrent/ExecutorService.java index f899b56b28883..7b5ca34ac0d55 100644 --- a/src/java.base/share/classes/java/util/concurrent/ExecutorService.java +++ b/src/java.base/share/classes/java/util/concurrent/ExecutorService.java @@ -133,7 +133,7 @@ * } catch (InterruptedException ex) { * // (Re-)Cancel if current thread also interrupted * pool.shutdownNow(); - * // Preserve interrupt status + * // Preserve interrupted status * Thread.currentThread().interrupt(); * } * }} @@ -375,7 +375,7 @@ T invokeAny(Collection> tasks, *

    If interrupted while waiting, this method stops all executing tasks as * if by invoking {@link #shutdownNow()}. It then continues to wait until all * actively executing tasks have completed. Tasks that were awaiting - * execution are not executed. The interrupt status will be re-asserted + * execution are not executed. The interrupted status will be re-asserted * before this method returns. * *

    If already terminated, invoking this method has no effect. diff --git a/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java b/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java index 482fe3cf80136..1f2c8d2ffa69d 100644 --- a/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java +++ b/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java @@ -875,7 +875,7 @@ public class ForkJoinPool extends AbstractExecutorService * ==================== * * Regular ForkJoinTasks manage task cancellation (method cancel) - * independently from the interrupt status of threads running + * independently from the interrupted status of threads running * tasks. Interrupts are issued internally only while * terminating, to wake up workers and cancel queued tasks. By * default, interrupts are cleared only when necessary to ensure @@ -900,7 +900,7 @@ public class ForkJoinPool extends AbstractExecutorService * with results accessed via join() differ from those via get(), * which differ from those invoked using pool submit methods by * non-workers (which comply with Future.get() specs). Internal - * usages of ForkJoinTasks ignore interrupt status when executing + * usages of ForkJoinTasks ignore interrupted status when executing * or awaiting completion. Otherwise, reporting task results or * exceptions is preferred to throwing InterruptedExceptions, * which are in turn preferred to timeouts. Similarly, completion @@ -4171,7 +4171,7 @@ public boolean awaitQuiescence(long timeout, TimeUnit unit) { * method stops all executing tasks as if by invoking {@link * #shutdownNow()}. It then continues to wait until all actively * executing tasks have completed. Tasks that were awaiting - * execution are not executed. The interrupt status will be + * execution are not executed. The interrupted status will be * re-asserted before this method returns. * * @since 19 diff --git a/src/java.base/share/classes/java/util/concurrent/FutureTask.java b/src/java.base/share/classes/java/util/concurrent/FutureTask.java index 2ec976291054e..a571cb77cced1 100644 --- a/src/java.base/share/classes/java/util/concurrent/FutureTask.java +++ b/src/java.base/share/classes/java/util/concurrent/FutureTask.java @@ -69,7 +69,7 @@ public class FutureTask implements RunnableFuture { /* * Revision notes: This differs from previous versions of this * class that relied on AbstractQueuedSynchronizer, mainly to - * avoid surprising users about retaining interrupt status during + * avoid surprising users about retaining interrupted status during * cancellation races. Sync control in the current design relies * on a "state" field updated via CAS to track completion, along * with a simple Treiber stack to hold waiting threads. diff --git a/src/java.base/share/classes/java/util/concurrent/Semaphore.java b/src/java.base/share/classes/java/util/concurrent/Semaphore.java index 0e7a9ccc0b332..fce0c39cb78ff 100644 --- a/src/java.base/share/classes/java/util/concurrent/Semaphore.java +++ b/src/java.base/share/classes/java/util/concurrent/Semaphore.java @@ -334,7 +334,7 @@ public void acquire() throws InterruptedException { * while waiting for a permit then it will continue to wait, but the * time at which the thread is assigned a permit may change compared to * the time it would have received the permit had no interruption - * occurred. When the thread does return from this method its interrupt + * occurred. When the thread does return from this method its interrupted * status will be set. */ public void acquireUninterruptibly() { @@ -494,7 +494,7 @@ public void acquire(int permits) throws InterruptedException { *

    If the current thread is {@linkplain Thread#interrupt interrupted} * while waiting for permits then it will continue to wait and its * position in the queue is not affected. When the thread does return - * from this method its interrupt status will be set. + * from this method its interrupted status will be set. * * @param permits the number of permits to acquire * @throws IllegalArgumentException if {@code permits} is negative diff --git a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java index c660af6a0ba80..ba81123fc35fd 100644 --- a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java +++ b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java @@ -652,7 +652,7 @@ public final void acquire(long arg) { /** * Acquires in exclusive mode, aborting if interrupted. - * Implemented by first checking interrupt status, then invoking + * Implemented by first checking interrupted status, then invoking * at least once {@link #tryAcquire}, returning on * success. Otherwise the thread is queued, possibly repeatedly * blocking and unblocking, invoking {@link #tryAcquire} @@ -674,7 +674,7 @@ public final void acquireInterruptibly(long arg) /** * Attempts to acquire in exclusive mode, aborting if interrupted, * and failing if the given timeout elapses. Implemented by first - * checking interrupt status, then invoking at least once {@link + * checking interrupted status, then invoking at least once {@link * #tryAcquire}, returning on success. Otherwise, the thread is * queued, possibly repeatedly blocking and unblocking, invoking * {@link #tryAcquire} until success or the thread is interrupted @@ -741,7 +741,7 @@ public final void acquireShared(long arg) { /** * Acquires in shared mode, aborting if interrupted. Implemented - * by first checking interrupt status, then invoking at least once + * by first checking interrupted status, then invoking at least once * {@link #tryAcquireShared}, returning on success. Otherwise the * thread is queued, possibly repeatedly blocking and unblocking, * invoking {@link #tryAcquireShared} until success or the thread @@ -763,7 +763,7 @@ public final void acquireSharedInterruptibly(long arg) /** * Attempts to acquire in shared mode, aborting if interrupted, and * failing if the given timeout elapses. Implemented by first - * checking interrupt status, then invoking at least once {@link + * checking interrupted status, then invoking at least once {@link * #tryAcquireShared}, returning on success. Otherwise, the * thread is queued, possibly repeatedly blocking and unblocking, * invoking {@link #tryAcquireShared} until success or the thread diff --git a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java index 0ff216c80a0bb..c077954508341 100644 --- a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java +++ b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java @@ -1032,7 +1032,7 @@ public final void acquire(int arg) { /** * Acquires in exclusive mode, aborting if interrupted. - * Implemented by first checking interrupt status, then invoking + * Implemented by first checking interrupted status, then invoking * at least once {@link #tryAcquire}, returning on * success. Otherwise the thread is queued, possibly repeatedly * blocking and unblocking, invoking {@link #tryAcquire} @@ -1054,7 +1054,7 @@ public final void acquireInterruptibly(int arg) /** * Attempts to acquire in exclusive mode, aborting if interrupted, * and failing if the given timeout elapses. Implemented by first - * checking interrupt status, then invoking at least once {@link + * checking interrupted status, then invoking at least once {@link * #tryAcquire}, returning on success. Otherwise, the thread is * queued, possibly repeatedly blocking and unblocking, invoking * {@link #tryAcquire} until success or the thread is interrupted @@ -1121,7 +1121,7 @@ public final void acquireShared(int arg) { /** * Acquires in shared mode, aborting if interrupted. Implemented - * by first checking interrupt status, then invoking at least once + * by first checking interrupted status, then invoking at least once * {@link #tryAcquireShared}, returning on success. Otherwise the * thread is queued, possibly repeatedly blocking and unblocking, * invoking {@link #tryAcquireShared} until success or the thread @@ -1143,7 +1143,7 @@ public final void acquireSharedInterruptibly(int arg) /** * Attempts to acquire in shared mode, aborting if interrupted, and * failing if the given timeout elapses. Implemented by first - * checking interrupt status, then invoking at least once {@link + * checking interrupted status, then invoking at least once {@link * #tryAcquireShared}, returning on success. Otherwise, the * thread is queued, possibly repeatedly blocking and unblocking, * invoking {@link #tryAcquireShared} until success or the thread diff --git a/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java b/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java index 917678b5f1ee8..38531c80a300a 100644 --- a/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java +++ b/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java @@ -121,7 +121,7 @@ * } * * waiters.remove(); - * // ensure correct interrupt status on return + * // ensure correct interrupted status on return * if (wasInterrupted) * Thread.currentThread().interrupt(); * } @@ -207,7 +207,7 @@ public static void unpark(Thread thread) { *

    This method does not report which of these caused the * method to return. Callers should re-check the conditions which caused * the thread to park in the first place. Callers may also determine, - * for example, the interrupt status of the thread upon return. + * for example, the interrupted status of the thread upon return. * * @param blocker the synchronization object responsible for this * thread parking @@ -252,7 +252,7 @@ public static void park(Object blocker) { *

    This method does not report which of these caused the * method to return. Callers should re-check the conditions which caused * the thread to park in the first place. Callers may also determine, - * for example, the interrupt status of the thread, or the elapsed time + * for example, the interrupted status of the thread, or the elapsed time * upon return. * * @param blocker the synchronization object responsible for this @@ -300,7 +300,7 @@ public static void parkNanos(Object blocker, long nanos) { *

    This method does not report which of these caused the * method to return. Callers should re-check the conditions which caused * the thread to park in the first place. Callers may also determine, - * for example, the interrupt status of the thread, or the current time + * for example, the interrupted status of the thread, or the current time * upon return. * * @param blocker the synchronization object responsible for this @@ -360,7 +360,7 @@ public static Object getBlocker(Thread t) { *

    This method does not report which of these caused the * method to return. Callers should re-check the conditions which caused * the thread to park in the first place. Callers may also determine, - * for example, the interrupt status of the thread upon return. + * for example, the interrupted status of the thread upon return. */ public static void park() { if (Thread.currentThread().isVirtual()) { @@ -395,7 +395,7 @@ public static void park() { *

    This method does not report which of these caused the * method to return. Callers should re-check the conditions which caused * the thread to park in the first place. Callers may also determine, - * for example, the interrupt status of the thread, or the elapsed time + * for example, the interrupted status of the thread, or the elapsed time * upon return. * * @param nanos the maximum number of nanoseconds to wait @@ -434,7 +434,7 @@ public static void parkNanos(long nanos) { *

    This method does not report which of these caused the * method to return. Callers should re-check the conditions which caused * the thread to park in the first place. Callers may also determine, - * for example, the interrupt status of the thread, or the current time + * for example, the interrupted status of the thread, or the current time * upon return. * * @param deadline the absolute time, in milliseconds from the Epoch, diff --git a/src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java b/src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java index 423ffa03d3132..32f6d5d4905d0 100644 --- a/src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java +++ b/src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java @@ -379,7 +379,7 @@ public void wakeup() { *

    This method may only be invoked by the flock owner. * *

    If interrupted then this method continues to wait until all threads - * finish, before completing with the interrupt status set. + * finish, before completing with the interrupted status set. * *

    A ThreadFlock is intended to be used in a structured manner. If * this method is called to close a flock before nested flocks are closed then it diff --git a/src/java.base/share/classes/sun/nio/ch/Interruptible.java b/src/java.base/share/classes/sun/nio/ch/Interruptible.java index b5d9a7d2b3fd2..25f762a1d6af0 100644 --- a/src/java.base/share/classes/sun/nio/ch/Interruptible.java +++ b/src/java.base/share/classes/sun/nio/ch/Interruptible.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -35,14 +35,14 @@ public interface Interruptible { * Invoked by Thread.interrupt when the given Thread is interrupted. Thread.interrupt * invokes this method while holding the given Thread's interrupt lock. This method * is also invoked by AbstractInterruptibleChannel when beginning an I/O operation - * with the current thread's interrupt status set. This method must not block. + * with the current thread's interrupted status set. This method must not block. */ void interrupt(Thread target); /** * Invoked by Thread.interrupt after releasing the Thread's interrupt lock. * It may also be invoked by AbstractInterruptibleChannel or AbstractSelector when - * beginning an I/O operation with the current thread's interrupt status set, or at + * beginning an I/O operation with the current thread's interrupted status set, or at * the end of an I/O operation when any thread doing I/O on the channel (or selector) * has been interrupted. This method closes the channel (or wakes up the Selector) to * ensure that AsynchronousCloseException or ClosedByInterruptException is thrown. diff --git a/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java b/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java index 1383db1ce8273..ec200c6e49564 100644 --- a/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java +++ b/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -278,7 +278,7 @@ Map get(CertStatusRequestType type, } } } catch (InterruptedException intex) { - // Log and reset the interrupt state + // Log and reset the interrupted state Thread.currentThread().interrupt(); if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { SSLLogger.fine("Interrupt occurred while fetching: " + diff --git a/src/java.desktop/share/classes/java/awt/Robot.java b/src/java.desktop/share/classes/java/awt/Robot.java index 957e30126e1c3..e91cc582c4caf 100644 --- a/src/java.desktop/share/classes/java/awt/Robot.java +++ b/src/java.desktop/share/classes/java/awt/Robot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, 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 @@ -717,8 +717,8 @@ private void autoDelay() { * Sleeps for the specified time. *

    * If the invoking thread is interrupted while waiting, then it will return - * immediately with the interrupt status set. If the interrupted status is - * already set, this method returns immediately with the interrupt status + * immediately with the interrupted status set. If the interrupted status is + * already set, this method returns immediately with the interrupted status * set. * * @apiNote It is recommended to avoid calling this method on @@ -736,7 +736,7 @@ public void delay(int ms) { try { Thread.sleep(ms); } catch (final InterruptedException ignored) { - thread.interrupt(); // Preserve interrupt status + thread.interrupt(); // Preserve interrupted status } } } diff --git a/src/java.net.http/share/classes/java/net/http/HttpClient.java b/src/java.net.http/share/classes/java/net/http/HttpClient.java index 4ce77486e7084..889ea56531e94 100644 --- a/src/java.net.http/share/classes/java/net/http/HttpClient.java +++ b/src/java.net.http/share/classes/java/net/http/HttpClient.java @@ -933,7 +933,7 @@ public void shutdownNow() { *

    If interrupted while waiting, this method may attempt to stop all * operations by calling {@link #shutdownNow()}. It then continues to wait * until all actively executing operations have completed. - * The interrupt status will be re-asserted before this method returns. + * The interrupted status will be re-asserted before this method returns. * *

    If already terminated, invoking this method has no effect. * diff --git a/src/java.net.http/share/classes/java/net/http/HttpResponse.java b/src/java.net.http/share/classes/java/net/http/HttpResponse.java index 9843e4c7c5b7a..1889d9d7300b9 100644 --- a/src/java.net.http/share/classes/java/net/http/HttpResponse.java +++ b/src/java.net.http/share/classes/java/net/http/HttpResponse.java @@ -1330,7 +1330,7 @@ public static BodySubscriber ofFile(Path file) { * @implNote The {@code read} method of the {@code InputStream} * returned by the default implementation of this method will * throw an {@code IOException} with the {@linkplain Thread#isInterrupted() - * thread interrupt status set} if the thread is interrupted + * thread interrupted status set} if the thread is interrupted * while blocking on read. In that case, the request will also be * cancelled and the {@code InputStream} will be closed. * diff --git a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java index 45fdbf878cbee..9ca148b618bff 100644 --- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java +++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -926,7 +926,7 @@ public Document parseURI (String uri) throws LSException { parse (source); fBusy = false; if (abortNow && currentThread.isInterrupted()) { - //reset interrupt state + //reset interrupted state abortNow = false; Thread.interrupted(); } @@ -983,7 +983,7 @@ public Document parse (LSInput is) throws LSException { parse (xmlInputSource); fBusy = false; if (abortNow && currentThread.isInterrupted()) { - //reset interrupt state + //reset interrupted state abortNow = false; Thread.interrupted(); } diff --git a/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java b/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java index 30920864c985f..312a143a8e438 100644 --- a/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java +++ b/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -202,7 +202,7 @@ public static SctpChannel open() throws * If another thread interrupts the current thread * while the connect operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws java.nio.channels.UnresolvedAddressException * If the given remote address is not fully resolved @@ -422,7 +422,7 @@ public abstract SctpChannel unbindAddress(InetAddress address) * If another thread interrupts the current thread * while the connect operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws java.nio.channels.UnresolvedAddressException * If the given remote address is not fully resolved @@ -483,7 +483,7 @@ public abstract SctpChannel unbindAddress(InetAddress address) * If another thread interrupts the current thread * while the connect operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws java.nio.channels.UnresolvedAddressException * If the given remote address is not fully resolved @@ -552,7 +552,7 @@ public abstract boolean connect(SocketAddress remote, * If another thread interrupts the current thread * while the connect operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs @@ -776,7 +776,7 @@ public final int validOps() { * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws java.nio.channels.NotYetConnectedException * If this channel is not yet connected @@ -843,7 +843,7 @@ public abstract MessageInfo receive(ByteBuffer dst, * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws java.nio.channels.NotYetConnectedException * If this channel is not yet connected diff --git a/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java b/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java index a44a5d9c142a3..54b5bb796b06f 100644 --- a/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java +++ b/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -596,7 +596,7 @@ public final int validOps() { * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws NotYetBoundException * If this channel is not yet bound @@ -682,7 +682,7 @@ public abstract MessageInfo receive(ByteBuffer buffer, * If another thread interrupts the current thread * while the read operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws IOException * If some other I/O error occurs diff --git a/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java b/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java index 27abbc71b290f..816289bb38043 100644 --- a/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java +++ b/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -132,7 +132,7 @@ public static SctpServerChannel open() throws * If another thread interrupts the current thread * while the accept operation is in progress, thereby * closing the channel and setting the current thread's - * interrupt status + * interrupted status * * @throws java.nio.channels.NotYetBoundException * If this channel's socket has not yet been bound diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadState/GetThreadStateTest.java b/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadState/GetThreadStateTest.java index 9ec9ca1b8c2b9..7f524f802676d 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadState/GetThreadStateTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadState/GetThreadStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 @@ -105,7 +105,7 @@ void testRunnable() throws Exception { int expected = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE; check(thread, expected); - // re-test with interrupt status set + // re-test with interrupted status set thread.interrupt(); check(thread, expected | JVMTI_THREAD_STATE_INTERRUPTED); } finally { @@ -143,7 +143,7 @@ void testMonitorEnter(boolean pinned) throws Exception { int expected = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER; await(thread, expected); - // re-test with interrupt status set + // re-test with interrupted status set thread.interrupt(); check(thread, expected | JVMTI_THREAD_STATE_INTERRUPTED); } @@ -192,7 +192,7 @@ void testObjectWait(boolean pinned) throws Exception { expected = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER; check(thread, expected); - // re-test with interrupt status set + // re-test with interrupted status set thread.interrupt(); check(thread, expected | JVMTI_THREAD_STATE_INTERRUPTED); } @@ -244,7 +244,7 @@ void testObjectWaitMillis(boolean pinned) throws Exception { expected = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER; check(thread, expected); - // re-test with interrupt status set + // re-test with interrupted status set thread.interrupt(); check(thread, expected | JVMTI_THREAD_STATE_INTERRUPTED); } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd001/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd001/TestDescription.java index f74b8cb6c785b..f878dbede820a 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd001/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd001/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -36,7 +36,7 @@ * - sleeping on Thread.sleep() * then agent part of the test calls InterruptThread for these threads * and the debugee checks that: - * - the running thread get interrupt status + * - the running thread get interrupted status * - the waiting and sleeping threads get InterruptedException * COMMENTS * diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/newclass02/java.base/java/lang/Object.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/newclass02/java.base/java/lang/Object.java index 47e030945abce..a52a76895f541 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/newclass02/java.base/java/lang/Object.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/newclass02/java.base/java/lang/Object.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -383,7 +383,7 @@ public final void wait(long timeoutMillis) throws InterruptedException { try { wait0(timeoutMillis); } catch (InterruptedException e) { - // virtual thread's interrupt status needs to be cleared + // virtual thread's interrupted status needs to be cleared vthread.getAndClearInterrupt(); throw e; } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t002/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t002/TestDescription.java index c8003af65ee7b..e095d4dc8a065 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t002/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t002/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -51,7 +51,7 @@ * COMMENTS * Converted the test to use GetThreadState instead of GetThreadStatus. * Test fixed according to test bug: - * 4935244 TEST BUG: wrong interrupt status flag tests. + * 4935244 TEST BUG: wrong interrupted status flag tests. * Fixed according to test bug: * 6405644 TEST_BUG: no proper sync with agent thread in sp02t001/sp02t003 * diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t003/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t003/TestDescription.java index 99509bf5107db..04e5ff8ad35ea 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t003/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t003/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -52,7 +52,7 @@ * COMMENTS * Converted the test to use GetThreadState instead of GetThreadStatus. * Test fixed according to test bug: - * 4935244 TEST BUG: wrong interrupt status flag tests. + * 4935244 TEST BUG: wrong interrupted status flag tests. * Fixed according to test bug: * 6405644 TEST_BUG: no proper sync with agent thread in sp02t001/sp02t003 * diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/AllDiag.java b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/AllDiag.java index e9f9b42955e33..ec93f3df2c01e 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/AllDiag.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/AllDiag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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,7 +41,7 @@ public AllDiag(long sleepTime) { public void run() { AllMemoryObject.dumpStatistics(); - // Ensure that interrupt status is not lost + // Ensure that interrupted status is not lost if (Thread.currentThread().isInterrupted()) return; try { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/FinDiag.java b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/FinDiag.java index 58cda02b24f7e..1864687e1228e 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/FinDiag.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/FinDiag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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,7 +41,7 @@ public FinDiag(long sleepTime) { public void run() { FinMemoryObject.dumpStatistics(); - // Ensure that interrupt status is not lost + // Ensure that interrupted status is not lost if (Thread.currentThread().isInterrupted()) return; try { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/runner/MemDiag.java b/test/hotspot/jtreg/vmTestbase/nsk/share/runner/MemDiag.java index f361c62b5aec0..19dce3d8c39d5 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/runner/MemDiag.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/runner/MemDiag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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,7 +39,7 @@ public MemDiag(long sleepTime) { public void run() { System.out.println(Runtime.getRuntime().freeMemory()); - // Ensure that interrupt status is not lost + // Ensure that interrupted status is not lost if (Thread.currentThread().isInterrupted()) return; try { diff --git a/test/jdk/com/sun/nio/sctp/SctpServerChannel/Accept.java b/test/jdk/com/sun/nio/sctp/SctpServerChannel/Accept.java index 56522a85f6be9..c68bfd2894502 100644 --- a/test/jdk/com/sun/nio/sctp/SctpServerChannel/Accept.java +++ b/test/jdk/com/sun/nio/sctp/SctpServerChannel/Accept.java @@ -190,7 +190,7 @@ public void run() { /* TEST 5: AsynchronousCloseException */ debug("TEST 5: AsynchronousCloseException"); - /* reset thread interrupt status */ + /* reset thread interrupted status */ Thread.currentThread().interrupted(); ssc = SctpServerChannel.open().bind(null); diff --git a/test/jdk/java/lang/Thread/JoinWithDuration.java b/test/jdk/java/lang/Thread/JoinWithDuration.java index 0eae0daeb78af..5eebacf210721 100644 --- a/test/jdk/java/lang/Thread/JoinWithDuration.java +++ b/test/jdk/java/lang/Thread/JoinWithDuration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 @@ -100,7 +100,7 @@ void testJoinOnTerminatedThread() throws Exception { } /** - * Test invoking join with interrupt status set. + * Test invoking join with interrupted status set. */ @Test void testJoinWithInterruptStatusSet() throws Exception { @@ -141,7 +141,7 @@ void testInterruptJoin() throws Exception { thread.join(Duration.ofMinutes(1)); fail(); } catch (InterruptedException e) { - // interrupt status should be cleared + // interrupted status should be cleared assertFalse(thread.isInterrupted()); } finally { LockSupport.unpark(thread); diff --git a/test/jdk/java/lang/Thread/SleepWithDuration.java b/test/jdk/java/lang/Thread/SleepWithDuration.java index 4db64957f64f9..00704cdcb7c0b 100644 --- a/test/jdk/java/lang/Thread/SleepWithDuration.java +++ b/test/jdk/java/lang/Thread/SleepWithDuration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 @@ -53,7 +53,7 @@ void testSleep() throws Exception { } /** - * Test Thread.sleep with interrupt status set. + * Test Thread.sleep with interrupted status set. */ @Test void testSleepWithInterruptStatusSet() throws Exception { @@ -94,7 +94,7 @@ void testInterruptSleep() throws Exception { Thread.sleep(Duration.ofSeconds(60)); fail(); } catch (InterruptedException e) { - // interrupt status should be cleared + // interrupted status should be cleared assertFalse(Thread.interrupted()); } finally { wakerThread.join(); diff --git a/test/jdk/java/lang/Thread/virtual/CustomScheduler.java b/test/jdk/java/lang/Thread/virtual/CustomScheduler.java index 4289add0a3ad0..1b0a6b28e96f5 100644 --- a/test/jdk/java/lang/Thread/virtual/CustomScheduler.java +++ b/test/jdk/java/lang/Thread/virtual/CustomScheduler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -204,7 +204,7 @@ void testTerminateWithInterruptSet() { } /** - * Test running task with the carrier interrupt status set. + * Test running task with the carrier's interrupted status set. */ @Test void testRunWithInterruptSet() throws Exception { diff --git a/test/jdk/java/lang/Thread/virtual/MonitorWaitNotify.java b/test/jdk/java/lang/Thread/virtual/MonitorWaitNotify.java index 47089d9d6df95..5aecc659a3135 100644 --- a/test/jdk/java/lang/Thread/virtual/MonitorWaitNotify.java +++ b/test/jdk/java/lang/Thread/virtual/MonitorWaitNotify.java @@ -419,7 +419,7 @@ void testTimedWaitDuration2() throws Exception { } /** - * Testing invoking Object.wait with interrupt status set. + * Testing invoking Object.wait with interrupted status set. */ @ParameterizedTest @ValueSource(ints = { 0, 30000, Integer.MAX_VALUE }) diff --git a/test/jdk/java/lang/Thread/virtual/Parking.java b/test/jdk/java/lang/Thread/virtual/Parking.java index c337f36e7c25a..4ee320ca99f7d 100644 --- a/test/jdk/java/lang/Thread/virtual/Parking.java +++ b/test/jdk/java/lang/Thread/virtual/Parking.java @@ -169,7 +169,7 @@ void testPark7() throws Exception { } /** - * Park with interrupt status set. + * Park with interrupted status set. */ @Test void testPark8() throws Exception { @@ -196,7 +196,7 @@ void testPark9() throws Exception { } /** - * Park while holding monitor and with interrupt status set. + * Park while holding monitor and with interrupted status set. */ @Test void testPark10() throws Exception { @@ -318,7 +318,7 @@ void testParkNanos7() throws Exception { } /** - * Park with parkNanos and interrupt status set. + * Park with parkNanos and interrupted status set. */ @Test void testParkNanos8() throws Exception { @@ -345,7 +345,7 @@ void testParkNanos9() throws Exception { } /** - * Park with parkNanos while holding monitor and with interrupt status set. + * Park with parkNanos while holding monitor and with interrupted status set. */ @Test void testParkNanos10() throws Exception { diff --git a/test/jdk/java/lang/Thread/virtual/ThreadAPI.java b/test/jdk/java/lang/Thread/virtual/ThreadAPI.java index 397514c385296..1089081d18676 100644 --- a/test/jdk/java/lang/Thread/virtual/ThreadAPI.java +++ b/test/jdk/java/lang/Thread/virtual/ThreadAPI.java @@ -403,7 +403,7 @@ void testJoin14() throws Exception { } /** - * Test platform thread invoking Thread.join with interrupt status set. + * Test platform thread invoking Thread.join with interrupted status set. */ @Test void testJoin15() throws Exception { @@ -419,7 +419,7 @@ void testJoin15() throws Exception { } /** - * Test virtual thread invoking Thread.join with interrupt status set. + * Test virtual thread invoking Thread.join with interrupted status set. */ @Test void testJoin16() throws Exception { @@ -427,7 +427,7 @@ void testJoin16() throws Exception { } /** - * Test platform thread invoking timed-Thread.join with interrupt status set. + * Test platform thread invoking timed-Thread.join with interrupted status set. */ @Test void testJoin17() throws Exception { @@ -443,7 +443,7 @@ void testJoin17() throws Exception { } /** - * Test virtual thread invoking timed-Thread.join with interrupt status set. + * Test virtual thread invoking timed-Thread.join with interrupted status set. */ @Test void testJoin18() throws Exception { @@ -451,7 +451,7 @@ void testJoin18() throws Exception { } /** - * Test platform thread invoking timed-Thread.join with interrupt status set. + * Test platform thread invoking timed-Thread.join with interrupted status set. */ @Test void testJoin19() throws Exception { @@ -468,7 +468,7 @@ void testJoin19() throws Exception { } /** - * Test virtual thread invoking timed-Thread.join with interrupt status set. + * Test virtual thread invoking timed-Thread.join with interrupted status set. */ @Test void testJoin20() throws Exception { @@ -593,7 +593,7 @@ void testJoin28() throws Exception { } /** - * Test virtual thread with interrupt status set calling Thread.join to wait + * Test virtual thread with interrupted status set calling Thread.join to wait * for platform thread to terminate. */ @Test @@ -732,7 +732,7 @@ void testInterrupt1() throws Exception { assertFalse(me.isInterrupted()); me.interrupt(); assertTrue(me.isInterrupted()); - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status assertFalse(me.isInterrupted()); me.interrupt(); }); @@ -760,7 +760,7 @@ void testInterrupt3() throws Exception { } /** - * Test termination with interrupt status set. + * Test termination with interrupted status set. */ @Test void testInterrupt4() throws Exception { @@ -805,7 +805,7 @@ void testInterrupt6() throws Exception { Thread.sleep(60*1000); fail("sleep not interrupted"); } catch (InterruptedException e) { - // interrupt status should be reset + // interrupted status should be reset assertFalse(Thread.interrupted()); } } catch (Exception e) { @@ -839,7 +839,7 @@ void testInterrupt7() throws Exception { } /** - * Test trying to park with interrupt status set. + * Test trying to park with interrupted status set. */ @Test void testInterrupt8() throws Exception { @@ -852,7 +852,7 @@ void testInterrupt8() throws Exception { } /** - * Test trying to wait with interrupt status set. + * Test trying to wait with interrupted status set. */ @Test void testInterrupt9() throws Exception { @@ -871,7 +871,7 @@ void testInterrupt9() throws Exception { } /** - * Test trying to block with interrupt status set. + * Test trying to block with interrupted status set. */ @Test void testInterrupt10() throws Exception { @@ -1237,7 +1237,7 @@ static Stream sleepers() { } /** - * Test Thread.sleep with interrupt status set. + * Test Thread.sleep with interrupted status set. */ @ParameterizedTest @MethodSource("sleepers") @@ -1256,7 +1256,7 @@ void testSleep4(ThrowingRunnable sleeper) throws Exception { } /** - * Test Thread.sleep with interrupt status set and a negative duration. + * Test Thread.sleep with interrupted status set and a negative duration. */ @Test void testSleep4() throws Exception { @@ -1292,7 +1292,7 @@ void testSleep5(ThrowingRunnable sleeper) throws Exception { sleeper.run(); fail("sleep was not interrupted"); } catch (InterruptedException e) { - // interrupt status should be cleared + // interrupted status should be cleared assertFalse(t.isInterrupted()); } }); @@ -1356,7 +1356,7 @@ void testSleep8() throws Exception { } /** - * Test Thread.sleep when pinned and with interrupt status set. + * Test Thread.sleep when pinned and with interrupted status set. */ @Test void testSleep9() throws Exception { @@ -1389,7 +1389,7 @@ void testSleep10() throws Exception { }); fail("sleep not interrupted"); } catch (InterruptedException e) { - // interrupt status should be cleared + // interrupted status should be cleared assertFalse(t.isInterrupted()); } }); diff --git a/test/jdk/java/net/Socket/Timeouts.java b/test/jdk/java/net/Socket/Timeouts.java index f8fcfb86d0f1d..17f3d9db80949 100644 --- a/test/jdk/java/net/Socket/Timeouts.java +++ b/test/jdk/java/net/Socket/Timeouts.java @@ -442,7 +442,7 @@ void testTimedAccept7() throws IOException { } /** - * Test timed accept with the thread interrupt status set. + * Test timed accept with the thread interrupted status set. */ @Test void testTimedAccept8() throws IOException { @@ -461,7 +461,7 @@ void testTimedAccept8() throws IOException { checkDuration(startMillis, timeout-100, timeout+20_000); assertTrue(Thread.currentThread().isInterrupted()); } finally { - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } } } @@ -488,7 +488,7 @@ void testTimedAccept9() throws IOException { assertTrue(Thread.currentThread().isInterrupted()); } finally { interrupter.cancel(true); - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } } } diff --git a/test/jdk/java/net/httpclient/CancelRequestTest.java b/test/jdk/java/net/httpclient/CancelRequestTest.java index bfc1eff9cf908..23e4a042179ad 100644 --- a/test/jdk/java/net/httpclient/CancelRequestTest.java +++ b/test/jdk/java/net/httpclient/CancelRequestTest.java @@ -607,7 +607,7 @@ public void testPostInterrupt(String uri, boolean sameClient) } else if (failed instanceof IOException) { out.println(uriStr + ": got IOException: " + failed); // that could be OK if the main thread was interrupted - // from the main thread: the interrupt status could have + // from the main thread: the interrupted status could have // been caught by writing to the socket from the main // thread. if (interruptingThread.isDone() && interruptingThread.get() == main) { diff --git a/test/jdk/java/nio/channels/Channels/SocketChannelStreams.java b/test/jdk/java/nio/channels/Channels/SocketChannelStreams.java index 57142fb03d74b..72c07392d7c41 100644 --- a/test/jdk/java/nio/channels/Channels/SocketChannelStreams.java +++ b/test/jdk/java/nio/channels/Channels/SocketChannelStreams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 @@ -130,7 +130,7 @@ public void testRead6() throws Exception { } /** - * Test interrupt status set before read. + * Test interrupted status set before read. */ public void testRead7() throws Exception { withConnection((sc, peer) -> { @@ -220,7 +220,7 @@ public void testWrite3() throws Exception { } /** - * Test interrupt status set before write. + * Test interrupted status set before write. */ public void testWrite4() throws Exception { withConnection((sc, peer) -> { diff --git a/test/jdk/java/nio/channels/DatagramChannel/InterruptibleOrNot.java b/test/jdk/java/nio/channels/DatagramChannel/InterruptibleOrNot.java index e6fde147bd9ba..ace3e6343e8db 100644 --- a/test/jdk/java/nio/channels/DatagramChannel/InterruptibleOrNot.java +++ b/test/jdk/java/nio/channels/DatagramChannel/InterruptibleOrNot.java @@ -61,7 +61,7 @@ static void setup() throws Exception { } /** - * Call DatagramChannel.receive with the interrupt status set, the DatagramChannel + * Call DatagramChannel.receive with the interrupted status set, the DatagramChannel * is interruptible. */ @Test @@ -72,7 +72,7 @@ public void testInterruptBeforeInterruptibleReceive() throws Exception { assertThrows(ClosedByInterruptException.class, () -> dc.receive(buf)); assertFalse(dc.isOpen()); } finally { - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } } @@ -89,12 +89,12 @@ public void testInterruptDuringInterruptibleReceive() throws Exception { assertThrows(ClosedByInterruptException.class, () -> dc.receive(buf)); assertFalse(dc.isOpen()); } finally { - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } } /** - * Call DatagramChannel.receive with the interrupt status set, the DatagramChannel + * Call DatagramChannel.receive with the interrupted status set, the DatagramChannel * is not interruptible. */ @Test @@ -111,7 +111,7 @@ public void testInterruptBeforeUninterruptibleReceive() throws Exception { assertThrows(AsynchronousCloseException.class, () -> dc.receive(buf)); assertFalse(dc.isOpen()); } finally { - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } } @@ -136,12 +136,12 @@ public void testInterruptDuringUninterruptibleReceive() throws Exception { assertThrows(AsynchronousCloseException.class, () -> dc.receive(buf)); assertFalse(dc.isOpen()); } finally { - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } } /** - * Call DatagramChannel.send with the interrupt status set, the DatagramChannel + * Call DatagramChannel.send with the interrupted status set, the DatagramChannel * is interruptible. */ @Test @@ -158,7 +158,7 @@ public void testInterruptBeforeInterruptibleSend() throws Exception { } /** - * Call DatagramChannel.send with the interrupt status set, the DatagramChannel + * Call DatagramChannel.send with the interrupted status set, the DatagramChannel * is not interruptible. */ @Test @@ -171,7 +171,7 @@ public void testInterruptBeforeUninterruptibleSend() throws Exception { assertEquals(100, n); assertTrue(dc.isOpen()); } finally { - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } } diff --git a/test/jdk/java/nio/channels/FileChannel/CloseDuringTransfer.java b/test/jdk/java/nio/channels/FileChannel/CloseDuringTransfer.java index 3b1973782d6f1..d4c61bfd9e20d 100644 --- a/test/jdk/java/nio/channels/FileChannel/CloseDuringTransfer.java +++ b/test/jdk/java/nio/channels/FileChannel/CloseDuringTransfer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 @@ -232,7 +232,7 @@ private Future scheduleInterrupt() { /** * Waits for the interrupt task submitted by scheduleInterrupt, and clears the - * current thread's interrupt status. + * current thread's interrupted status. */ private void finishInterrupt(Future interrupter) throws Exception { boolean done = false; diff --git a/test/jdk/java/nio/channels/FileChannel/ClosedByInterrupt.java b/test/jdk/java/nio/channels/FileChannel/ClosedByInterrupt.java index a14d111b6f0bd..66fbd57a05af8 100644 --- a/test/jdk/java/nio/channels/FileChannel/ClosedByInterrupt.java +++ b/test/jdk/java/nio/channels/FileChannel/ClosedByInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 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 @@ -144,9 +144,9 @@ public void run() { } catch (ClosedByInterruptException e) { if (interruptible) { if (Thread.interrupted()) { - expected(e + " thrown and interrupt status set"); + expected(e + " thrown and interrupted status set"); } else { - unexpected(e + " thrown but interrupt status not set"); + unexpected(e + " thrown but interrupted status not set"); } } else { unexpected(e); diff --git a/test/jdk/java/nio/channels/Pipe/PipeInterrupt.java b/test/jdk/java/nio/channels/Pipe/PipeInterrupt.java index 53606b604875e..b81823efd5470 100644 --- a/test/jdk/java/nio/channels/Pipe/PipeInterrupt.java +++ b/test/jdk/java/nio/channels/Pipe/PipeInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -55,7 +55,7 @@ public void run() { close(); if (interrupted) { if (!this.isInterrupted()) - exc = new RuntimeException("interrupt status reset"); + exc = new RuntimeException("interrupted status reset"); break; } } catch (IOException ioe) { diff --git a/test/jdk/java/nio/channels/Selector/LotsOfInterrupts.java b/test/jdk/java/nio/channels/Selector/LotsOfInterrupts.java index 98470dec160d5..5fea3d5c932d9 100644 --- a/test/jdk/java/nio/channels/Selector/LotsOfInterrupts.java +++ b/test/jdk/java/nio/channels/Selector/LotsOfInterrupts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 @@ -64,7 +64,7 @@ public static void main(String[] args) throws Exception { phaser.arriveAndAwaitAdvance(); sel.select(); - // clear interrupt status and consume wakeup + // clear interrupted status and consume wakeup Thread.interrupted(); sel.selectNow(); } diff --git a/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java b/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java index 41edb207239e3..1a2ada51bce87 100644 --- a/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java +++ b/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -360,7 +360,7 @@ public void testWakeupDuringSelect() throws Exception { } /** - * Test invoking select with interrupt status set + * Test invoking select with interrupted status set */ public void testInterruptBeforeSelect() throws Exception { // select(Consumer) @@ -371,7 +371,7 @@ public void testInterruptBeforeSelect() throws Exception { assertTrue(Thread.currentThread().isInterrupted()); assertTrue(sel.isOpen()); } finally { - Thread.currentThread().interrupted(); // clear interrupt status + Thread.currentThread().interrupted(); // clear interrupted status } // select(Consumer, timeout) @@ -384,7 +384,7 @@ public void testInterruptBeforeSelect() throws Exception { assertTrue(Thread.currentThread().isInterrupted()); assertTrue(sel.isOpen()); } finally { - Thread.currentThread().interrupted(); // clear interrupt status + Thread.currentThread().interrupted(); // clear interrupted status } } @@ -400,7 +400,7 @@ public void testInterruptDuringSelect() throws Exception { assertTrue(Thread.currentThread().isInterrupted()); assertTrue(sel.isOpen()); } finally { - Thread.currentThread().interrupted(); // clear interrupt status + Thread.currentThread().interrupted(); // clear interrupted status } // select(Consumer, timeout) @@ -411,7 +411,7 @@ public void testInterruptDuringSelect() throws Exception { assertTrue(Thread.currentThread().isInterrupted()); assertTrue(sel.isOpen()); } finally { - Thread.currentThread().interrupted(); // clear interrupt status + Thread.currentThread().interrupted(); // clear interrupted status } } diff --git a/test/jdk/java/nio/channels/Selector/WakeupAfterClose.java b/test/jdk/java/nio/channels/Selector/WakeupAfterClose.java index 92b1aef5c6da7..965300c8a3a32 100644 --- a/test/jdk/java/nio/channels/Selector/WakeupAfterClose.java +++ b/test/jdk/java/nio/channels/Selector/WakeupAfterClose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -23,7 +23,7 @@ /* @test * @bug 6524172 - * @summary Invoking wakeup on closed Selector can throw NPE if close resets interrupt status + * @summary Invoking wakeup on closed Selector can throw NPE if close resets interrupted status */ import java.io.IOException; diff --git a/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java b/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java index 846d5cd22b695..3487ae45de1f0 100644 --- a/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java +++ b/test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -106,7 +106,7 @@ public void testRead5() throws Exception { } /** - * Test interrupt status set before read + * Test interrupted status set before read */ public void testRead6() throws Exception { withConnection((sc, peer) -> { @@ -203,7 +203,7 @@ public void testTimedRead4() throws Exception { } /** - * Test interrupt status set before timed read + * Test interrupted status set before timed read */ public void testTimedRead5() throws Exception { withConnection((sc, peer) -> { @@ -257,7 +257,7 @@ public void testWrite1() throws Exception { } /** - * Test interrupt status set before write + * Test interrupted status set before write */ public void testWrite2() throws Exception { withConnection((sc, peer) -> { diff --git a/test/jdk/java/nio/channels/vthread/SelectorOps.java b/test/jdk/java/nio/channels/vthread/SelectorOps.java index 0c86cae61850e..81821a8579114 100644 --- a/test/jdk/java/nio/channels/vthread/SelectorOps.java +++ b/test/jdk/java/nio/channels/vthread/SelectorOps.java @@ -253,7 +253,7 @@ public void testCloseDuringSelectWhenPinned() throws Exception { } /** - * Test calling select with interrupt status set. + * Test calling select with interrupted status set. */ @Test public void testInterruptBeforeSelect() throws Exception { @@ -270,7 +270,7 @@ public void testInterruptBeforeSelect() throws Exception { } /** - * Test calling select with interrupt status set and thread is pinned. + * Test calling select with interrupted status set and thread is pinned. */ @Test public void testInterruptBeforeSelectWhenPinned() throws Exception { diff --git a/test/jdk/java/nio/file/Files/CallWithInterruptSet.java b/test/jdk/java/nio/file/Files/CallWithInterruptSet.java index 313862e65f3d9..3d7bfd2c518de 100644 --- a/test/jdk/java/nio/file/Files/CallWithInterruptSet.java +++ b/test/jdk/java/nio/file/Files/CallWithInterruptSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -25,7 +25,7 @@ * @test * @bug 8205612 * @run testng CallWithInterruptSet - * @summary Test invoking Files methods with the interrupt status set + * @summary Test invoking Files methods with the interrupted status set */ import java.io.InputStream; diff --git a/test/jdk/java/nio/file/Files/InterruptCopy.java b/test/jdk/java/nio/file/Files/InterruptCopy.java index f13a2877d912b..81f5c0d86bcb0 100644 --- a/test/jdk/java/nio/file/Files/InterruptCopy.java +++ b/test/jdk/java/nio/file/Files/InterruptCopy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -120,7 +120,7 @@ public void run() { } catch (IOException e) { boolean interrupted = Thread.interrupted(); if (!interrupted) - throw new RuntimeException("Interrupt status was not set"); + throw new RuntimeException("Interrupted status was not set"); System.out.println("Copy failed (this is expected)."); } try { diff --git a/test/jdk/java/util/concurrent/CompletableFuture/LostInterrupt.java b/test/jdk/java/util/concurrent/CompletableFuture/LostInterrupt.java index 0f5a462b630d1..e46b0d0ee5e33 100644 --- a/test/jdk/java/util/concurrent/CompletableFuture/LostInterrupt.java +++ b/test/jdk/java/util/concurrent/CompletableFuture/LostInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -30,7 +30,7 @@ * @test * @bug 8254350 * @run main LostInterrupt - * @summary CompletableFuture.get may swallow interrupt status + * @summary CompletableFuture.get may swallow interrupted status * @key randomness */ @@ -38,9 +38,9 @@ /** * Submits a task that completes immediately, then invokes CompletableFuture.get - * with the interrupt status set. CompletableFuture.get should either complete - * immediately with the interrupt status set, or else throw InterruptedException - * with the interrupt status cleared. + * with the interrupted status set. CompletableFuture.get should either complete + * immediately with the interrupted status set, or else throw InterruptedException + * with the interrupted status cleared. */ public class LostInterrupt { static final int ITERATIONS = 10_000; @@ -63,7 +63,7 @@ public static void main(String[] args) throws Exception { } catch (InterruptedException expected) { if (Thread.interrupted()) throw new AssertionError( - "interrupt status not cleared, run=" + i); + "interrupted status not cleared, run=" + i); } } } finally { diff --git a/test/jdk/java/util/concurrent/CompletableFuture/SwallowedInterruptedException.java b/test/jdk/java/util/concurrent/CompletableFuture/SwallowedInterruptedException.java index 93ae7305998ca..98ba7ce037cba 100644 --- a/test/jdk/java/util/concurrent/CompletableFuture/SwallowedInterruptedException.java +++ b/test/jdk/java/util/concurrent/CompletableFuture/SwallowedInterruptedException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -57,12 +57,12 @@ public static void main(String[] args) throws Throwable { if (!Thread.currentThread().isInterrupted()) { fail.set(new AssertionError( - "Future.get completed with interrupt status not set")); + "Future.get completed with interrupted status not set")); } } catch (InterruptedException ex) { if (Thread.currentThread().isInterrupted()) { fail.set(new AssertionError( - "InterruptedException with interrupt status set")); + "InterruptedException with interrupted status set")); } } catch (Throwable ex) { fail.set(ex); diff --git a/test/jdk/java/util/concurrent/ExecutorService/CloseTest.java b/test/jdk/java/util/concurrent/ExecutorService/CloseTest.java index 162d4f7d1b4b5..129d388cf6d0e 100644 --- a/test/jdk/java/util/concurrent/ExecutorService/CloseTest.java +++ b/test/jdk/java/util/concurrent/ExecutorService/CloseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 @@ -207,7 +207,7 @@ void testTerminateBeforeClose(ExecutorService executor) throws Exception { } /** - * Test invoking close with interrupt status set. + * Test invoking close with interrupted status set. */ @ParameterizedTest @MethodSource("executors") @@ -225,7 +225,7 @@ void testInterruptBeforeClose(ExecutorService executor) throws Exception { executor.close(); assertTrue(Thread.currentThread().isInterrupted()); } finally { - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } assertTrue(executor.isShutdown()); assertTrue(executor.isTerminated()); @@ -259,7 +259,7 @@ void testInterruptDuringClose(ExecutorService executor) throws Exception { executor.close(); assertTrue(Thread.currentThread().isInterrupted()); } finally { - Thread.interrupted(); // clear interrupt status + Thread.interrupted(); // clear interrupted status } assertTrue(executor.isShutdown()); assertTrue(executor.isTerminated()); diff --git a/test/jdk/java/util/concurrent/ExecutorService/InvokeTest.java b/test/jdk/java/util/concurrent/ExecutorService/InvokeTest.java index a9a4eb0d8d78e..901291450fc02 100644 --- a/test/jdk/java/util/concurrent/ExecutorService/InvokeTest.java +++ b/test/jdk/java/util/concurrent/ExecutorService/InvokeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 @@ -284,7 +284,7 @@ void testInvokeAnyWithTimeout3(ExecutorService executor) throws Exception { } /** - * Test invokeAny with interrupt status set. + * Test invokeAny with interrupted status set. */ @ParameterizedTest @MethodSource("executors") @@ -530,7 +530,7 @@ void testInvokeAll4(ExecutorService executor) throws Exception { } /** - * Test invokeAll with interrupt status set. + * Test invokeAll with interrupted status set. */ @ParameterizedTest @MethodSource("executors") @@ -555,7 +555,7 @@ void testInvokeAllInterrupt1(ExecutorService executor) throws Exception { } /** - * Test timed-invokeAll with interrupt status set. + * Test timed-invokeAll with interrupted status set. */ @ParameterizedTest @MethodSource("executors") diff --git a/test/jdk/java/util/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java b/test/jdk/java/util/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java index 79f4a9351955d..762f24dc89fda 100644 --- a/test/jdk/java/util/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java +++ b/test/jdk/java/util/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java @@ -425,7 +425,7 @@ void testJoinConfined(ThreadFactory factory) throws Exception { } /** - * Test join with interrupt status set. + * Test join with interrupted status set. */ @ParameterizedTest @MethodSource("factories") @@ -444,7 +444,7 @@ void testInterruptJoin1(ThreadFactory factory) throws Exception { scope.join(); fail("join did not throw"); } catch (InterruptedException expected) { - assertFalse(Thread.interrupted()); // interrupt status should be cleared + assertFalse(Thread.interrupted()); // interrupted status should be cleared } } } @@ -470,7 +470,7 @@ void testInterruptJoin2(ThreadFactory factory) throws Exception { scope.join(); fail("join did not throw"); } catch (InterruptedException expected) { - assertFalse(Thread.interrupted()); // interrupt status should be clear + assertFalse(Thread.interrupted()); // interrupted status should be clear } } } @@ -745,7 +745,7 @@ void testCloseConfined(ThreadFactory factory) throws Exception { } /** - * Test close with interrupt status set. + * Test close with interrupted status set. */ @ParameterizedTest @MethodSource("factories") @@ -776,12 +776,12 @@ void testInterruptClose1(ThreadFactory factory) throws Exception { scope.join(); - // invoke close with interrupt status set + // invoke close with interrupted status set Thread.currentThread().interrupt(); try { scope.close(); } finally { - assertTrue(Thread.interrupted()); // clear interrupt status + assertTrue(Thread.interrupted()); // clear interrupted status assertTrue(done.get()); } } @@ -829,7 +829,7 @@ void testInterruptClose2(ThreadFactory factory) throws Exception { try { scope.close(); } finally { - assertTrue(Thread.interrupted()); // clear interrupt status + assertTrue(Thread.interrupted()); // clear interrupted status assertTrue(done.get()); } } diff --git a/test/jdk/java/util/concurrent/ThreadPerTaskExecutor/ThreadPerTaskExecutorTest.java b/test/jdk/java/util/concurrent/ThreadPerTaskExecutor/ThreadPerTaskExecutorTest.java index ff3b9566f5e8f..1427a72b9314a 100644 --- a/test/jdk/java/util/concurrent/ThreadPerTaskExecutor/ThreadPerTaskExecutorTest.java +++ b/test/jdk/java/util/concurrent/ThreadPerTaskExecutor/ThreadPerTaskExecutorTest.java @@ -228,7 +228,7 @@ void testClose2(ExecutorService executor) throws Exception { } /** - * Invoke close with interrupt status set. + * Invoke close with interrupted status set. */ @ParameterizedTest @MethodSource("executors") @@ -593,7 +593,7 @@ class FooException extends Exception { } } /** - * Test invokeAny with interrupt status set. + * Test invokeAny with interrupted status set. */ @ParameterizedTest @MethodSource("executors") @@ -822,7 +822,7 @@ void testInvokeAll4(ExecutorService executor) throws Exception { } /** - * Test untimed-invokeAll with interrupt status set. + * Test untimed-invokeAll with interrupted status set. */ @ParameterizedTest @MethodSource("executors") @@ -846,7 +846,7 @@ void testInvokeAllInterrupt1(ExecutorService executor) throws Exception { } /** - * Test timed-invokeAll with interrupt status set. + * Test timed-invokeAll with interrupted status set. */ @ParameterizedTest @MethodSource("executors") diff --git a/test/jdk/java/util/concurrent/tck/JSR166TestCase.java b/test/jdk/java/util/concurrent/tck/JSR166TestCase.java index 18007f72ca8f5..80e6c98bfa7bf 100644 --- a/test/jdk/java/util/concurrent/tck/JSR166TestCase.java +++ b/test/jdk/java/util/concurrent/tck/JSR166TestCase.java @@ -832,7 +832,7 @@ void tearDownFail(String format, Object... args) { * by rethrowing, in the test harness thread, any exception recorded * earlier by threadRecordFailure. * - * Triggers test case failure if interrupt status is set in the main thread. + * Triggers test case failure if interrupted status is set in the main thread. */ public void tearDown() throws Exception { Throwable t = threadFailure.getAndSet(null); @@ -848,7 +848,7 @@ else if (t instanceof Exception) } if (Thread.interrupted()) - tearDownFail("interrupt status set in main thread"); + tearDownFail("interrupted status set in main thread"); checkForkJoinPoolThreadLeaks(); } @@ -1460,7 +1460,7 @@ void waitForThreadToEnterWaitState(Thread thread, /** * Spin-waits up to LONG_DELAY_MS milliseconds for the current thread to - * be interrupted. Clears the interrupt status before returning. + * be interrupted. Clears the interrupted status before returning. */ void awaitInterrupted() { for (long startTime = 0L; !Thread.interrupted(); ) { diff --git a/test/jdk/java/util/concurrent/tck/StampedLockTest.java b/test/jdk/java/util/concurrent/tck/StampedLockTest.java index 673047ccf12fa..8fe8aaca569ac 100644 --- a/test/jdk/java/util/concurrent/tck/StampedLockTest.java +++ b/test/jdk/java/util/concurrent/tck/StampedLockTest.java @@ -410,7 +410,7 @@ public void testInterruptibleOperationsThrowInterruptedExceptionReadLockedInterr } /** - * Non-interruptible operations ignore and preserve interrupt status + * Non-interruptible operations ignore and preserve interrupted status */ public void testNonInterruptibleOperationsIgnoreInterrupts() { final StampedLock lock = new StampedLock(); diff --git a/test/jdk/java/util/zip/InterruptibleZip.java b/test/jdk/java/util/zip/InterruptibleZip.java index f7e2be4fdfbb8..5a4b9904db944 100644 --- a/test/jdk/java/util/zip/InterruptibleZip.java +++ b/test/jdk/java/util/zip/InterruptibleZip.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception { System.out.printf("interrupted=%s n=%d name=%s%n", interrupted, n, ze.getName()); if (! interrupted) { - throw new Error("Wrong interrupt status"); + throw new Error("Wrong interrupted status"); } if (n != buf.length) { throw new Error("Read error"); diff --git a/test/jdk/jdk/internal/misc/ThreadFlock/ThreadFlockTest.java b/test/jdk/jdk/internal/misc/ThreadFlock/ThreadFlockTest.java index ebc718d2203c5..3fc143f38c832 100644 --- a/test/jdk/jdk/internal/misc/ThreadFlock/ThreadFlockTest.java +++ b/test/jdk/jdk/internal/misc/ThreadFlock/ThreadFlockTest.java @@ -530,7 +530,7 @@ void testAwaitAllWithTimeout4(ThreadFactory factory) throws Exception { } /** - * Test awaitAll with interrupt status set, should interrupt thread. + * Test awaitAll with interrupted status set, should interrupt thread. */ @ParameterizedTest @MethodSource("factories") @@ -550,17 +550,17 @@ void testInterruptAwaitAll1(ThreadFactory factory) { Thread thread = factory.newThread(awaitLatch); flock.start(thread); - // invoke awaitAll with interrupt status set. + // invoke awaitAll with interrupted status set. Thread.currentThread().interrupt(); try { flock.awaitAll(); fail("awaitAll did not throw"); } catch (InterruptedException e) { - // interrupt status should be clear + // interrupted status should be clear assertFalse(Thread.currentThread().isInterrupted()); } - // invoke awaitAll(Duration) with interrupt status set. + // invoke awaitAll(Duration) with interrupted status set. Thread.currentThread().interrupt(); try { flock.awaitAll(Duration.ofSeconds(30)); @@ -568,7 +568,7 @@ void testInterruptAwaitAll1(ThreadFactory factory) { } catch (TimeoutException e) { fail("TimeoutException not expected"); } catch (InterruptedException e) { - // interrupt status should be clear + // interrupted status should be clear assertFalse(Thread.currentThread().isInterrupted()); } @@ -609,7 +609,7 @@ void testInterruptAwaitAll2(ThreadFactory factory) { flock.awaitAll(); fail("awaitAll did not throw"); } catch (InterruptedException e) { - // interrupt status should be clear + // interrupted status should be clear assertFalse(Thread.currentThread().isInterrupted()); } @@ -620,7 +620,7 @@ void testInterruptAwaitAll2(ThreadFactory factory) { } catch (TimeoutException e) { fail("TimeoutException not expected"); } catch (InterruptedException e) { - // interrupt status should be clear + // interrupted status should be clear assertFalse(Thread.currentThread().isInterrupted()); } @@ -841,7 +841,7 @@ private void testCloseConfined(ThreadFlock flock, } /** - * Test close with interrupt status set, should not interrupt threads. + * Test close with interrupted status set, should not interrupt threads. */ @ParameterizedTest @MethodSource("factories") diff --git a/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java b/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java index bdc1b5386088b..bcfc1290cf04b 100644 --- a/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java +++ b/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java @@ -272,7 +272,7 @@ public Map.Entry runTest() { CertStatusRequest oReq = OCSPStatusRequest.EMPTY_OCSP; try { - // Force the interrupt flag to be set on the thread that + // Force the interrupted flag to be set on the thread that // performs the invokeAll in the SRM. Thread.currentThread().interrupt();