Eclipse ignoring incorrect @Override annotations(Eclipse 忽略不正确的 @Override 注释)
问题描述
由于某种原因,我的 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?
推荐答案
@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 注释


- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01