Eclipse 忽略不正确的 @Override 注释 [英] Eclipse ignoring incorrect @Override annotations

查看:25
本文介绍了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 注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆