From 01bf9b6a5d324d45355659581e9ebbd1280834fe Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 25 Apr 2016 14:41:26 +0000
Subject: [PATCH] Improvements suggested by UCDetector: remove dead code, add final keywords, change visibilities

---
 opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java |   27 +++------------------------
 1 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java
index 3e84e41..b9ae86b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java
@@ -33,7 +33,6 @@
  */
 public class HTTPStatistics extends LDAPStatistics
 {
-
   /**
    * Map containing the total number of requests per HTTP methods.
    * <p>
@@ -43,7 +42,7 @@
    * The keys are static because they need to be listed in the schema which is
    * static.
    */
-  private Map<String, AtomicInteger> requestMethodsTotalCount = new HashMap<>();
+  private final Map<String, AtomicInteger> requestMethodsTotalCount = new HashMap<>();
   /**
    * Map containing the total execution time for the requests per HTTP methods.
    * <p>
@@ -54,13 +53,13 @@
    * The keys are static because they need to be listed in the schema which is
    * static.
    */
-  private Map<String, AtomicLong> requestMethodsTotalTime = new HashMap<>();
+  private final Map<String, AtomicLong> requestMethodsTotalTime = new HashMap<>();
   /**
    * Total number of requests. The total number may be different than the sum of
    * the supported HTTP methods above because clients could use unsupported HTTP
    * methods.
    */
-  private AtomicInteger requestsTotalCount = new AtomicInteger(0);
+  private final AtomicInteger requestsTotalCount = new AtomicInteger(0);
 
   /**
    * Constructor for this class.
@@ -115,26 +114,6 @@
   }
 
   /**
-   * Adds a request to the stats using the provided HTTP method.
-   *
-   * @param httpMethod
-   *          the method of the HTTP request to add to the stats
-   * @throws NullPointerException
-   *           if the httpMethod is null
-   */
-  public void addRequest(String httpMethod) throws NullPointerException
-  {
-    AtomicInteger nb =
-        this.requestMethodsTotalCount.get(httpMethod.toLowerCase());
-    if (nb != null)
-    {
-      nb.incrementAndGet();
-    } // else this is an unsupported HTTP method
-    // always count any requests regardless of whether the method is supported
-    this.requestsTotalCount.incrementAndGet();
-  }
-
-  /**
    * Adds to the total time of an HTTP request method.
    *
    * @param httpMethod

--
Gitblit v1.10.0