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

fix eclipse deprecation warnings #1917

Closed
wants to merge 4 commits into from

Conversation

rzpt
Copy link
Contributor

@rzpt rzpt commented Nov 18, 2022

Remove @SuppressWarnings("deprecation") on deprecated methods. The annotation is for suppressing calls of deprecated methods, not implementation of deprecated methods.

partial fix for #1635

Splitting out from #1916

Before this PR

Generated code produces warnings in eclipse

After this PR

==COMMIT_MSG==
Generated code does not produce deprecation warnings in eclipse by default
==COMMIT_MSG==

Possible downsides?

Not tested in intellij. Only tested on one internal repo.

Remove @SuppressWarnings("deprecation") on deprecated methods. The
annotation is for suppressing calls of deprecated methods, not
implementation of deprecated methods.

partial fix for #1635
@changelog-app
Copy link

changelog-app bot commented Nov 18, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Generated code does not produce deprecation warnings in eclipse by default

Check the box to generate changelog(s)

  • Generate changelog entry

@@ -305,7 +305,6 @@ private int getValue() {
}

@Override
@SuppressWarnings("deprecation")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? I would have though a non-deprecated method (accept) calling a deprecated method (Visitor::visitBar) would be problematic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hypothesis: if the deprecated method is defined in the same file, then the usage does not produce a warning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc we introduced the suppressions because we use javac -Xlint:deprecation in some places where it may apply to generated code. I'd like to ensure we're not regressing that functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then would you be willing to approve something similar to palantir/gradle-conjure#951? I'm thinking of suppressing all warnings from the generated project.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that’s reasonable given the warnings may not necessarily align with deprecation checks elsewhere.

@rzpt rzpt mentioned this pull request Nov 18, 2022
@rzpt
Copy link
Contributor Author

rzpt commented Feb 11, 2023

Doing this instead palantir/gradle-conjure#1136

@rzpt rzpt closed this Feb 11, 2023
@rzpt rzpt deleted the fix-eclipse-deprecation-warnings branch February 11, 2023 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants