From 234819d531cdf20842cd0b3302935b187b2012d6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 1 Feb 2015 05:23:42 +0100 Subject: Minor Cleanup: Buffers: Remove !JAVA_6 branch; NativeLibrary: Reuse isOSX detection --- src/java/com/jogamp/common/nio/Buffers.java | 40 ++++++++++------------------- 1 file changed, 13 insertions(+), 27 deletions(-) (limited to 'src/java/com/jogamp/common/nio') diff --git a/src/java/com/jogamp/common/nio/Buffers.java b/src/java/com/jogamp/common/nio/Buffers.java index 8fff30e..aae2be8 100644 --- a/src/java/com/jogamp/common/nio/Buffers.java +++ b/src/java/com/jogamp/common/nio/Buffers.java @@ -39,9 +39,15 @@ */ package com.jogamp.common.nio; -import java.nio.*; - -import jogamp.common.os.PlatformPropsImpl; +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.CharBuffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.nio.ShortBuffer; import com.jogamp.common.util.ValueConv; @@ -445,30 +451,10 @@ public class Buffers { if (buf == null) { return true; } - if ( PlatformPropsImpl.JAVA_6 ) { - if (buf instanceof Buffer) { - return ((Buffer) buf).isDirect(); - } else if (buf instanceof PointerBuffer) { - return ((PointerBuffer) buf).isDirect(); - } - } else { - 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(); - } + if (buf instanceof Buffer) { + return ((Buffer) buf).isDirect(); + } else if (buf instanceof PointerBuffer) { + return ((PointerBuffer) buf).isDirect(); } throw new IllegalArgumentException("Unexpected buffer type " + buf.getClass().getName()); } -- cgit v1.2.3