Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi

Do this:

#ifdef JAVA6
    public void createStruct(java.lang.String,java.lang.Object[]) {
       ....real implementation....
    }
#else
// only here for the odd situation that we are compiling --with-java-target-version=1.5 but the actual JDK we are using is > 1.5
    public void createStruct(java.lang.String,java.lang.Object[]) {
      throw new UnsupportedOperationException();
    }
#endif


Regards, Noel Grandin

On 2012-07-12 13:28, Lionel Elie Mamane wrote:
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?



_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice



Disclaimer: http://www.peralex.com/disclaimer.html



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.