在Eclipse中添加关于缺少@Override注释的界面实现的警告 [英] Add warning for missing @Override annotation for interface implementation in Eclipse

查看:1399
本文介绍了在Eclipse中添加关于缺少@Override注释的界面实现的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用JDK1.6.0_10的Eclipse 3.4.1中,如何在实现接口方法的方法上激活缺少 @Override 注释的警告?

In Eclipse 3.4.1 using JDK1.6.0_10 how can I activate a warning on a missing @Override annotation on a method that implements an interface method?

在首选项窗口中,此选项:

In the Preferences window this option:


Java>编译器>错误/警告>
注释>缺少'@Override'
注释

Java > Compiler > Errors / Warnings > Annotations > Missing '@Override' annotation

在覆盖的方法上缺少注释一个超类方法,但它对接口方法没有任何作用。

works fine for missing annotations on methods that override a superclass method, but it does nothing for interface methods.

推荐答案

在Eclipse 3.4.1中是不可能的。它是一个已知问题。有关详细信息,请参阅此错误报告页。

It is not possible in Eclipse 3.4.1. It is a known issue. See this bug report page for more information.

这篇关于在Eclipse中添加关于缺少@Override注释的界面实现的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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