yhzdys commented on code in PR #788:
URL:
https://github.com/apache/httpcomponents-client/pull/788#discussion_r2700481873
##########
httpclient5/src/main/java/org/apache/hc/client5/http/protocol/HttpClientContext.java:
##########
@@ -466,6 +467,18 @@ public void setExchangeId(final String exchangeId) {
this.exchangeId = exchangeId;
}
+ /**
+ * @since 5.7
+ */
+ public String setExchangeId(final Supplier<String> supplier) {
+ final String exchangeId = this.exchangeId; // avoid getfield opcode
+ if (exchangeId == null) {
+ return this.exchangeId = supplier.get();
+ } else {
+ return exchangeId;
+ }
+ }
Review Comment:
You're right. I'll refactor the implementation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]