Nirmal Fernando <[email protected]> writes:
> Hi All,
>
> Is there away to use "enums" in Derby, I mean is it possible to say
> Ant to avoid using Java 1.4 for compiling classes where enums are
> used, and use Java 1.5 instead?
Hi Nirmal,
It is possible. See for example
java/testing/org/apache/derbyTesting/functionTests/util/build.xml and
java/engine/org/apache/derby/impl/services/build.xml which contain javac
targets with source and target level set to 1.5:
<javac
source="1.5"
target="1.5"
...
The classes that are compiled this way can only be used on a Java 1.5 or
higher VM, so this technique cannot be used in core functionality unless
an alternative implementation that works on Java 1.4 is provided. For
example, we have a lock manager implementation that depends on
java.util.concurrent.ConcurrentHashMap for performance reasons, but
since ConcurrentHashMap is only available on Java 1.5 and higher, we use
another implementation that's based on java.util.HashMap on older
platforms.
--
Knut Anders