Summary
Specify the default implementation of the non-abstract SelectorProvider::inheritedChannel
method.
Problem
The non-abstract java.nio.channels.spi.SelectorProvider::inheritedChannel
method does not specify its default implementation, thus requiring all implementers to provide their own implementation - even if that implementation is the same as the default. The current, and longstanding, behaviour is to return null
.
Solution
Specify the default implementation returns null
.
Specification
diff --git a/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java b/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java
index 4aee1cf41c8..87ada1a15b2 100644
--- a/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java
+++ b/src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java
@@ -292,24 +292,27 @@ public abstract class SelectorProvider {
* returned. Subsequent invocations of this method return the same
* channel. </p>
*
+ * @implSpec The default implementation of this method returns
+ * {@code null}.
+ *
* @return The inherited channel, if any, otherwise {@code null}.
*
* @throws IOException
* If an I/O error occurs
*
* @throws SecurityException
* If a security manager has been installed and it denies
* {@link RuntimePermission}{@code ("inheritedChannel")}
*
* @since 1.5
*/
public Channel inheritedChannel() throws IOException {
return null;
}
- csr of
-
JDK-8254692 (se) Clarify the behaviour of the non-abstract SelectorProvider::inheritedChannel
-
- Resolved
-