changeset 2629:8f185d6f0164

PR1741: Make PulseAudio code compliant to the JNI specification. 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 e94cd8db46cd
children e5d122ba61c0
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 Jun 20 14:14:56 2011 -0400
+++ 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-06-20  Denis Lila  <dlila@redhat.com>
 
 	* pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c
--- a/pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c	Mon Jun 20 14:14:56 2011 -0400
+++ b/pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c	Mon Oct 03 16:35:35 2011 +0200
@@ -898,7 +898,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");