I was cursing Maven a short while ago after getting the following compilation error :

/Users/dtaylor/src/…/macro/browser/beans/MacroSummary.java:[62,5] method does not override a method from its superclass

It compiled in IntelliJ IDEA, so what changed? It turns out that the compile error was for an @Override annotation against the implementation of an interface method. Per the Java spec, this is not correct – only overridden superclass methods are allowed to have this annotation – but IDEA 8 happily generated the annotation when I used Cmd-I to implement a method. Was this an IDEA bug?
As it turns out, no. It’s what they call the Override Snafu, where the Java compiler was updated in 6.0 to allow @Override on interface method implementations, but the spec and other documentation wasn’t changed.
Looking at my IDEA Project Language Level it was indeed 6.0 and saying “@Override in interfaces”. D’oh. A case of “don’t search for the answer, know the answer”!

Fresh ideas, announcements, and inspiration for your team, delivered weekly.

Subscribe now