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 注释
基础教程推荐
- Struts2 URL 无法访问 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 修改 void 函数的输入参数,然后读取 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
