eclipse: no warning for unused private methods

心已入冬 提交于 2019-12-14 03:15:42

问题


Regarding eclipse Kepler SR1

Hi,

I remember that a unused private methods were getting a warning from the compiler.

I don't know if it's changed switching to Kepler (or a previous release) or if it is project settings, because I'm working on a new project where the eclipse settings are shared.

I even couldn't find the setting in the eclipse compiler settings.


回答1:


go to your project on "Package Explorer", right-click on it and choose "properties". Then inside properties "Java Compiler", "Errors/Warnings". Check the box with "Enable project specific settings". Scroll down to the section where it says "Unnecessary code" and check them to "Warning"




回答2:


The setting is Preferences > Java > Compiler > Errors/Warnings > Unnecessary code > Unused private member.




回答3:


Go to

Windows --> Preferences --> Java --> Compiler --> Errors/Warnings

Under Unnecessary Code section you can find Unused private member

Change it to Warning




回答4:


It could be your company/ project uses other eclipse plugins which allow code analysis with lets say sonar and the eclipse static code analysis thatfore has been fully disabled.

I am still using the Indigo version of eclipse but i assume you can see what youre looking for under Window->Preferences->Java->Compiler->Errors/Warnings




回答5:


Change settings from preferences. Here is some illustration.



来源:https://stackoverflow.com/questions/19997731/eclipse-no-warning-for-unused-private-methods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!