This fixes the problem in gjavah with the constants of
superclasses not being emitted in JNI headers.  The writeFields
method searches all classes for fields, but in reality will never
search more than the class for which the header has been generated,
as linkSupers() is never called.

ChangeLog:

2009-03-26  Andrew John Hughes  <ahug...@redhat.com>

        * tools/gnu/classpath/tools/javah/ClassWrapper.java:
        (linkSupers()): Make package-private.
        * tools/gnu/classpath/tools/javah/JniIncludePrinter.java:
        (writeFields(ClassWrapper, JniPrintStream)):
        Link in data from superclass before searching for fields.

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: tools/gnu/classpath/tools/javah/ClassWrapper.java
===================================================================
RCS file: 
/sources/classpath/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java,v
retrieving revision 1.5
diff -u -u -r1.5 ClassWrapper.java
--- tools/gnu/classpath/tools/javah/ClassWrapper.java   20 Mar 2009 13:03:48 
-0000      1.5
+++ tools/gnu/classpath/tools/javah/ClassWrapper.java   25 Mar 2009 12:18:43 
-0000
@@ -104,7 +104,7 @@
     return false;
   }
 
-  private void linkSupers() throws IOException
+  void linkSupers() throws IOException
   {
     if (superName == null)
       {
Index: tools/gnu/classpath/tools/javah/JniIncludePrinter.java
===================================================================
RCS file: 
/sources/classpath/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java,v
retrieving revision 1.9
diff -u -u -r1.9 JniIncludePrinter.java
--- tools/gnu/classpath/tools/javah/JniIncludePrinter.java      20 Mar 2009 
13:03:48 -0000      1.9
+++ tools/gnu/classpath/tools/javah/JniIncludePrinter.java      25 Mar 2009 
12:18:43 -0000
@@ -59,7 +59,9 @@
   }
 
   private void writeFields(ClassWrapper klass, JniPrintStream out)
+    throws IOException
   {
+    klass.linkSupers();
     boolean wroteAny = false;
     for (; klass != null; klass = klass.superClass)
       {

Reply via email to