ECJ and OpenJDK b26
Andrew John Hughes
gnu_andrew at member.fsf.org
Mon May 26 15:29:23 PDT 2008
On 26/05/2008, Joseph D. Darcy <Joe.Darcy at sun.com> wrote:
> In JDK 6, the behavior of @Override was expanded to include interface
> methods and not just superclass methods:
>
> http://blogs.sun.com/ahe/entry/override
>
> -Joe
>
>
> Andrew John Hughes wrote:
>
> > I came across a problem compiling
> javax.management.AttributeValueExp
> > from b26 with ECJ, due to the addition of the @Override annotation:
> >
> > # Running javac:
> > /usr/bin/ecj -1.5 -nowarn -sourcepath
> >
> /home/andrew/projects/openjdk/icedtea/generated:../../../src/solaris/classes:../../../src/share/classes
> > -bootclasspath
> /home/andrew/builder/icedtea/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar:/home/andrew/builder/icedtea/bootstrap/jdk1.7.0/jre/lib/tools.jar::/home/andrew/builder/icedtea/openjdk-ecj/build/linux-amd64/classes
> > -d
> /home/andrew/builder/icedtea/openjdk-ecj/build/linux-amd64/classes
> >
> @/home/andrew/builder/icedtea/openjdk-ecj/build/linux-amd64/tmp/sun/javax.management/.classes.list
> > ----------
> > 1. ERROR in
> ../../../src/share/classes/javax/management/AttributeValueExp.java
> > (at line 117)
> > public ValueExp apply(ObjectName name) throws
> > BadStringOperationException, BadBinaryOpValueExpException,
> > BadAttributeValueExpException, InvalidApplicationException {
> >
> >
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > The method apply(ObjectName) of type AttributeValueExp must override a
> > superclass method
> > ----------
> > 2. ERROR in
> ../../../src/share/classes/javax/management/AttributeValueExp.java
> > (at line 154)
> > public void setMBeanServer(MBeanServer s) {
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > The method setMBeanServer(MBeanServer) of type AttributeValueExp must
> > override a superclass method
> >
> > ecj seems to be applying @Override only to superclasses and not to
> > interfaces (these methods are specified in the interface
> > javax.management.ValueExp).
> >
> > Is this a bug in ECJ (3.3.0) or is javac overlooking this and
> > @Override should only be used with superclasses?
> >
>
>
Ah, ok then as I thought it's an issue with the compiler and/or
options being used.
I'll test with ecj and -source 1.6 and see if this works.
--
Andrew :-)
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 distro-pkg-dev
mailing list