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

Refactoring: Move resolveLastTypeParameter from Util to Types #2198

Conversation

gromspys
Copy link
Contributor

@gromspys gromspys commented Oct 11, 2023

Summary by CodeRabbit

  • Refactor: Moved the resolveLastTypeParameter method from feign.Util to feign.Types for better organization and maintainability. This change improves the modularity of the codebase by grouping related functionalities together.
  • Deprecation: Deprecated the resolveLastTypeParameter method in feign.Util. Future calls should use feign.Types.resolveLastTypeParameter.
  • Documentation: Added JavaDoc comments for the resolveLastTypeParameter method in feign.Types to improve code readability and understanding.

@coderabbitai
Copy link

coderabbitai bot commented Oct 11, 2023

Walkthrough

The changes primarily involve the migration of the resolveLastTypeParameter method from the Util class to the Types class in the feign package. This refactoring enhances modularity and maintainability by placing the method in a more contextually appropriate class.

Changes

File Path Summary
core/src/main/java/feign/Types.java Added resolveLastTypeParameter method and its JavaDoc. Imported checkState from feign.Util.
core/src/main/java/feign/Util.java Deprecated resolveLastTypeParameter and replaced its calls with Types.resolveLastTypeParameter.

🐇

In the land of code, where logic intertwines,

A method moved, crossing class lines.

From Util to Types, it found a new home,

In the realm of feign, it freely roams.

Celebrate this change, for it's no small feat,

Making our codebase tidy and neat! 🎉


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
  • Additionally, enter @coderabbitai pause to halt the bot's ongoing reviews as any issue or review comment. To
    resume reviews, enter @coderabbitai resume as any issue or review comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between 34a7272 and a7d8b92.
Files selected for processing (2)
  • core/src/main/java/feign/Types.java (2 hunks)
  • core/src/main/java/feign/Util.java (1 hunks)
Files skipped from review due to trivial changes (1)
  • core/src/main/java/feign/Util.java
Additional comments (Suppressed): 2
core/src/main/java/feign/Types.java (2)
  • 26-26: The import of checkState from feign.Util is new. Ensure that this method is available and accessible from the Util class.

  • 327-358: The resolveLastTypeParameter method has been added. This method resolves the last type parameter of a parameterized supertype into its upper bounds. The method throws an IllegalStateException if the supertype cannot be resolved into a parameterized type using the provided context. The implementation appears to be copied from retrofit.RestMethodInfo. The method seems to be well-implemented with proper error checking and handling. However, ensure that the copied implementation is compatible with the current codebase and does not violate any licensing agreements.

@gromspys
Copy link
Contributor Author

Changes were added as part of PR: #2199

@gromspys gromspys closed this Oct 11, 2023
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.

None yet

1 participant