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/11/24 21:47:19 UTC

[3/3] httpcomponents-client git commit: Eliminated DebugUtil class

Eliminated DebugUtil class


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

Branch: refs/heads/4.6.x
Commit: ec368aefb1bd146a18da654299c81734c9bb8cb0
Parents: f8a26df
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Nov 24 18:47:00 2017 +0100
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Nov 24 22:44:23 2017 +0100

----------------------------------------------------------------------
 .../apache/http/impl/auth/CredSspScheme.java    | 20 +++-
 .../org/apache/http/impl/auth/DebugUtil.java    | 96 --------------------
 2 files changed, 17 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/ec368aef/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java b/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java
index 721c84e..0d42266 100644
--- a/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java
+++ b/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java
@@ -1001,20 +1001,34 @@ public class CredSspScheme extends AuthSchemeBase
         }
 
 
+        public static void dump( final StringBuilder sb, final byte[] bytes )
+        {
+            if ( bytes == null )
+            {
+                sb.append( "null" );
+                return;
+            }
+            for ( final byte b : bytes )
+            {
+                sb.append( String.format( "%02X ", b ) );
+            }
+        }
+
+
         public String debugDump()
         {
             final StringBuilder sb = new StringBuilder( "TsRequest\n" );
             sb.append( "  negoToken:\n" );
             sb.append( "    " );
-            DebugUtil.dump( sb, negoToken );
+            dump( sb, negoToken );
             sb.append( "\n" );
             sb.append( "  authInfo:\n" );
             sb.append( "    " );
-            DebugUtil.dump( sb, authInfo );
+            dump( sb, authInfo );
             sb.append( "\n" );
             sb.append( "  pubKeyAuth:\n" );
             sb.append( "    " );
-            DebugUtil.dump( sb, pubKeyAuth );
+            dump( sb, pubKeyAuth );
             return sb.toString();
         }
 

http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/ec368aef/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java b/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java
deleted file mode 100644
index 2c8110e..0000000
--- a/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.http.impl.auth;
-
-
-import java.nio.ByteBuffer;
-
-
-/**
- * Simple debugging utility class for CredSSP and NTLM implementations.
- */
-class DebugUtil
-{
-
-    public static String dump( final ByteBuffer buf )
-    {
-        final ByteBuffer dup = buf.duplicate();
-        final StringBuilder sb = new StringBuilder( dup.toString() );
-        sb.append( ": " );
-        while ( dup.position() < dup.limit() )
-        {
-            sb.append( String.format( "%02X ", dup.get() ) );
-        }
-        return sb.toString();
-    }
-
-
-    public static void dump( final StringBuilder sb, final byte[] bytes )
-    {
-        if ( bytes == null )
-        {
-            sb.append( "null" );
-            return;
-        }
-        for ( final byte b : bytes )
-        {
-            sb.append( String.format( "%02X ", b ) );
-        }
-    }
-
-
-    public static String dump( final byte[] bytes )
-    {
-        final StringBuilder sb = new StringBuilder();
-        dump( sb, bytes );
-        return sb.toString();
-    }
-
-
-    public static byte[] fromHex( final String hex )
-    {
-        int i = 0;
-        final byte[] bytes = new byte[200000];
-        int h = 0;
-        while ( h < hex.length() )
-        {
-            if ( hex.charAt( h ) == ' ' )
-            {
-                h++;
-            }
-            final String str = hex.substring( h, h + 2 );
-            bytes[i] = ( byte ) Integer.parseInt( str, 16 );
-            i++;
-            h = h + 2;
-        }
-        final byte[] outbytes = new byte[i];
-        System.arraycopy( bytes, 0, outbytes, 0, i );
-        return outbytes;
-    }
-
-}