From 0a5bc7f5a379b52cf5fe6bb9ea22f59fdec1fff0 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 30 Nov 2009 14:18:47 +0100 Subject: temporary workaround in BufferFactory.isDirect(). Changed behavior to return false with null as parameter to workaround buffer/array mixing bug. Should be revisited to improve performance. --- src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp | 4 ++-- src/java/com/sun/gluegen/runtime/BufferFactory.java.javase | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/java') diff --git a/src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp b/src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp index 5f32b0e..dacdd03 100755 --- a/src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp +++ b/src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp @@ -78,11 +78,11 @@ public class BufferFactory { } /** Helper routine to tell whether a buffer is direct or not. Null - pointers are considered direct. isDirect() should really be + pointers are considered NOT direct. isDirect() should really be public in Buffer and not replicated in all subclasses. */ public static boolean isDirect(Object buf) { if (buf == null) { - return true; + return false; } if (buf instanceof ByteBuffer) { return ((ByteBuffer) buf).isDirect(); diff --git a/src/java/com/sun/gluegen/runtime/BufferFactory.java.javase b/src/java/com/sun/gluegen/runtime/BufferFactory.java.javase index 472733f..1e660c1 100755 --- a/src/java/com/sun/gluegen/runtime/BufferFactory.java.javase +++ b/src/java/com/sun/gluegen/runtime/BufferFactory.java.javase @@ -77,11 +77,11 @@ public class BufferFactory { } /** Helper routine to tell whether a buffer is direct or not. Null - pointers are considered direct. isDirect() should really be + pointers are considered NOT direct. isDirect() should really be public in Buffer and not replicated in all subclasses. */ public static boolean isDirect(Object buf) { if (buf == null) { - return true; + return false; } if (buf instanceof ByteBuffer) { return ((ByteBuffer) buf).isDirect(); -- cgit v1.2.3