No Compiler Settings

Bug #364770 reported by Michael Fletcher on 2009-04-21
2
Affects Status Importance Assigned to Milestone
Tomdroid
Fix Released
Low
Olivier Bilodeau

Bug Description

There are no project specific compiler settings in the eclipse metadata. This will cause problems if different developers are using different compiler settings.

Patch attached. These are the default compiler options provided by eclipse.

Olivier Bilodeau (plaxx) wrote :

Michael, I tried the settings you send me and I still got a lot of compiler complains for the @override statements. Reading about it, I found out that the behavior between java 5 and java 6 changed. For Java 5 @override was generating a compiler error when the method had no matching superclass method (overriding a superclass method). In Java 6, the behaviour changed, @override on a method will generate a compiler error if there are no superclass methods (like in Java5) _or_ if there are no interfaces methods matching.

For a better explanation, see: http://stackoverflow.com/questions/94361/when-do-you-use-javas-override-annotation-and-why

So now, there are two options:
1- get rid of the @override statements for methods implementing interface methods and apply Java 5 compatibility
2- enforce Java 6 compatibility

Since java 6 is the first real open source implementation of java (openjdk) I don't really mind enforcing java 6 and since it seems a better practice to enable @override whenever you are overriding a method then I would recommend #1.

What do you think?

Android uses Java 1.5 not Java 1.6. I'd strongly suggest keeping
compatibility at java 1.5e You would risk using a feature that is not
supported in Java.

Offtopic: Android uses the Java 1.5 class libraries from the Apache Harmony
JVM. Apache Harmony never implemented Java 1.6 largely because Sun wouldn't
license TCK to them under reasonable terms. This is part of the reason why
there is no Java 1.7 right now .. Java 1.7 is probably 12 months late. Most
of the other JCP members are (probably) refusing to support a Java 1.7 until
Sun (now Oracle) resolves this issue.

Olivier Bilodeau (plaxx) wrote :

As said here[1], going with Java 5 makes total sense. fix commited

[1] https://lists.launchpad.net/tomdroid-dev/msg00016.html

Olivier Bilodeau (plaxx) on 2009-04-24
Changed in tomdroid:
assignee: nobody → olivier-bottomlesspit
importance: Undecided → Low
milestone: none → 0.2
status: New → Fix Committed
Olivier Bilodeau (plaxx) wrote :

the fix for this was released in 0.2

Changed in tomdroid:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers