diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gnu/java/nio/SelectorProviderImpl.java | 9 | ||||
-rw-r--r-- | java/nio/channels/spi/SelectorProvider.java | 15 |
3 files changed, 22 insertions, 10 deletions
@@ -1,5 +1,13 @@ 2007-04-04 Roman Kennke <roman@kennke.org> + * 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 <roman@kennke.org> + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c (init_glib_threads): Create global reference on lock object. 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 |