Skip to content

Commit

Permalink
8294377: Prepare to stop auto-inheriting documentation for subclasses…
Browse files Browse the repository at this point in the history
… of exceptions whose documentation is inherited

Reviewed-by: jjg
  • Loading branch information
pavelrappo committed Oct 10, 2022
1 parent 4df4a1f commit eb90c4f
Show file tree
Hide file tree
Showing 14 changed files with 320 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, 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
Expand Down Expand Up @@ -528,6 +528,10 @@ public abstract int send(ByteBuffer src, SocketAddress target)
*
* @throws NotYetConnectedException
* If this channel's socket is not connected
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract int read(ByteBuffer dst) throws IOException;

Expand All @@ -543,6 +547,10 @@ public abstract int send(ByteBuffer src, SocketAddress target)
*
* @throws NotYetConnectedException
* If this channel's socket is not connected
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract long read(ByteBuffer[] dsts, int offset, int length)
throws IOException;
Expand All @@ -559,6 +567,10 @@ public abstract long read(ByteBuffer[] dsts, int offset, int length)
*
* @throws NotYetConnectedException
* If this channel's socket is not connected
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public final long read(ByteBuffer[] dsts) throws IOException {
return read(dsts, 0, dsts.length);
Expand All @@ -574,6 +586,10 @@ public final long read(ByteBuffer[] dsts) throws IOException {
*
* @throws NotYetConnectedException
* If this channel's socket is not connected
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract int write(ByteBuffer src) throws IOException;

Expand All @@ -593,6 +609,10 @@ public final long read(ByteBuffer[] dsts) throws IOException {
*
* @throws NotYetConnectedException
* If this channel's socket is not connected
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract long write(ByteBuffer[] srcs, int offset, int length)
throws IOException;
Expand All @@ -613,6 +633,10 @@ public abstract long write(ByteBuffer[] srcs, int offset, int length)
*
* @throws NotYetConnectedException
* If this channel's socket is not connected
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public final long write(ByteBuffer[] srcs) throws IOException {
return write(srcs, 0, srcs.length);
Expand Down
24 changes: 24 additions & 0 deletions src/java.base/share/classes/java/nio/channels/FileChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ public static FileChannel open(Path path, OpenOption... options)
* then the file position is updated with the number of bytes actually
* read. Otherwise this method behaves exactly as specified in the {@link
* ReadableByteChannel} interface. </p>
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract int read(ByteBuffer dst) throws IOException;

Expand All @@ -383,6 +387,10 @@ public static FileChannel open(Path path, OpenOption... options)
* then the file position is updated with the number of bytes actually
* read. Otherwise this method behaves exactly as specified in the {@link
* ScatteringByteChannel} interface. </p>
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract long read(ByteBuffer[] dsts, int offset, int length)
throws IOException;
Expand All @@ -394,6 +402,10 @@ public abstract long read(ByteBuffer[] dsts, int offset, int length)
* then the file position is updated with the number of bytes actually
* read. Otherwise this method behaves exactly as specified in the {@link
* ScatteringByteChannel} interface. </p>
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public final long read(ByteBuffer[] dsts) throws IOException {
return read(dsts, 0, dsts.length);
Expand All @@ -412,6 +424,10 @@ public final long read(ByteBuffer[] dsts) throws IOException {
*
* @throws NonWritableChannelException
* If this channel was not opened for writing
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract int write(ByteBuffer src) throws IOException;

Expand All @@ -429,6 +445,10 @@ public final long read(ByteBuffer[] dsts) throws IOException {
*
* @throws NonWritableChannelException
* If this channel was not opened for writing
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract long write(ByteBuffer[] srcs, int offset, int length)
throws IOException;
Expand All @@ -446,6 +466,10 @@ public abstract long write(ByteBuffer[] srcs, int offset, int length)
*
* @throws NonWritableChannelException
* If this channel was not opened for writing
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public final long write(ByteBuffer[] srcs) throws IOException {
return write(srcs, 0, srcs.length);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2022, 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
Expand Down Expand Up @@ -60,6 +60,10 @@ public interface SeekableByteChannel
* then the position is updated with the number of bytes actually read.
* Otherwise this method behaves exactly as specified in the {@link
* ReadableByteChannel} interface.
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
@Override
int read(ByteBuffer dst) throws IOException;
Expand All @@ -75,6 +79,10 @@ public interface SeekableByteChannel
* written bytes, and then the position is updated with the number of bytes
* actually written. Otherwise this method behaves exactly as specified by
* the {@link WritableByteChannel} interface.
*
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
@Override
int write(ByteBuffer src) throws IOException;
Expand Down
20 changes: 19 additions & 1 deletion src/java.base/share/classes/java/nio/channels/SocketChannel.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, 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
Expand Down Expand Up @@ -603,19 +603,28 @@ public abstract <T> SocketChannel setOption(SocketOption<T> name, T value)
/**
* @throws NotYetConnectedException
* If this channel is not yet connected
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract int read(ByteBuffer dst) throws IOException;

/**
* @throws NotYetConnectedException
* If this channel is not yet connected
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract long read(ByteBuffer[] dsts, int offset, int length)
throws IOException;

/**
* @throws NotYetConnectedException
* If this channel is not yet connected
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public final long read(ByteBuffer[] dsts) throws IOException {
return read(dsts, 0, dsts.length);
Expand All @@ -624,19 +633,28 @@ public final long read(ByteBuffer[] dsts) throws IOException {
/**
* @throws NotYetConnectedException
* If this channel is not yet connected
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract int write(ByteBuffer src) throws IOException;

/**
* @throws NotYetConnectedException
* If this channel is not yet connected
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public abstract long write(ByteBuffer[] srcs, int offset, int length)
throws IOException;

/**
* @throws NotYetConnectedException
* If this channel is not yet connected
* @throws ClosedChannelException {@inheritDoc}
* @throws AsynchronousCloseException {@inheritDoc}
* @throws ClosedByInterruptException {@inheritDoc}
*/
public final long write(ByteBuffer[] srcs) throws IOException {
return write(srcs, 0, srcs.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ public final Object blockingLock() {
* mode then this method invokes the {@link #implConfigureBlocking
* implConfigureBlocking} method, while holding the appropriate locks, in
* order to change the mode. </p>
*
* @throws ClosedChannelException {@inheritDoc}
*/
public final SelectableChannel configureBlocking(boolean block)
throws IOException
Expand Down

1 comment on commit eb90c4f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.