kozchris / tmapix

Automatically exported from code.google.com/p/tmapix
0 stars 0 forks source link

@Override annotation in classes implementing interfaces but not extending a class #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. open 
/tmapix-io/trunk/src/main/java/org/tmapix/io/AbstractBaseTextualTopicMapWriter.j
ava in the editor of your choice
2. go to line 263
3. In the code like this, I think the override annotation should be removed:

     private static class LocatorComparator implements Comparator<Locator> {
-        @Override
         public int compare(Locator o1, Locator o2) {

What is the expected output? What do you see instead?

I expect that classes implementing interfaces do not have the @Override 
annotation on methods from the interfaces.

What version of the product are you using? On what operating system?
svn head

Please provide any additional information below.
I used the gradle eclipse task to create an eclipse project and see about 30 
errors like this. Eclipse refuses to compile this.

Original issue reported on code.google.com by bnjmn...@gmail.com on 7 Sep 2010 at 12:02

GoogleCodeExporter commented 8 years ago
Which Java version are you using? 

The @Override annotation is legal for classes which implement a particular 
method from an interface in Java 1.6.

TMAPIX must be compiled with Java version >= 1.6 but should accept Java version 
>= 1.5 as runtime environment

Original comment by lars.he...@gmail.com on 7 Sep 2010 at 12:19

GoogleCodeExporter commented 8 years ago
The gradle eclipse task created a project which used the Eclipse Helios default 
of Java 1.5.

Hannes just told me that this is a Java 1.6 feature, so I switched to 1.6 which 
solves this.

The gradle task :eclipse should better create a Java 1.6 project, IMHO.

Original comment by bnjmn...@gmail.com on 7 Sep 2010 at 12:30

GoogleCodeExporter commented 8 years ago
Maybe it uses another JDK if 

sourceCompatibility = '1.6'

is added to the build.gradle (i.e. after project.projectURL = 
'http://www.tmapix.org/')

I don't know. I believe think TMAPIX will switch to Maven anyway. :)

Original comment by lars.he...@gmail.com on 7 Sep 2010 at 12:37

GoogleCodeExporter commented 8 years ago
The sourceCompatibility change produced exactly the same .project file. 
Probably http://jira.codehaus.org/browse/GRADLE-1132 is related and they're 
already aware of it.

Original comment by bnjmn...@gmail.com on 7 Sep 2010 at 1:43