-
Notifications
You must be signed in to change notification settings - Fork 972
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
HTTPCLIENT-2321 Clarify default implementation of HttpClientConnectio… #553
Closed
kwin
wants to merge
1
commit into
apache:master
from
kwin:feature/clarify-default-connection-manager
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kwin In all honesty next time I am going to touch
HttpClientBuilder
I am not sure I will get around to updating this table. It will ultimately rot and will cause more harm than good.In any case If you want this change-set committed, please at the very least update
HttpAsyncClientBuilder
,CachingHttpClientBuilder
andCachingHttpAsyncClientBuilder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a lot of effort. The other alternative would be to establish a common naming (e.g. always use
Default
prefix, but this won't be backwards compatible) or at least clarify in the javadoc of the implementation whether it is the default one or not. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kwin As I mentioned in the JIRA I am not in favor of documenting the defaults in javadocs because some people might see them as a part of public contract but you do it consistently across the code base I will review and commit the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already have that all over the place:
httpcomponents-client/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicAuthCache.java
Line 49 in f2b9a37
httpcomponents-client/httpclient5/src/main/java/org/apache/hc/client5/http/cookie/BasicCookieStore.java
Line 45 in f2b9a37
httpcomponents-client/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/BasicCredentialsProvider.java
Line 40 in f2b9a37
httpcomponents-client/httpclient5/src/main/java/org/apache/hc/client5/http/impl/DefaultRedirectStrategy.java
Line 50 in f2b9a37
httpcomponents-client/httpclient5/src/main/java/org/apache/hc/client5/http/impl/DefaultConnectionKeepAliveStrategy.java
Line 45 in f2b9a37
....
And yes, you are right, I consider this default part of the contract (i.e. changing it is possible but only in a minor version explicitly stating the change somewhere)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kwin Those are the default impl of an interface. They have nothing to do with the behavior of client builders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the last they are all implementations of an interface which can be set on the
HttpClientBuilder
. Therefore I assume that the default applies here also.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kwin I will have to close this PR unless the proposed changes can be made consistently across the entire code base.