summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2007-04-03 20:58:23 +0000
committerRoman Kennke <roman@kennke.org>2007-04-03 20:58:23 +0000
commit0198fbda626fcb4dbe64299c4c15901088be6f53 (patch)
treebc0a3d19deb4bc22e85fde684e3e102463aa9a07
parent2e4fdf77fafe62e423f48bf17eade890925f12ef (diff)
downloadclasspath-0198fbda626fcb4dbe64299c4c15901088be6f53.tar.gz
2007-04-03 Roman Kennke <roman@kennke.org>
* java/nio/ByteOrder.java (nativeByteOrder): Let this fail when the corresponding property is not set properly.
-rw-r--r--ChangeLog6
-rw-r--r--java/nio/ByteOrder.java4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3bf829d48..a4dce4384 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2007-04-03 Roman Kennke <roman@kennke.org>
+ * java/nio/ByteOrder.java
+ (nativeByteOrder): Let this fail when the corresponding
+ property is not set properly.
+
+2007-04-03 Roman Kennke <roman@kennke.org>
+
* javax/swing/plaf/basic/BasicTreeUI.java
(getPathBounds): Consider the tree's insets. Added a bunch of
null checks.
diff --git a/java/nio/ByteOrder.java b/java/nio/ByteOrder.java
index 77cd64db0..0e3b9173e 100644
--- a/java/nio/ByteOrder.java
+++ b/java/nio/ByteOrder.java
@@ -61,7 +61,9 @@ public final class ByteOrder
*/
public static ByteOrder nativeOrder()
{
- return ("big".equals(System.getProperty("gnu.cpu.endian"))
+ // 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);
}