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

Use SELF for Builder Self Type Parameter #5685

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

minwoox
Copy link
Member

@minwoox minwoox commented May 17, 2024

Motivation:
See #5684 for the motivation.

Modifications:

  • Refactored builder classes to use the SELF type parameter for the builder's self-referencing methods.
    • Didn't refactor builder classes if their parent classes are public due to breaking changes. Will revisit this later if making changes is acceptable.

Result:

  • Reduced the need for cumbersome and error-prone method overrides.

Motivation:
See line#5684 for the motivation.

Modifications:
- Refactored builder classes to use the SELF type parameter for the builder's self-referencing methods.
  - Didn't refactor builder classes if their parent classes are public due to breaking changes. Will revisit this later if making change is acceptable.

Result:
- Reduced the need for cumbersome and error-prone method overrides.
Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

I'm all for making the implementation simpler 👍 If there are any issues (e.g. javadoc), I'd rather they be handled directly rather than us adding thousands of lines of code to avoid the issue.

@minwoox minwoox added this to the 1.29.0 milestone Jun 4, 2024
@minwoox
Copy link
Member Author

minwoox commented Jun 4, 2024

Resolving the conflicts is done. Meanwhile, I found other classes that I can also fix.
The superclasses of those classes are public but they are annotated with @UnstableApi.
Because this PR is already huge let me create a separate PR for the breaking.

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Thanks! 👍👍

@minwoox minwoox merged commit fb9132a into line:main Jun 5, 2024
14 of 15 checks passed
@minwoox minwoox deleted the type_parameter_hierarchy branch June 5, 2024 04:57
Dogacel pushed a commit to Dogacel/armeria that referenced this pull request Jun 8, 2024
Motivation:
See line#5684 for the motivation.

Modifications:
- Refactored builder classes to use the SELF type parameter for the builder's self-referencing methods.
  - Didn't refactor builder classes if their parent classes are public due to breaking changes. Will revisit this later if making changes is acceptable.

Result:
- Reduced the need for cumbersome and error-prone method overrides.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants