开发者

Eclipse Save Action - Package-private comment

If we define a Java class such as: class MyClass

Our team would like developers to always specify the scope using a comment, e.g., /* package */class MyClass

The same would be nice for variables. It doesn't appear that standard Eclipse Save Actions provides 开发者_Go百科the ability to automatically add the comment on Save. Is there an existing plugin that provides this functionality?


If I understand you correctly, you'd like to mark the class and variables with a /* package */ when the scope modifier is missing.

I suspect what you want is to determine when a developer has accidentally left off the scope modifier. The developer should type the /* package */ manually when he or she wants the scope to be package, rather than have the Eclipse IDE automatically insert the comment(s).

Your Eclipse plug-in would flag missing /* package */ comments, so that the developer can explicitly specify the scope. You would have to develop this Eclipse plug-in.


You can also create your own plug-in. Look in your Eclipse help for creating a clean-up.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜