diff options
author | Roman Kennke <roman@kennke.org> | 2007-04-04 11:38:46 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2007-04-04 11:38:46 +0000 |
commit | 92450828067b29a757347c8f3d9c4e2d89a90205 (patch) | |
tree | bd78a7d6bc6a324c2a411de18acf2f40afb74e1b | |
parent | 1eea75f3fa48229c0505021d1453ef905042d4fa (diff) | |
download | classpath-92450828067b29a757347c8f3d9c4e2d89a90205.tar.gz |
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.
-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 |