Hi,

Apparently some parts of Eclipse 3 do try to use the new io file locks
even when told not to. If the acquiring of the lock throws an
IOException (as in GNU Classpath) everything works regardless. This
patch makees the Kaffe library implementation behave the same as the GNU
Classpath one:

2004-11-14  Mark Wielaard  <[EMAIL PROTECTED]>

        libraries/clib/nio/FileChannelImpl.c
        (Java_gnu_java_nio_channels_FileChannelImpl_lock):
        Throw IOException.
        (Java_gnu_java_nio_channels_FileChannelImpl_unlock):
        Likewise.

With this and the other patches I sent you can start playing with
Eclipse 3. It doesn't work flawlessly yet though. Importing GNU
Classpath from CVS for example works, but as soon as you start to edit
or compile anything it breaks down. Clear error messages are thrown on
the console though, so I hope someone finds that helpful to create
further fixes.

Cheers,

Mark

P.S You want to get eclipse-SDK-3.0.1-linux-gtk.zip from
http://download.eclipse.org/ and xalan-j_2_6_0 from
http://www.apache.org/dist/xml/xalan-j/
Unpack them both (for example in /tmp) and then run:
LD_LIBRARY_PATH=plugins/org.eclipse.core.resources.linux_3.0.0/os/linux/x86:plugins/org.eclipse.swt.gtk_3.0.1/os/linux/x86
 PATH=.:/usr/local/kaffe/bin:$PATH ./eclipse -vm kaffe -debug -consoleLog 
-vmargs -ms512M -mx512M   
-Xbootclasspath/p:/tmp/xalan-j_2_6_0/bin/xercesImpl.jar:/tmp/xalan-j_2_6_0/bin/xalan.jar:/tmp/xalan-j_2_6_0/bin/xml-apis.jar
   -Dosgi.locking=none
Index: libraries/clib/nio/FileChannelImpl.c
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/clib/nio/FileChannelImpl.c,v
retrieving revision 1.7
diff -u -r1.7 FileChannelImpl.c
--- libraries/clib/nio/FileChannelImpl.c	21 Sep 2004 20:22:25 -0000	1.7
+++ libraries/clib/nio/FileChannelImpl.c	14 Nov 2004 12:08:30 -0000
@@ -491,7 +491,7 @@
 						jlong size UNUSED, jboolean shared UNUSED, 
 						jboolean wait_lock UNUSED)
 {
-  (*env)->ThrowNew(env, (*env)->FindClass(env, "java.lang.UnsupportedOperationException"), "gnu.java.nio.channels.FileChannelImpl.lock");
+  (*env)->ThrowNew(env, (*env)->FindClass(env, "java.io.IOException"), "java.nio.FileChannelImpl.lock(): not implemented");
   return false;
 }
 
@@ -499,7 +499,7 @@
 Java_gnu_java_nio_channels_FileChannelImpl_unlock(JNIEnv *env UNUSED, jobject filechannel UNUSED, jlong position UNUSED,
 						  jlong size UNUSED)
 {
-  (*env)->ThrowNew(env, (*env)->FindClass(env, "java.lang.UnsupportedOperationException"), "gnu.java.nio.channels.FileChannelImpl.lock");
+  (*env)->ThrowNew(env, (*env)->FindClass(env, "java.io.IOException"), "java.nio.FileChannelImpl.unlock(): not implemented");
 }
 
 /*

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to