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 注释


基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 降序排序:Java Map 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01