hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1734489 - in /httpcomponents/httpcore/trunk: httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/ httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/ httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/ httpcore5/s...
Date Fri, 11 Mar 2016 02:45:54 GMT
Author: ggregory
Date: Fri Mar 11 02:45:53 2016
New Revision: 1734489

URL: http://svn.apache.org/viewvc?rev=1734489&view=rev
Log:
https://github.com/apache/httpcore/pull/26 - Code quality fix - Utility classes should not
have public constructors.

Modified:
    httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/CommandLineUtils.java
    httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/ResultProcessor.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameConsts.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/Huffman.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/ConnSupport.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/TrailerNameFormatter.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/ssl/SSLContexts.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Args.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Asserts.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/CharsetUtils.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/TextUtils.java

Modified: httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/CommandLineUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/CommandLineUtils.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/CommandLineUtils.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/CommandLineUtils.java
Fri Mar 11 02:45:53 2016
@@ -37,6 +37,10 @@ import org.apache.commons.cli.Options;
 
 public class CommandLineUtils {
 
+    private CommandLineUtils() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     public static Options getOptions() {
         final Option iopt = new Option("i", false, "Do HEAD requests instead of GET (deprecated)");
         iopt.setRequired(false);

Modified: httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/ResultProcessor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/ResultProcessor.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/ResultProcessor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/ResultProcessor.java
Fri Mar 11 02:45:53 2016
@@ -32,6 +32,10 @@ import org.apache.hc.core5.http.HttpHost
 
 public class ResultProcessor {
 
+    private ResultProcessor() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     static NumberFormat nf2 = NumberFormat.getInstance();
     static NumberFormat nf3 = NumberFormat.getInstance();
     static NumberFormat nf6 = NumberFormat.getInstance();

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameConsts.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameConsts.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameConsts.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameConsts.java
Fri Mar 11 02:45:53 2016
@@ -28,6 +28,10 @@ package org.apache.hc.core5.http2.frame;
 
 public final class FrameConsts {
 
+    private FrameConsts() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     public final static int HEAD_LEN = 9;
     public final static int MAX_PADDING = 255;
 

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/Huffman.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/Huffman.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/Huffman.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/Huffman.java
Fri Mar 11 02:45:53 2016
@@ -33,6 +33,10 @@ package org.apache.hc.core5.http2.hpack;
  */
 public final class Huffman {
 
+    private Huffman() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     static final int[] CODES = {
             0x1ff8,
             0x7fffd8,

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/ConnSupport.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/ConnSupport.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/ConnSupport.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/impl/ConnSupport.java
Fri Mar 11 02:45:53 2016
@@ -40,6 +40,10 @@ import org.apache.hc.core5.http.config.C
  */
 public final class ConnSupport {
 
+    private ConnSupport() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     public static CharsetDecoder createDecoder(final ConnectionConfig cconfig) {
         if (cconfig == null) {
             return null;

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/TrailerNameFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/TrailerNameFormatter.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/TrailerNameFormatter.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/protocol/TrailerNameFormatter.java
Fri Mar 11 02:45:53 2016
@@ -45,6 +45,10 @@ import org.apache.hc.core5.util.CharArra
  */
 public class TrailerNameFormatter {
 
+    private TrailerNameFormatter() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     public static Header format(final HttpEntity entity) {
         if (entity == null) {
             return null;

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/ssl/SSLContexts.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/ssl/SSLContexts.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/ssl/SSLContexts.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/ssl/SSLContexts.java
Fri Mar 11 02:45:53 2016
@@ -51,6 +51,10 @@ import org.apache.hc.core5.annotation.Im
 @Immutable
 public class SSLContexts {
 
+    private SSLContexts() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     /**
      * Creates default factory based on the standard JSSE trust material
      * ({@code cacerts} file in the security properties directory). System properties

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Args.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Args.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Args.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Args.java
Fri Mar 11 02:45:53 2016
@@ -31,6 +31,10 @@ import java.util.Collection;
 
 public class Args {
 
+    private Args() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     public static void check(final boolean expression, final String message) {
         if (!expression) {
             throw new IllegalArgumentException(message);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Asserts.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Asserts.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Asserts.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/Asserts.java
Fri Mar 11 02:45:53 2016
@@ -29,6 +29,10 @@ package org.apache.hc.core5.util;
 
 public class Asserts {
 
+    private Asserts() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     public static void check(final boolean expression, final String message) {
         if (!expression) {
             throw new IllegalStateException(message);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/CharsetUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/CharsetUtils.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/CharsetUtils.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/CharsetUtils.java
Fri Mar 11 02:45:53 2016
@@ -33,6 +33,10 @@ import java.nio.charset.UnsupportedChars
 
 public class CharsetUtils {
 
+    private CharsetUtils() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     public static Charset lookup(final String name) {
         if (name == null) {
             return null;

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java
Fri Mar 11 02:45:53 2016
@@ -36,6 +36,10 @@ import java.net.SocketAddress;
  */
 public final class NetUtils {
 
+    private NetUtils() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     public static void formatAddress(
             final StringBuilder buffer,
             final SocketAddress socketAddress) {

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/TextUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/TextUtils.java?rev=1734489&r1=1734488&r2=1734489&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/TextUtils.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/TextUtils.java
Fri Mar 11 02:45:53 2016
@@ -32,6 +32,10 @@ package org.apache.hc.core5.util;
  */
 public final class TextUtils {
 
+    private TextUtils() {
+        // Do not allow utility class to be instantiated.
+    }
+    
     /**
      * Returns true if the parameter is null or of zero length
      */



Mime
View raw message