-
Notifications
You must be signed in to change notification settings - Fork 926
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
#5684
Labels
Comments
minwoox
added a commit
to minwoox/armeria
that referenced
this issue
May 17, 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 change is acceptable. Result: - Reduced the need for cumbersome and error-prone method overrides.
minwoox
added a commit
that referenced
this issue
Jun 5, 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.
minwoox
added a commit
to minwoox/armeria
that referenced
this issue
Jun 5, 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. Result: - Reduced the need for cumbersome and error-prone method overrides.
The list of classes that we should fix when we reach 2.0
|
trustin
pushed a commit
that referenced
this issue
Jun 7, 2024
Motivation: See #5684 for the motivation. Modifications: - Refactored builder classes to use the SELF type parameter for the builder's self-referencing methods. Result: - Reduced the need for cumbersome and error-prone method overrides. - (Breaking) These are all annotated with `@UnstableApi`. - `AbstractDnsResolverBuilder` is now `AbstractDnsResolverBuilder<SELF>` - `AbstractRuleBuilder` is now `AbstractRuleBuilder<SELF>` - `AbstractRuleWithContentBuilder` is now `AbstractRuleWithContentBuilder<SELF>` - `AbstractCircuitBreakerMappingBuilder` is now `AbstractCircuitBreakerMappingBuilder<SELF>` - `AbstractDynamicEndpointGroupBuilder` is now `AbstractDynamicEndpointGroupBuilder<SELF>` - `DynamicEndpointGroupSetters` is now `DynamicEndpointGroupSetters<SELF>` - `AbstractCuratorFrameworkBuilder` is now `AbstractCuratorFrameworkBuilder<SELF>`
Dogacel
pushed a commit
to Dogacel/armeria
that referenced
this issue
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.
Dogacel
pushed a commit
to Dogacel/armeria
that referenced
this issue
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. Result: - Reduced the need for cumbersome and error-prone method overrides. - (Breaking) These are all annotated with `@UnstableApi`. - `AbstractDnsResolverBuilder` is now `AbstractDnsResolverBuilder<SELF>` - `AbstractRuleBuilder` is now `AbstractRuleBuilder<SELF>` - `AbstractRuleWithContentBuilder` is now `AbstractRuleWithContentBuilder<SELF>` - `AbstractCircuitBreakerMappingBuilder` is now `AbstractCircuitBreakerMappingBuilder<SELF>` - `AbstractDynamicEndpointGroupBuilder` is now `AbstractDynamicEndpointGroupBuilder<SELF>` - `DynamicEndpointGroupSetters` is now `DynamicEndpointGroupSetters<SELF>` - `AbstractCuratorFrameworkBuilder` is now `AbstractCuratorFrameworkBuilder<SELF>`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the past, we decided not to use the self type parameter in this PR because it resulted in poorly formatted Javadoc. However, this decision has introduced several problems:
@Deprecated
annotation is not propagated to overridden methods, increasing the likelihood of mistakes.Moreover, with the current JDK, Javadoc is generated correctly with type parameters. Therefore, I propose using SELF for builder self type parameters to address these issues.
The text was updated successfully, but these errors were encountered: