Skip to content

Added toBuilder methods to Request #1673

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

Merged

Conversation

kringol
Copy link
Contributor

@kringol kringol commented Nov 7, 2019

Changes for #1672

@slandelle These are the simple/minimum changes.

But there is the fact that the constructors of RequestBuilder that take a prototype remain and could be used directly, breaking again the purpose of this change.
But in order to overcome that a more impactful change (backwards incompatible) has to be made. But I would leave that decision to you or your opinion on it.

  • Ideal: moving the RequestBuilder as an inner class of Request or DefaultRequest and restricting access to those methods
  • Not ideal: Making those constructors protected at least to reduce the chances of usage directly, but still poses a risk

Bonus question:
Do you prefer the implementation of toBuilder methods as default implementation on the interface or as it is now on the DefaultRequest.java?

@slandelle
Copy link
Contributor

We can’t introduce a breaking change on such core API atm.
The best we can do is flag as deprecated.

Copy link
Contributor

@slandelle slandelle left a comment

Choose a reason for hiding this comment

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

Please address comments.

@kringol
Copy link
Contributor Author

kringol commented Nov 7, 2019

We can’t introduce a breaking change on such core API atm.
The best we can do is flag as deprecated.

Flagged both constructors as deprecated for now then. And suppressed the deprecation warning on the interface default implementation for the time being. If that doesn't sound good, I can just remove the deprecation and hope people will not use it directly

@slandelle slandelle merged commit c5eff42 into AsyncHttpClient:master Nov 7, 2019
@slandelle
Copy link
Contributor

Thanks!

@kringol kringol deleted the feature/1672-BuilderFromRequest branch November 8, 2019 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants