You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2017/05/20 17:47:02 UTC

httpcomponents-core git commit: [HTTPCORE-470] Add a org.apache.http.nio.protocol.NullRequestHandler singleton. Fix style and checkstyle.

Repository: httpcomponents-core
Updated Branches:
  refs/heads/dev/4.4.x/HTTPCORE-470 b1d60df91 -> d292645fc


[HTTPCORE-470] Add a org.apache.http.nio.protocol.NullRequestHandler
singleton. Fix style and checkstyle.

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

Branch: refs/heads/dev/4.4.x/HTTPCORE-470
Commit: d292645fc24c37d8678a2e1ab923c21333a13c7d
Parents: b1d60df
Author: Gary Gregory <gg...@apache.org>
Authored: Sat May 20 10:46:59 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Sat May 20 10:46:59 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/http/nio/protocol/HttpAsyncService.java  | 2 +-
 .../org/apache/http/nio/protocol/NullRequestHandler.java     | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/d292645f/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
index 674d593..cc8dc37 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
@@ -761,7 +761,7 @@ public class HttpAsyncService implements NHttpServerEventHandler {
             handler = (HttpAsyncRequestHandler<Object>) this.handlerMapper.lookup(request);
         }
         if (handler == null) {
-            handler = NullRequestHandler.getInstance();
+            handler = NullRequestHandler.INSTANCE;
         }
         return handler;
     }

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/d292645f/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
index 572cbc1..7dad232 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
@@ -36,15 +36,11 @@ import org.apache.http.protocol.HttpContext;
 
 class NullRequestHandler implements HttpAsyncRequestHandler<Object> {
 
-    private static final NullRequestHandler INSTANCE = new NullRequestHandler();
-    
     /**
      * @since 4.4.7
      */
-    public static NullRequestHandler getInstance() {
-        return INSTANCE;
-    }
-    
+    public static final NullRequestHandler INSTANCE = new NullRequestHandler();
+
     public NullRequestHandler() {
         super();
     }