Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure auto-replacement of deprecated methods in IntelliJ #1225

Closed
TimvdLippe opened this issue Oct 27, 2017 · 6 comments
Closed

Ensure auto-replacement of deprecated methods in IntelliJ #1225

TimvdLippe opened this issue Oct 27, 2017 · 6 comments

Comments

@TimvdLippe
Copy link
Contributor

Per https://blog.jetbrains.com/idea/2017/10/intellij-idea-2017-3-public-preview IntelliJ can now auto-suggest replacements for deprecated methods. Once IntelliJ 2017-3 is published, let's check whether our deprecations satisfy the requirements for this check.

Maybe we can also write a static analysis check that can automatically verify that whenever we deprecated method we:

  1. Link to a replacement
  2. Add @since property
  3. Is only removed in the next major version (See getArgumentAt is removed in 2.7.6 #945 as example)
@mureinik
Copy link
Contributor

It shouldn't be too difficult to cook up a Checkstyle check that identifies a deprecated method/class that doesn't have a @link or @see tag in its javadoc. I'm not quite sure where the right place for such a check would be though.

Can the maintainers advise on the proper place within the project structure?

@TimvdLippe
Copy link
Contributor Author

TimvdLippe commented Oct 28, 2017 via email

@TimvdLippe
Copy link
Contributor Author

So I have tried to make this work for the past couple of hours, but unsuccesfully. I am unable to get the check implementation on the classpath to actually be recognized by the checkstyle configuration. If you have any knowledge of how to do this with checkstyle and Gradle, please let me know. Sadly http://checkstyle.sourceforge.net/writingchecks.html is lackluster in this regard.

@TimvdLippe
Copy link
Contributor Author

Oh, my attempt is available at https://github.com/mockito/mockito/tree/custom-checkstyle

@TimvdLippe
Copy link
Contributor Author

Intellij 2017.3 has been released: https://www.jetbrains.com/idea/whatsnew/#v2017-3

@TimvdLippe
Copy link
Contributor Author

I no longer think we should pursue this effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants