Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 28950 invoked from network); 27 Mar 2009 17:44:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Mar 2009 17:44:40 -0000 Received: (qmail 53094 invoked by uid 500); 27 Mar 2009 17:44:40 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 53040 invoked by uid 500); 27 Mar 2009 17:44:40 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 52919 invoked by uid 99); 27 Mar 2009 17:44:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Mar 2009 17:44:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Mar 2009 17:44:38 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 42564234C004; Fri, 27 Mar 2009 10:44:17 -0700 (PDT) From: bugzilla@apache.org To: notifications@ant.apache.org Subject: DO NOT REPLY [Bug 46929] New: Javac and Override annotation X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ant X-Bugzilla-Component: Core tasks X-Bugzilla-Keywords: ErrorMessage X-Bugzilla-Severity: normal X-Bugzilla-Who: howbizr@gmail.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: notifications@ant.apache.org X-Bugzilla-Target-Milestone: 1.8.0 X-Bugzilla-Changed-Fields: Message-ID: Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 27 Mar 2009 10:44:17 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=46929 Summary: Javac and Override annotation Product: Ant Version: 1.7.1 Platform: PC OS/Version: Windows XP Status: NEW Keywords: ErrorMessage Severity: normal Priority: P2 Component: Core tasks AssignedTo: notifications@ant.apache.org ReportedBy: howbizr@gmail.com When I use @Override the implementation of a method from the parent interface, I get a compiler error when calling the "javac" ant task. Eclipse is using the same compiler and does not throw an error. While the Java 6 documentation is vague on this scenario, from what I understand you can use the @Override annotation for overriding and implementing abstract methods. JAVA_HOME: ${java.home} ANT_HOME: ${ant.home} Ant Java Version: ${ant.java.version} Ant Version: ${ant.version} Java Version: ${java.version} Results in: [echo] JAVA_HOME: C:\Program Files\Java\jre1.6.0_05 [echo] ANT_HOME: C:\Program Files\Apache Software Foundation\apache-ant-1.7.1 [echo] Ant Java Version: 1.6 [echo] Ant Version: Apache Ant version 1.7.1 compiled on June 27 2008 [echo] Java Version: 1.6.0_05 Output (removed some directory information for privacy): [javac] Compiling 1 source file to ...\build\classes [javac] ...\XmlParserErrorResults.java:64: method does not override a method from its superclass [javac] @Override [javac] ^ [javac] 1 error Work around: Simply remove the "@Override" annotation and the problem is resolved. However, this seems like a pretty poor work around. Testing: As expected, if I legitimately break the code, by deleting the abstract method from my interface, I get the same error from "javac," but now I get it from Eclipse as well. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.