From 9c1c6d49e11574d8afe351a8100872a645ccdd36 Mon Sep 17 00:00:00 2001 From: Xerxes Rånby Date: Fri, 18 Jan 2013 16:21:04 +0100 Subject: PlatformPropsImpl: JAVA_RUNTIME_NAME is null using GCJ gij JRE. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Xerxes Rånby --- src/java/jogamp/common/os/PlatformPropsImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/java/jogamp/common/os/PlatformPropsImpl.java b/src/java/jogamp/common/os/PlatformPropsImpl.java index 111523d..3010a31 100644 --- a/src/java/jogamp/common/os/PlatformPropsImpl.java +++ b/src/java/jogamp/common/os/PlatformPropsImpl.java @@ -90,8 +90,10 @@ public abstract class PlatformPropsImpl { } private static final boolean initIsJavaSE() { - if(JAVA_RUNTIME_NAME.indexOf("Java SE") != -1) { - return true; + if(JAVA_RUNTIME_NAME!=null) { + if(JAVA_RUNTIME_NAME.indexOf("Java SE") != -1) { + return true; + } } // probe for classes we need on a SE environment -- cgit v1.2.3 From 2b7d1b1d25cb2cd73311ec9159b465f0391bf5e0 Mon Sep 17 00:00:00 2001 From: Xerxes Rånby Date: Fri, 18 Jan 2013 16:25:59 +0100 Subject: Buffer.isDirect() operation is undefined w/ Eclipse ecj and GCJ gij JRE. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for the runtime error using GCJ gij JRE: java.lang.NoSuchMethodError: method java.nio.Buffer.isDirect with signature ()Z was not found. at com.jogamp.common.nio.Buffers.isDirect(Buffers.java:363) Also Eclipse ecj refuses to compile code using java.nio.Buffer.isDirect(). ---------- 1. ERROR ... return ((Buffer) buf).isDirect(); ^^^^^^^^ The method isDirect() is undefined for the type Buffer Signed-off-by: Xerxes Rånby --- src/java/com/jogamp/common/nio/Buffers.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/java/com/jogamp/common/nio/Buffers.java b/src/java/com/jogamp/common/nio/Buffers.java index 3da1261..9090433 100755 --- a/src/java/com/jogamp/common/nio/Buffers.java +++ b/src/java/com/jogamp/common/nio/Buffers.java @@ -359,11 +359,25 @@ public class Buffers { if (buf == null) { return true; } - if (buf instanceof Buffer) { - return ((Buffer) buf).isDirect(); + if (buf instanceof ByteBuffer) { + return ((ByteBuffer) buf).isDirect(); + } else if (buf instanceof IntBuffer) { + return ((IntBuffer) buf).isDirect(); + } else if (buf instanceof ShortBuffer) { + return ((ShortBuffer) buf).isDirect(); + } else if (buf instanceof FloatBuffer) { + return ((FloatBuffer) buf).isDirect(); + } else if (buf instanceof DoubleBuffer) { + return ((DoubleBuffer) buf).isDirect(); + } else if (buf instanceof LongBuffer) { + return ((LongBuffer) buf).isDirect(); + } else if (buf instanceof CharBuffer) { + return ((CharBuffer) buf).isDirect(); } else if (buf instanceof PointerBuffer) { return ((PointerBuffer) buf).isDirect(); - } + } else if (buf instanceof Buffer) { + throw new IllegalArgumentException("Unexpected buffer type Buffer.isDirect() operation is undefined"); + } throw new IllegalArgumentException("Unexpected buffer type " + buf.getClass().getName()); } -- cgit v1.2.3