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:31:55 UTC

[1/4] httpcomponents-core git commit: Add missing Javadoc @param. [Forced Update!]

Repository: httpcomponents-core
Updated Branches:
  refs/heads/4.4.x 58d72ebd7 -> f69f5f9be (forced update)


Add missing Javadoc @param.


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

Branch: refs/heads/4.4.x
Commit: 462d1365bcd35353a04e07419f885fed8a04e937
Parents: 53d45ba
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Dec 5 14:05:44 2017 -0700
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Dec 6 09:13:04 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/http/protocol/UriPatternMatcher.java   | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/462d1365/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
----------------------------------------------------------------------
diff --git a/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java b/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
index 42904d2..13a71ed 100644
--- a/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
+++ b/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
@@ -47,6 +47,7 @@ import org.apache.http.util.Args;
  * This class can be used to resolve an object matching a particular request
  * URI.
  *
+ * @param <T> The type of registered objects.
  * @since 4.0
  */
 @Contract(threading = ThreadingBehavior.SAFE)


[2/4] httpcomponents-core git commit: [HTTPCORE-496] Add API org.apache.http.protocol.UriPatternMatcher.entrySet()

Posted by ol...@apache.org.
[HTTPCORE-496] Add API org.apache.http.protocol.UriPatternMatcher.entrySet()


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

Branch: refs/heads/4.4.x
Commit: 21a1bf45faaf4e1ff374439fd79f6ca29e6a84a7
Parents: 462d136
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Dec 5 14:22:12 2017 -0700
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Dec 6 09:26:47 2017 +0100

----------------------------------------------------------------------
 RELEASE_NOTES.txt                                   |  3 +++
 .../org/apache/http/protocol/UriPatternMatcher.java | 16 +++++++++++++++-
 .../apache/http/protocol/TestUriPatternMatcher.java | 16 ++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/21a1bf45/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index db6d1a1..58880cb 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -8,6 +8,9 @@ Changelog
 
 * HTTPCORE-494: Add image constants to ContentType.
   Contributed by Gary Gregory <ggregory at apache.org>
+  
+* HTTPCORE-496: Add API org.apache.http.protocol.UriPatternMatcher.entrySet().
+  Contributed by Gary Gregory <ggregory at apache.org>
 
 
 Release 4.4.8

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/21a1bf45/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
----------------------------------------------------------------------
diff --git a/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java b/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
index 13a71ed..9925cb9 100644
--- a/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
+++ b/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
@@ -29,9 +29,11 @@ package org.apache.http.protocol;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
 
-import org.apache.http.annotation.ThreadingBehavior;
 import org.apache.http.annotation.Contract;
+import org.apache.http.annotation.ThreadingBehavior;
 import org.apache.http.util.Args;
 
 /**
@@ -61,6 +63,18 @@ public class UriPatternMatcher<T> {
     }
 
     /**
+     * Returns a {@link Set} view of the mappings contained in this matcher.
+     *
+     * @return  a set view of the mappings contained in this matcher.
+     *
+     * @see Map#entrySet()
+     * @since 4.4.9
+     */
+    public Set<Entry<String, T>> entrySet() {
+        return map.entrySet();
+    }
+
+    /**
      * Registers the given object for URIs matching the given pattern.
      *
      * @param pattern the pattern to register the handler for.

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/21a1bf45/httpcore/src/test/java/org/apache/http/protocol/TestUriPatternMatcher.java
----------------------------------------------------------------------
diff --git a/httpcore/src/test/java/org/apache/http/protocol/TestUriPatternMatcher.java b/httpcore/src/test/java/org/apache/http/protocol/TestUriPatternMatcher.java
index 4a56763..7d23423 100644
--- a/httpcore/src/test/java/org/apache/http/protocol/TestUriPatternMatcher.java
+++ b/httpcore/src/test/java/org/apache/http/protocol/TestUriPatternMatcher.java
@@ -33,6 +33,22 @@ import org.junit.Test;
 public class TestUriPatternMatcher {
 
     @Test
+    public void testEntrySet() throws Exception {
+        final Object h1 = new Object();
+        final Object h2 = new Object();
+        final Object h3 = new Object();
+
+        final UriPatternMatcher<Object> matcher = new UriPatternMatcher<Object>();
+        Assert.assertEquals(0, matcher.entrySet().size());
+        matcher.register("/h1", h1);
+        Assert.assertEquals(1, matcher.entrySet().size());
+        matcher.register("/h2", h2);
+        Assert.assertEquals(2, matcher.entrySet().size());
+        matcher.register("/h3", h3);
+        Assert.assertEquals(3, matcher.entrySet().size());
+    }
+
+    @Test
     public void testRegisterUnregister() throws Exception {
         final Object h1 = new Object();
         final Object h2 = new Object();


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

Posted by ol...@apache.org.
[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/f69f5f9b
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f69f5f9b
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f69f5f9b

Branch: refs/heads/4.4.x
Commit: f69f5f9be6797e08f7994a1213549c201421469b
Parents: 5c1767a
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:30:19 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/http/protocol/UriPatternMatcher.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f69f5f9b/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
----------------------------------------------------------------------
diff --git a/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java b/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
index 9925cb9..dab78e5 100644
--- a/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
+++ b/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
@@ -28,6 +28,7 @@
 package org.apache.http.protocol;
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -70,8 +71,8 @@ public class UriPatternMatcher<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<Entry<String, T>>(map.entrySet());
     }
 
     /**


[3/4] httpcomponents-core git commit: [HTTPCORE-497] Add API org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper.getUriPatternMatcher()

Posted by ol...@apache.org.
[HTTPCORE-497] Add API org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper.getUriPatternMatcher()


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

Branch: refs/heads/4.4.x
Commit: 5c1767a04d77dccacc9de4e038e2feeeb00adca6
Parents: 21a1bf4
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Dec 5 15:29:59 2017 -0700
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Wed Dec 6 09:29:23 2017 +0100

----------------------------------------------------------------------
 RELEASE_NOTES.txt                                         |  3 +++
 .../nio/protocol/UriHttpAsyncRequestHandlerMapper.java    | 10 ++++++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/5c1767a0/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 58880cb..ed190fb 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -11,6 +11,9 @@ Changelog
   
 * HTTPCORE-496: Add API org.apache.http.protocol.UriPatternMatcher.entrySet().
   Contributed by Gary Gregory <ggregory at apache.org>
+  
+* HTTPCORE-497: Add API Add API org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper.getUriPatternMatcher().
+  Contributed by Gary Gregory <ggregory at apache.org>
 
 
 Release 4.4.8

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/5c1767a0/httpcore-nio/src/main/java/org/apache/http/nio/protocol/UriHttpAsyncRequestHandlerMapper.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/UriHttpAsyncRequestHandlerMapper.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/UriHttpAsyncRequestHandlerMapper.java
index 541bec7..08dce57 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/UriHttpAsyncRequestHandlerMapper.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/UriHttpAsyncRequestHandlerMapper.java
@@ -59,6 +59,16 @@ public class UriHttpAsyncRequestHandlerMapper implements HttpAsyncRequestHandler
         this.matcher = Args.notNull(matcher, "Pattern matcher");
     }
 
+    /**
+     * Gets the matcher.
+     *
+     * @return the matcher
+     * @since 4.4.9
+     */
+    public UriPatternMatcher<HttpAsyncRequestHandler<?>> getUriPatternMatcher() {
+        return matcher;
+    }
+
     public UriHttpAsyncRequestHandlerMapper() {
         this(new UriPatternMatcher<HttpAsyncRequestHandler<?>>());
     }