qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qexo-general] Kawa configuration


From: Per Bothner
Subject: [Qexo-general] Kawa configuration
Date: Thu, 14 Apr 2005 11:31:19 -0700
User-agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324)

As GCJ 4.0 is about to be released, I'm testing it with Kawa.
Right now, Kawa can be configured for differnt Java versions:
"Java 1" - jdk 1.1
"Java 2" - jdk 1.2 and up; default
"Java 5" - jdk 1.5
However, GCJ 4.0 has a number of 1.4 enhancements, plus it has JAXP 1.3,
which is incompatible with JAXP 1.2.  So I'm thinking of adding:
"Java 4" - jdk 1.4
"Java 4x" - jdk 1.4 w/jaxp 1.3; gcj 4.0

"Java 4" adds support for Throwable.initCause, and CharSequence.
The former is nice to have, as it makes stack traces more informative.

Are there any other Java variants/combinations that are useful?

I'm also considering "autoconfiguration" - if you don't specificy
--with-java-version, the configure script will try to figure it out.
That may be necessary, considering that the default sources won't
build on Java5.

Perhaps a cleaner solution to the JAXP 1.2 vs 1.3 incompatibility is
to use factory methods:

abstract class KNode {
  // does *not* implement org.w3c.dom.Node
}
class KElement extends KNode {
  // Leave out DOM methods
}

// Only compiled if JAXP 1.2 / DOM2 is available
class KElement2 extends KElement
  implements implement org.w3c.dom.Element
{
  add DOM2 methods
}

// Only compiled if JAXP 1.3 / DOM3 is available
class KElement3 extends KElement
  implements implement org.w3c.dom.Element
{
  add DOM3 methods
}

Then at run-time, a factory method like KNode.make
can create either a KElement2, a KElement3, or a plain KElement,
depending on what's available.  The test for what's available
can be done once, in a static initializer, so it's cheap.

On the other hand, fixing this may not be worth the hassle.
And if we do go down this road, ideally we should change all the
--with-java-source magic so it selects *which* Java files to
compile, but doesn't do any pre-processing of individual files.
--
        --Per Bothner
address@hidden   http://per.bothner.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]