Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 36250 invoked from network); 7 Mar 2005 18:42:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Mar 2005 18:42:12 -0000 Received: (qmail 92199 invoked by uid 500); 7 Mar 2005 18:42:07 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 92159 invoked by uid 500); 7 Mar 2005 18:42:07 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 92140 invoked by uid 99); 7 Mar 2005 18:42:07 -0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from smtp10.wanadoo.fr (HELO smtp10.wanadoo.fr) (193.252.22.21) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 07 Mar 2005 10:42:06 -0800 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1007.wanadoo.fr (SMTP Server) with ESMTP id 93952280014B for ; Mon, 7 Mar 2005 19:42:03 +0100 (CET) Received: from [192.168.0.8] (Laubervilliers-151_11-15-237.w82-127.abo.wanadoo.fr [82.127.51.237]) by mwinf1007.wanadoo.fr (SMTP Server) with ESMTP id 5C4FC2800149 for ; Mon, 7 Mar 2005 19:42:03 +0100 (CET) X-ME-UUID: 20050307184203378.5C4FC2800149@mwinf1007.wanadoo.fr Message-ID: <422CA07E.1000504@wanadoo.fr> Date: Mon, 07 Mar 2005 19:42:06 +0100 From: =?ISO-8859-1?Q?S=E9bastien_Annedouche?= Reply-To: sannedouche@wanadoo.fr User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: fr, en-us, en MIME-Version: 1.0 To: user@ant.apache.org Subject: cannot resolve symbol when overriding method. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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] \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