<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi<br>
    <br>
    Do this:<br>
    <br>
    #ifdef JAVA6<br>
        public void createStruct(java.lang.String,java.lang.Object[]) {<br>
           ....real implementation....<br>
        }<br>
    #else<br>
       // 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<br>
        public void createStruct(java.lang.String,java.lang.Object[]) {<br>
          throw new UnsupportedOperationException();<br>
        }<br>
    #endif<br>
    <br>
    <br>
    Regards, Noel Grandin<br>
    <br>
    <div class="moz-cite-prefix">On 2012-07-12 13:28, Lionel Elie Mamane
      wrote:<br>
    </div>
    <blockquote cite="mid:20120712112833.GA28981@capsaicin.mamane.lu"
      type="cite">
      <pre wrap="">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
 <a class="moz-txt-link-freetext" href="http://cgit.freedesktop.org/libreoffice/core/commit/?id=69273cdd675b205b6f47e9aab2872901c03be578">http://cgit.freedesktop.org/libreoffice/core/commit/?id=69273cdd675b205b6f47e9aab2872901c03be578</a>

 This caused (among others) <a class="moz-txt-link-freetext" href="http://bugs.debian.org/675834">http://bugs.debian.org/675834</a>, 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?

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LibreOffice mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/libreoffice">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a>
</pre>
    </blockquote>
    <br>
    <br>
  <br><br><br><hr><font size="-2" color=808080>Disclaimer: <a href="http://www.peralex.com/disclaimer.html">http://www.peralex.com/disclaimer.html</a><br><br>

</body>
</html>