Bug 307957 - Failure to resolve overriding method to the referenced interface when used with Ant
Summary: Failure to resolve overriding method to the referenced interface when used wi...
Status: VERIFIED NOT_ECLIPSE
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-04-02 02:18 EDT by Mike CLA
Modified: 2010-04-27 08:00 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike CLA 2010-04-02 02:18:25 EDT
Build Identifier: 20100218-1602

I am currently using the JDT compiler with Ant.  Inside Eclipse I get no errors.  However, once I run the ant build I get errors that methods with the @Override annotation do not override a method in the interface.  If I switch to the native compiler it works fine.  If I remove the @Override annotation it works fine.

Reproducible: Always

Steps to Reproduce:
Whenever I use ant with JDT as my compiler and I have an implementation or subclass in which I use the @Override annotation.
Comment 1 Remy Suen CLA 2010-04-02 07:24:40 EDT
@Override for interface methods is a Java 6 thing. You need to ensure you have the correct settings in your Eclipse project and your Ant file (they should match, naturally).
Comment 2 Walter Harley CLA 2010-04-02 12:17:14 EDT
In particular: where the javac compiler always assumes it is targeted at its "own" version of java (that is, javac 1.6 targets Java 1.6 behavior by default), you have to explicitly target the Eclipse command-line compiler.  I think the options are -target and -compliance, but I might be misremembering.
Comment 3 Mike CLA 2010-04-02 15:38:27 EDT
I will give that a try.  I believe the ant property is javac.target=1.6
Comment 4 Olivier Thomann CLA 2010-04-04 12:16:03 EDT
I would need an ant script that reproduces the problem.
Comment 5 Mike CLA 2010-04-06 01:23:46 EDT
I modified the original build file to specify a javac target as 1.6 and it works.  Thanks for your help.
Comment 6 Mike CLA 2010-04-06 01:26:06 EDT
Closing, not a bug.
Comment 7 Jay Arthanareeswaran CLA 2010-04-27 08:00:24 EDT
Verified for 3.6M7.