RFC: Only enable NIO2 by default when building with IcedTea

Mark Wielaard mark at klomp.org
Tue Feb 10 11:47:33 PST 2009


Hi Andrew,

On Tue, 2009-02-10 at 19:07 +0000, Andrew John Hughes wrote:
> It appears that some older versions of ecj fail when building the 
> NIO2 code:
> 
> 1. ERROR in ../../../src/share/classes/org/classpath/icedtea/java/nio/file/spi/AbstractPath.java (at line 276)
>    public final WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events)
>         throws IOException
> 	                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Name clash: The method register(WatchService, WatchEvent.Kind<?>...) of type AbstractPath has the same erasure as register(WatchService, WatchEvent.Kind<?>...) of type Watchable but does not override it
> ----------

I can confirm this bug against Eclipse Java Compiler 0.793_R33x, 3.3.2.

> The attached patch sets the NIO2 default based on whether with_icedtea is enabled.  So this works,
> and to be consistent with the rest of the autotools macro, it switches the values used from true/false
> to yes/no.
> 
> Okay to commit?
> 
> ChangeLog:
> 
> 2009-02-10  Andrew John Hughes  <ahughes at redhat.com>
> 
> 	* Makefile.am:
> 	Only build NIO2 by default if building with
> 	IcedTea.  Fix with_icedtea/with_openjdk to use
> 	yes/no rather than true/false.

The attached patch is for configure.ac, not for Makefile.am.
I am slightly confused by why this works.
Are you counting on the fact that if --with-icedtea is given the
provided javac will not be based on ecj and so not have the bug?
Wouldn't it be more correct to disable nio2 by default and/or add a
compiler configure check to see if these kind of constructs can be
compiled?

Cheers,

Mark




More information about the distro-pkg-dev mailing list