From 92450828067b29a757347c8f3d9c4e2d89a90205 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Wed, 4 Apr 2007 11:38:46 +0000 Subject: 2007-04-04 Roman Kennke * java/nio/channels/spi/SelectorProvider.java (inheritedChannel): Make method concrete and move default impl to here. Perform security checks as mandated by the spec. * gnu/java/nio/SelectorProviderImpl.java (inheritedChannel): Removed. Default impl is in SelectorProvider. --- ChangeLog | 8 ++++++++ gnu/java/nio/SelectorProviderImpl.java | 9 --------- java/nio/channels/spi/SelectorProvider.java | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 632c26c7b..f76bca4b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-04-04 Roman Kennke + + * java/nio/channels/spi/SelectorProvider.java + (inheritedChannel): Make method concrete and move default impl + to here. Perform security checks as mandated by the spec. + * gnu/java/nio/SelectorProviderImpl.java + (inheritedChannel): Removed. Default impl is in SelectorProvider. + 2007-04-04 Roman Kennke * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c diff --git a/gnu/java/nio/SelectorProviderImpl.java b/gnu/java/nio/SelectorProviderImpl.java index d50d0ee61..0c509b985 100644 --- a/gnu/java/nio/SelectorProviderImpl.java +++ b/gnu/java/nio/SelectorProviderImpl.java @@ -41,7 +41,6 @@ package gnu.java.nio; import gnu.classpath.SystemProperties; import java.io.IOException; -import java.nio.channels.Channel; import java.nio.channels.DatagramChannel; import java.nio.channels.Pipe; import java.nio.channels.ServerSocketChannel; @@ -119,12 +118,4 @@ public class SelectorProviderImpl extends SelectorProvider return new SocketChannelImpl (this); } - public Channel inheritedChannel() throws IOException - { - // Implementation note: The default implementation can't do much more - // than return null. If a VM can provide something more useful it should - // install its own SelectorProvider (maybe a subclass of this one) to - // return something more useful. - return null; - } } diff --git a/java/nio/channels/spi/SelectorProvider.java b/java/nio/channels/spi/SelectorProvider.java index bae006492..b2fb7bb9c 100644 --- a/java/nio/channels/spi/SelectorProvider.java +++ b/java/nio/channels/spi/SelectorProvider.java @@ -126,7 +126,20 @@ public abstract class SelectorProvider * * @since 1.5 */ - public abstract Channel inheritedChannel() throws IOException; + public Channel inheritedChannel() + throws IOException + { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + { + sm.checkPermission(new RuntimePermission("inheritedChannel")); + } + // Implementation note: The default implementation can't do much more + // than return null. If a VM can provide something more useful it should + // install its own SelectorProvider (maybe a subclass of this one) to + // return something more useful. + return null; + } /** * Returns the system-wide default selector provider for this invocation -- cgit v1.2.1