Eclipse忽略了错误的@Override注释 [英] Eclipse ignoring incorrect @Override annotations
问题描述
由于某种原因,我的eclipse安装之一忽略了错误地设置 @Override
注释。例如,如果我将 @Override
放在不被覆盖的方法上,那么它完全忽略它。
For some reason one of my eclipse installations is ignoring incorrectly set @Override
annotations. For example, if I put @Override
on a method that isn't overriden, it just completely ignores it.
任何有关如何将其恢复到一个错误注释方法显示错误的状态的想法?
Any ideas on how to bring it back to a state where it will display an error for an incorrectly annotated method?
推荐答案
在Java 6( @Override 的定义略有改变。 com / ahe / entry / override_snafurel =nofollow noreferrer>并且不幸的是没有适当的文档),其中在实现接口的方法上使用 @Override
注释方法有效。在Java 5中被认为是错误。
The definition of @Override
changed slightly in Java 6 (and unfortunatly without proper documentation) wherein an @Override
annotation on a method that implements an interface method is valid. In Java 5 that was considered an error.
这篇关于Eclipse忽略了错误的@Override注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!