As you probably know, methods in interfaces are by default public abstract.
The JLS7 says: "It is permitted, but discouraged as a matter of style, to redundantly specify the public and/or abstract modifier for a method declared in an interface."
Is there any option in Eclipse to generate warnings if existing interface methods have redundant modifiers? I didn't find any option in Preferences -> Java -> Compiler -> Errors / Warnings
Intellij IDEA has a similar feature, turned on by default.
I found some similar questions but they deal with code generation:
Eclipse generating useless 'public abstract' modifier in interface method signatures
eclipse refactoring - pull up method to interface
Eclipse fixed bug:
[code style] don't generate redundant modifiers
Regards.
答案 0 :(得分:0)
基于ΦXocę웃Пepeúpaツ评论,我发现有一个名为SonarLint的Eclipse插件可以连接到SonarQube实例并在Java编辑器中标记检测到的问题。