changeset 2521:2320b8653252

2011-10-03 Xerxes Ranby <xerxes@zafena.se> Robert Lougher <rob@jamvm.org.uk> * pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1buffer_1attr): Make code compliant to the JNI specification. Enable pulseaudio to work in combination with JVM that strictly implement JNI spec. The code is not compliant to the JNI specification. FindClass takes a fully-qualified classname : http://download.oracle.com/javase/6/docs/technotes/guides/jni/spec/functions.html name: a fully-qualified class name (that is, a package name, delimited by ?/?, followed by the class name). If the name begins with ?[? (the array signature character), it returns an array class. The string is encoded in modified UTF-8. The code above is giving a type signature (qualified name inside 'L' and ';'). HotSpot is obviously allowing this. But this not correct according to the specification. Rob.
author Xerxes Ranby <xerxes@zafena.se>
date Mon, 03 Oct 2011 16:35:35 +0200
parents fdc7cb8dc1a1
children 5f0d96a60071
files ChangeLog pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 03 13:07:54 2011 +0200
+++ b/ChangeLog	Mon Oct 03 16:35:35 2011 +0200
@@ -1,3 +1,12 @@
+2011-10-03  Xerxes Rånby  <xerxes@zafena.se>
+	    Robert Lougher <rob@jamvm.org.uk>
+
+	* pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c
+	  (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1buffer_1attr):
+	  Make code compliant to the JNI specification.
+	  Enable pulseaudio to work in combination with JVM that strictly
+	  implement JNI spec.
+
 2011-10-03  Xerxes Rånby  <xerxes@zafena.se>
 	    David Henningsson <david.henningsson@canonical.com>
 	    Matthias Klose <doko@ubuntu.com>
--- a/pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c	Mon Oct 03 13:07:54 2011 +0200
+++ b/pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c	Mon Oct 03 16:35:35 2011 +0200
@@ -895,7 +895,7 @@
     const pa_buffer_attr* buffer = pa_stream_get_buffer_attr(stream);
     assert(buffer);
 
-    const char* class_name = "Lorg/classpath/icedtea/pulseaudio/StreamBufferAttributes;";
+    const char* class_name = "org/classpath/icedtea/pulseaudio/StreamBufferAttributes";
     jclass cls = (*env)->FindClass(env, class_name);
     assert(cls);
     jmethodID constructor_mid = (*env)->GetMethodID(env, cls, "<init>", "(IIIII)V");