ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Annedouche <>
Subject cannot resolve symbol when overriding method.
Date Mon, 07 Mar 2005 18:42:06 GMT
Hi all,

I'm new to Ant and I've found something I can't understand while trying 
to compile one of my projects.

Take a look at the following Dummy class. It has a silly method 'foo' 
which returns an instance of an anonymous class extending 
ObjectInputStream and overriding one of its protected methods :

    /// uncomment to make ant happy/
    /public class Dummy {/
    /  public Dummy() {/
    /  }/
    /  protected Object foo() throws Exception {/
    /    return new ObjectInputStream(null) {/
    /      protected void readStreamHeader() {/
    /      }/
    /    };/
    /  }/

I've got the following error :

    [javac] <path>\ cannot resolve symbol
    [javac] symbol: class IOException 
    [javac]       protected void readStreamHeader() {

If I uncomment the imports quoted "uncomment to make ant happy", it works.

This class doesn't compile if the 2 exceptions thrown by the overriden 
method are not imported in the class file.

Isn't it an ant bug ? Is there anything to do to prevent ant from 
failing with such a code ?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message