--with-java-target-version does not work properly in hsqldb

Lionel Elie Mamane lionel at mamane.lu
Thu Jul 12 04:28:33 PDT 2012


Hi,

Context:
 Our Java7-support patch for hsqldb was a bit broken and enabled code
 that was supposed to be Java7-only also on Java 1.6. I fixed that in
 http://cgit.freedesktop.org/libreoffice/core/commit/?id=69273cdd675b205b6f47e9aab2872901c03be578

 This caused (among others) http://bugs.debian.org/675834, and my
 being unable to run embedded HSQL with gcj (when it was compiled with
 OpenJDK 1.6).


Point of this email:

While doing that, I noticed that our
 ./configure --with-java-target-version=XXX
was (at least partially) overridden internally by HSQL's own "detect
what Java version I'm being compiled by". So I prepared the attached
patch (which depends on my above commit).

But alas, it breaks "--with-java-target-version=1.5" when compiling
with OpenJDK 1.6:

    [javac] /home/master/src/libreoffice/core/hsqldb/unxlngx6/misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java:428: org.hsqldb.jdbc.jdbcConnection is not abstract and does not override abstract method createStruct(java.lang.String,java.lang.Object[]) in java.sql.Connection
    [javac] public class jdbcConnection implements Connection {
    [javac]        ^

That's because the method "createStruct" is in "#ifdef JAVA6".

OTOH, in the current situation, I predict that compiling with Java7 and
--with-java-target-version=1.5 will make .class files that CANNOT be
run under older Java, because that older Java will not have
SQLFeatureNotSupportedException (same problem as with GCJ).

So... We cannot hold the promise we give:

        [Generate class files that will work on JVMs with the
	specified version.
         For example, use --with-java-target-version=1.4 to make sure
	 that the
         application will work with JVM 1.4 even when compiled with
	 JDK 1.5.])

Or someone has a miracle solution?

-- 
Lionel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FOO
Type: text/x-diff
Size: 1155 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120712/7bcd6946/attachment.diff>


More information about the LibreOffice mailing list