# HG changeset patch # User Xerxes Ranby # Date 1317652535 -7200 # Node ID 8f185d6f0164fa13986f30e950f1c77cdb3279dc # Parent e94cd8db46cdd441dc24c95f96b8cc04c7399e41 PR1741: Make PulseAudio code compliant to the JNI specification. 2011-10-03 Xerxes Ranby Robert Lougher * 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. diff -r e94cd8db46cd -r 8f185d6f0164 ChangeLog --- 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 + Robert Lougher + + * 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 * pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c diff -r e94cd8db46cd -r 8f185d6f0164 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, "", "(IIIII)V");