Question/Chore: unused code in DefaultClientBuilder#build
method (ClientCredentialsResolver
)
#1575
Labels
DefaultClientBuilder#build
method (ClientCredentialsResolver
)
#1575
I did originally post this on the dev forum, but they directed me here. See this post.
I'm submitting a
Question/comment about what I believe is a piece of unused code in the SDK
Background info
I believe I have found a unused/unnecessary bit of code in the
okta-java-sdk
and would like to bring it your attention.In the
DefaultClientBuilder#build
method, if you are configuring the client for OAuth2 withprivateKey
, the following logic gets hit (see here in Github -> okta/okta-sdk-java -> impl/src/main/java/com/okta/sdk/impl/client/DefaultClientBuilder.java#L378):but it doesn't actually do anything from what I can tell. The
getCredentialsResolver
method seems to never be called subsequently...meaning this is unused and unnecessary.From what I can tell, this is just a leftover artifact from a previous version of the code where an underlying base class required the
ClientCredentialsResolver
to be not null.See here where this code was first added, and this line was discussed: #354 (comment). You can see that the
BaseClient
being discussed requires aDefaultDataStore
, and thenDefaultDataStore
requires the passed inclientCredentialsResolver
to be non-null.The mentioned classes making this required were then removed/refactored in #776 ; I believe this PR should have also removed the line I'm questioning.
Expected behavior
The SDK interface (particularly the
ClientBuilder
) wouldn't have this red herring which can lead to lost time tracing code that ultimately leads nowhere.What went wrong?
N/A
Steps to reproduce
N/A
SDK Version
The text was updated successfully, but these errors were encountered: