You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ck...@apache.org on 2020/09/14 15:16:07 UTC
[httpcomponents-core] 08/13: Use decimal numbers for
endpoint/execution IDs
This is an automated email from the ASF dual-hosted git repository.
ckozak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
commit b7f17306b207378cb4f6046eba9bd6a8e8d1f01a
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue Aug 18 12:19:02 2020 +0200
Use decimal numbers for endpoint/execution IDs
This closes #219
---
httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java | 2 +-
.../org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
index 3cffb58..e7e1e7e 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
@@ -71,7 +71,7 @@ class IOSessionImpl implements IOSession {
this.commandQueue = new ConcurrentLinkedDeque<>();
this.lock = new ReentrantLock();
this.socketTimeout = Timeout.DISABLED;
- this.id = String.format(type + "-%08X", COUNT.getAndIncrement());
+ this.id = String.format(type + "-%010d", COUNT.getAndIncrement());
this.handlerRef = new AtomicReference<>();
this.status = new AtomicReference<>(Status.ACTIVE);
final long currentTimeMillis = System.currentTimeMillis();
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java b/httpcore5/src/test/java/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java
index 8136cab..5771d97 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java
@@ -251,7 +251,7 @@ public class AsyncReverseProxyExample {
AsyncClientEndpoint clientEndpoint;
ProxyExchangeState() {
- this.id = String.format("%08X", COUNT.getAndIncrement());
+ this.id = String.format("%010d", COUNT.getAndIncrement());
}
}