Eclipse ignoring incorrect @Override annotations(Eclipse 忽略不正确的 @Override 注释)
问题描述
由于某种原因,我的 Eclipse 安装之一忽略了错误设置的 @Override 注释.例如,如果我将 @Override 放在未被覆盖的方法上,它就会完全忽略它.
For some reason one of my eclipse installations is ignoring incorrectly set @Overrideannotations. 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?
推荐答案
@Override 的定义在 Java 6 (不幸的是没有适当的文档),其中实现接口方法的方法上的 @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 注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Eclipse 忽略不正确的 @Override 注释
基础教程推荐
- 从 python 访问 JVM 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
