Re: Classpath and Kaffe

2000-06-29 Thread Alexandre Oliva


On Jun 28, 2000, "Nic Ferrier" <[EMAIL PROTECTED]> wrote:

> I'm confused about TranV's position now... the Kaffe web site says
> that no code contributed to Kaffe will be used by TransV. I don't see
> why not... I certainly wouldn't have a problem with it - they're
> supporting the GPL and I applaud that and want to help.

They must be able to license the code to their customers under
different licenses.  Same issue with libgcj: Cygnus (now Red Hat) took
a different approach of requiring copyright assignments, just like
FSF, in order to integrate changes from network contributors.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicampoliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist*Please* write to mailing lists, not to me




Problem finding libraries (an attempt at OJI for Kaffe/Mozilla)...

2000-06-29 Thread James



This is probably a simple problem to solve, but I'm new to 
Kaffe.
 
I have the Kaffe JVM v1.0.5 running on Linux 2.2.15.  I 
have been tinkering with creating an OJI plugin for Mozilla (M16) that supports 
Kaffe.  To see some signs of life, I wrote a small stand alone program that 
takes an URL, instantiates the JVM, obtains an AppletViewer class and provides 
the URL to that class.  It works great, and displays the applet in a 
little popup window.
 
To get it to run on my machine however, I have to set the 
following environment variable:
 
export KAFFELIBRARYPATH=/usr/local/lib/kaffe
 
Even though the Kaffe documentation says I shouldn't have to 
change any environment variables, I had to set the above or it complained that 
it could not find 'libnative'.
 
Now, when I modified my stand alone executable to load as 
a plugin in Mozilla, I get an error stating that Kaffe can't open 'io' 
(it throws up a big list of exceptions, with the call to load the 'io' library 
being the cause) when I try and call JNI_CreateJavaVM().  I scanned my 
system and libio.so is placed in the /usr/local/lib/kaffe.  I added that 
path to my ld.so.conf and reran 'ldconfig'.  My stand alone program still 
works great; I can't figure out why it won't run within Mozilla.
 
Any ideas?  Is anyone else (or has anyone else) done any 
work on an OJI plugin for Kaffe?
 
Thanks,
James Ketrenos
[EMAIL PROTECTED]
 


Re: Kaffe serialVersionUID bug?

2000-06-29 Thread Stuart Ballard

Attaching a patch to fix all the serialVersionUIDs that were public. (I
think you need to be in libraries/javalib to apply it - sorry; my first
ever cvs diff)
Can anyone explain to me why some *interfaces* had serialVersionUIDs?
That doesn't make sense to me. My patch comments them out, although if
they really are incorrect they should be removed completely.

Anyway, I've done some debugging of the ObjectStreamClass issue, and it
turns out that Kaffe is accepting a serialVersionUID field defined in a
superclass as a serialVersionUID for a given class, even if that field
is private.

The code that's responsible for this is in
clib/native/ObjectStreamClassImpl.c starting at line 491 and looks like
this:

fld = lookupClassField(cls, serialVersionUIDName, true, &einfo);

if (fld != 0 /**/ && (fld->accflags & (ACC_STATIC|ACC_FINAL)) ==
(ACC_STATIC|ACC_FINAL)) {
return (*(jlong*)FIELD_ADDRESS((Field*)fld));
} else {
discardErrorInfo(&einfo);
}

I've inserted /**/ where I believe a fix could go - something like
&& fld->type == cls
sounds right to me although I don't know if == can be used to compare an
Hjava_lang_Class object. When I actually made this change I got a
NullPointer, which doesn't make much sense to me.

I think that lookupClassField might also have a problem, although I'm
not so sure on this one. A private field in a superclass should never be
accessible to subclasses - so why is lookupClassField returning one?
This doesn't eliminate the need for the first fix, because even if the
serialVersionUID of a superclass *is* accessible, it shouldn't be used.

If someone could take a look at these issues and see if my guesses are
right or completely screwy, I'd be very grateful.

Thanks,
Stuart.

Index: java/io/IOException.java
===
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/io/IOException.java,v
retrieving revision 1.3
diff -u -r1.3 IOException.java
--- java/io/IOException.java1999/10/12 02:29:46 1.3
+++ java/io/IOException.java2000/06/29 16:29:35
@@ -15,7 +15,7 @@
  extends Exception
 {
 
-public static final long serialVersionUID = 7818375828146090155l;
+private static final long serialVersionUID = 7818375828146090155l;
 
 public IOException () {
super();
Index: java/io/InvalidClassException.java
===
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/io/InvalidClassException.java,v
retrieving revision 1.4
diff -u -r1.4 InvalidClassException.java
--- java/io/InvalidClassException.java  2000/06/16 11:13:40 1.4
+++ java/io/InvalidClassException.java  2000/06/29 16:29:35
@@ -15,7 +15,7 @@
   extends ObjectStreamException
 {
 
-public static final long serialVersionUID = -416296251054416L;
+private static final long serialVersionUID = -416296251054416L;
 
 public String classname;
 
Index: java/io/Serializable.java
===
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/io/Serializable.java,v
retrieving revision 1.2
diff -u -r1.2 Serializable.java
--- java/io/Serializable.java   1999/03/24 01:14:44 1.2
+++ java/io/Serializable.java   2000/06/29 16:29:35
@@ -11,5 +11,6 @@
 package java.io;
 
 public interface Serializable {
-   static final long serialVersionUID = 1196656838076753133L;
+// I'm almost certain that interfaces can't have SVUIDs
+// static final long serialVersionUID = 1196656838076753133L;
 }
Index: java/lang/Exception.java
===
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/lang/Exception.java,v
retrieving revision 1.2
diff -u -r1.2 Exception.java
--- java/lang/Exception.java1999/10/12 02:29:47 1.2
+++ java/lang/Exception.java2000/06/29 16:29:35
@@ -14,7 +14,7 @@
extends Throwable
 {
 
-public static final long serialVersionUID = -3387516993124229948l;
+private static final long serialVersionUID = -3387516993124229948l;
 
 public Exception () {
super();
Index: java/lang/String.java
===
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/lang/String.java,v
retrieving revision 1.30
diff -u -r1.30 String.java
--- java/lang/String.java   2000/04/06 17:58:03 1.30
+++ java/lang/String.java   2000/06/29 16:29:36
@@ -38,7 +38,7 @@
int hash;
 
/* This is what Sun's JDK1.1 "serialver java.lang.String" spits out */
-   static final long serialVersionUID = -6849794470754667710L;
+   private static final long serialVersionUID = -6849794470754667710L;
 
public static final Comparator CASE_INSENSITIVE_ORDER = new ICComp();
 
Index: java/security/Key.java
===
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/security/Key.java,v
retrieving revisio

Re: i'm sending some code

2000-06-29 Thread Rizsanyi Zsolt



On Wed, 28 Jun 2000 13:16:55 -0700 (PDT)
Archie Cobbs <[EMAIL PROTECTED]> wrote:

> 
> Fixed.. thanks!
> 
> -Archie

Here is some more:

The method:

public synchronized void remove ( int index ) {
if (index >= 0 && index < items.size()) {
items.removeElementAt( index);
}
}

is missing from java.awt.Choice - Altough I have just looked in the
widgets directory and have not checked the win32 stuff

So this should be added to
libraries/javalib/java/awt/widgets/Choice.java
A don't know about:
libraries/javalib/java/awt/win32/Choice.java

Zsolt Rizsanyi <[EMAIL PROTECTED]>