Can Eclipse Be Used To Find All Deprecated Method Calls?

后端 未结 3 1010
面向向阳花
面向向阳花 2020-12-14 15:58

Does Eclipse have a feature that lets you search a project to find all calls to deprecated methods?

相关标签:
3条回答
  • 2020-12-14 16:25

    You can set the compiler to generate errors or warnings (your choice) for any usage of deprecated API.

    Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API section.

    Then, each use of a deprecated method or API will show up as an error/warning in the Problems view.

    0 讨论(0)
  • 2020-12-14 16:25

    [Updating eight years later, for current versions of Eclipse, with screenshots.]

    First, build your projects. Once you've built your projects, the Problems view includes deprecations by default. You can group all the deprecations together.

    To show the Problems view, use Window>Show View>Problems.

    If deprecations don't appear after the next step, you can configure them in Preferences under Java>Compiler>Errors/Warnings.

    Group deprecations together using the Problem view menu. Start by clicking the control circled below.

    Once you've done that, open the "Deprecation" subtree. For example:

    0 讨论(0)
  • 2020-12-14 16:32

    You can always use the grep facilities under 'Search -> File'. Eclipse can do a recursive search for @deprecated after you check on the 'consider derived resources' option box.

    0 讨论(0)
提交回复
热议问题