-Werror in make/java/sun_nio/Makefile

Andrew John Hughes gnu_andrew at member.fsf.org
Thu Jan 28 14:46:50 PST 2010


I decided to do a build with JAVAC_MAX_WARNINGS=true just to see the
lay of the land, and it seems that this causes the sun_nio build to
bail out.  The Makefile adds -Werror itself locally:

OTHER_JAVACFLAGS += -Xlint:serial -Werror

which works fine with the default settings but causes to build to fail
when -Xlint:all is added:

/usr/lib/jvm/icedtea6/bin/java -XX:-PrintVMOptions
-XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx896m -Xms128m
-XX:PermSize=32m -XX:MaxPermSize=160m
-Xbootclasspath/p:/mnt/builder/icedtea/langtools/dist/bootstrap/lib/javac.jar
-jar /mnt/builder/icedtea/langtools/dist/bootstrap/lib/javac.jar
-Xlint:all -source 7 -target 7 -encoding ascii
-Xbootclasspath:/mnt/builder/icedtea/classes -Xlint:serial -Werror
-sourcepath /mnt/builder/icedtea/gensrc:../../../src/solaris/classes:../../../src/share/classes
-d /mnt/builder/icedtea/classes
@/mnt/builder/icedtea/tmp/sun/sun.nio/.classes.list.filtered

There is a similar flag for -Werror (JAVAC_WARNINGS_FATAL) and this
should be used when -Werror builds are required.

The warnings that cause the build to fail are all to do with
deprecated code e.g.:

../../../src/share/classes/sun/io/ByteToCharASCII.java:33: warning:
[deprecation] ByteToCharConverter in sun.io has been deprecated
public class ByteToCharASCII extends ByteToCharConverter {
                                     ^
../../../src/share/classes/sun/io/ByteToCharASCII.java:52: warning:
[deprecation] ConversionBufferFullException in sun.io has been
deprecated
        throws ConversionBufferFullException, UnknownCharacterException

We hit the 100 warning limit so I don't know how many there are in total.

It seems that ByteToCharConverter was marked as deprecated with the
intention of removing it in JDK6:

 * @deprecated Replaced by {@link java.nio.charset}.  THIS API WILL BE
 * REMOVED IN J2SE 1.6.

This still being present in OpenJDK7 suggests that never happened.

I'd suggest we either drop the local -Werror or add -deprecation after
serial to make the build with maximum warnings complete.  Long term,
we can look at getting rid of that code if appropriate, though I doubt
we'll ever be able to do a build with the deprecation warning and
-Werror on simply because of legacy code.
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


More information about the nio-dev mailing list