You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2017/12/06 08:42:15 UTC

[2/2] httpcomponents-core git commit: [HTTPCORE-496] Fixed synchronization bug

[HTTPCORE-496] Fixed synchronization bug


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/c81801f8
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/c81801f8
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/c81801f8

Branch: refs/heads/master
Commit: c81801f8ab0bb404e17d5617e0186c1f72108f9d
Parents: ffbe8aa
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Wed Dec 6 09:30:19 2017 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Dec 6 09:39:32 2017 +0100

----------------------------------------------------------------------
 .../org/apache/hc/core5/http/protocol/UriPatternMatcher.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/c81801f8/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternMatcher.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternMatcher.java b/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternMatcher.java
index f6bc730..be37a22 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternMatcher.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/UriPatternMatcher.java
@@ -28,9 +28,10 @@
 package org.apache.hc.core5.http.protocol;
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
 
 import org.apache.hc.core5.annotation.Contract;
 import org.apache.hc.core5.annotation.ThreadingBehavior;
@@ -68,8 +69,8 @@ public class UriPatternMatcher<T> implements LookupRegistry<T> {
      * @see Map#entrySet()
      * @since 4.4.9
      */
-    public Set<Entry<String, T>> entrySet() {
-        return map.entrySet();
+    public synchronized Set<Entry<String, T>> entrySet() {
+        return new HashSet<>(map.entrySet());
     }
 
     /**