summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/nio
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/nio')
-rw-r--r--libjava/classpath/java/nio/ByteOrder.java4
-rw-r--r--libjava/classpath/java/nio/channels/spi/SelectorProvider.java27
-rw-r--r--libjava/classpath/java/nio/class-dependencies.conf58
3 files changed, 30 insertions, 59 deletions
diff --git a/libjava/classpath/java/nio/ByteOrder.java b/libjava/classpath/java/nio/ByteOrder.java
index 39a3ff893bd..0e3b9173eb6 100644
--- a/libjava/classpath/java/nio/ByteOrder.java
+++ b/libjava/classpath/java/nio/ByteOrder.java
@@ -61,7 +61,9 @@ public final class ByteOrder
*/
public static ByteOrder nativeOrder()
{
- return (System.getProperty ("gnu.cpu.endian").equals("big")
+ // Let this fail with an NPE when the property is not set correctly.
+ // Otherwise we risk that NIO is silently working wrong.
+ return (System.getProperty("gnu.cpu.endian").equals("big")
? BIG_ENDIAN : LITTLE_ENDIAN);
}
diff --git a/libjava/classpath/java/nio/channels/spi/SelectorProvider.java b/libjava/classpath/java/nio/channels/spi/SelectorProvider.java
index db4e65fe14e..b2fb7bb9c81 100644
--- a/libjava/classpath/java/nio/channels/spi/SelectorProvider.java
+++ b/libjava/classpath/java/nio/channels/spi/SelectorProvider.java
@@ -40,6 +40,7 @@ package java.nio.channels.spi;
import gnu.java.nio.SelectorProviderImpl;
import java.io.IOException;
+import java.nio.channels.Channel;
import java.nio.channels.DatagramChannel;
import java.nio.channels.Pipe;
import java.nio.channels.ServerSocketChannel;
@@ -115,6 +116,32 @@ public abstract class SelectorProvider
public abstract SocketChannel openSocketChannel() throws IOException;
/**
+ * Returns the inherited channel of the VM.
+ *
+ * @return the inherited channel of the VM
+ *
+ * @throws IOException If an I/O error occurs
+ * @throws SecurityException If an installed security manager denies access
+ * to RuntimePermission("inheritedChannel")
+ *
+ * @since 1.5
+ */
+ 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
* of the Java virtual machine.
*
diff --git a/libjava/classpath/java/nio/class-dependencies.conf b/libjava/classpath/java/nio/class-dependencies.conf
deleted file mode 100644
index 4fbf75eb1ce..00000000000
--- a/libjava/classpath/java/nio/class-dependencies.conf
+++ /dev/null
@@ -1,58 +0,0 @@
-# This property file contains dependencies of classes, methods, and
-# field on other methods or classes.
-#
-# Syntax:
-#
-# <used>: <needed 1> [... <needed N>]
-#
-# means that when <used> is included, <needed 1> (... <needed N>) must
-# be included as well.
-#
-# <needed X> and <used> are of the form
-#
-# <class.methodOrField(signature)>
-#
-# or just
-#
-# <class>
-#
-# Within dependencies, variables can be used. A variable is defined as
-# follows:
-#
-# {variable}: value1 value2 ... value<n>
-#
-# variables can be used on the right side of dependencies as follows:
-#
-# <used>: com.bla.blu.{variable}.Class.m()V
-#
-# The use of the variable will expand to <n> dependencies of the form
-#
-# <used>: com.bla.blu.value1.Class.m()V
-# <used>: com.bla.blu.value2.Class.m()V
-# ...
-# <used>: com.bla.blu.value<n>.Class.m()V
-#
-# Variables can be redefined when building a system to select the
-# required support for features like encodings, protocols, etc.
-#
-# Hints:
-#
-# - For methods and fields, the signature is mandatory. For
-# specification, please see the Java Virtual Machine Specification by
-# SUN. Unlike in the spec, field signatures (types) are in brackets.
-#
-# - Package names must be separated by '/' (and not '.'). E.g.,
-# java/lang/Class (this is necessary, because the '.' is used to
-# separate method or field names from classes)
-#
-# - In case <needed> refers to a class, only the class itself will be
-# included in the resulting binary, NOT necessarily all its methods
-# and fields. If you want to refer to all methods and fields, you can
-# write class.* as an abbreviation.
-#
-# - Abbreviations for packages are also possible: my/package/* means all
-# methods and fields of all classes in my/package.
-#
-# - A line with a trailing '\' continues in the next line.
-
-# end of file
OpenPOWER on IntegriCloud