From 0198fbda626fcb4dbe64299c4c15901088be6f53 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Tue, 3 Apr 2007 20:58:23 +0000 Subject: 2007-04-03 Roman Kennke * java/nio/ByteOrder.java (nativeByteOrder): Let this fail when the corresponding property is not set properly. --- ChangeLog | 6 ++++++ java/nio/ByteOrder.java | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3bf829d48..a4dce4384 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-03 Roman Kennke + + * java/nio/ByteOrder.java + (nativeByteOrder): Let this fail when the corresponding + property is not set properly. + 2007-04-03 Roman Kennke * javax/swing/plaf/basic/BasicTreeUI.java 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); } -- cgit v1.2.1