Environment Details
- Helidon Version: 4.3.3
- Helidon SE or Helidon MP: SE
- JDK version: 25
- OS: Linux
Problem Description
The JwtProvider.Builder class in the io.helidon.security.providers.jwt package contains several methods for configuring the provider. Most of these methods follow the fluent API pattern, returning the Builder instance to allow for method chaining.
However, the expectedAudience(String) method was found to have a void return type, which is inconsistent with the rest of the builder's API and Helidon's general builder patterns.
Impact
This inconsistency prevents developers from chaining the expectedAudience method with other builder methods. When attempting to chain, it results in a compilation error because void cannot be used to call subsequent methods.
Example of Failing Code
JwtProvider provider = JwtProvider.builder()
.issuer("my-issuer")
.expectedAudience("my-audience") // Returns void
.optional(true) // Compilation error: void cannot be dereferenced
.build();
Proposed Fix
Update the return type of expectedAudience(String) in JwtProvider.Builder from void to Builder and return this.
Environment Details
Problem Description
The
JwtProvider.Builderclass in theio.helidon.security.providers.jwtpackage contains several methods for configuring the provider. Most of these methods follow the fluent API pattern, returning theBuilderinstance to allow for method chaining.However, the
expectedAudience(String)method was found to have avoidreturn type, which is inconsistent with the rest of the builder's API and Helidon's general builder patterns.Impact
This inconsistency prevents developers from chaining the
expectedAudiencemethod with other builder methods. When attempting to chain, it results in a compilation error becausevoidcannot be used to call subsequent methods.Example of Failing Code
Proposed Fix
Update the return type of
expectedAudience(String)inJwtProvider.BuilderfromvoidtoBuilderand returnthis.