ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: cannot resolve symbol when overriding method.
Date Tue, 08 Mar 2005 08:41:01 GMT
works for me.
but you should throw the IOException instead of Exception ... but that´s
another topic.

Jan

> -----Ursprüngliche Nachricht-----
> Von: Sébastien Annedouche [mailto:sannedouche@wanadoo.fr]
> Gesendet am: Montag, 7. März 2005 19:42
> An: user@ant.apache.org
> Betreff: cannot resolve symbol when overriding method.
> 
> 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 :
> 
>     /import java.io.ObjectInputStream;/
>     //
>     /// uncomment to make ant happy/
>     ////
>     ///import java.io.IOException;/
>     ///import java.io.StreamCorruptedException;/
>     //
>     /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>\Dummy.java:14: 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 ?
> 
> Thanks,
> 
> Sebastien
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message