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/03/26 01:02:56 UTC

svn commit: r1788700 - in /httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http: conn/ssl/ impl/auth/ impl/client/

Author: ggregory
Date: Sun Mar 26 01:02:56 2017
New Revision: 1788700

URL: http://svn.apache.org/viewvc?rev=1788700&view=rev
Log:
Use final.

Modified:
    httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java
    httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java
    httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java
    httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java
    httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
    httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
    httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java

Modified: httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java?rev=1788700&r1=1788699&r2=1788700&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java (original)
+++ httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/AbstractVerifier.java Sun Mar 26 01:02:56 2017
@@ -136,13 +136,13 @@ public abstract class AbstractVerifier i
         final List<SubjectName> allSubjectAltNames = DefaultHostnameVerifier.getSubjectAltNames(cert);
         final List<String> subjectAlts = new ArrayList<String>();
         if (InetAddressUtils.isIPv4Address(host) || InetAddressUtils.isIPv6Address(host)) {
-            for (SubjectName subjectName: allSubjectAltNames) {
+            for (final SubjectName subjectName: allSubjectAltNames) {
                 if (subjectName.getType() == SubjectName.IP) {
                     subjectAlts.add(subjectName.getValue());
                 }
             }
         } else {
-            for (SubjectName subjectName: allSubjectAltNames) {
+            for (final SubjectName subjectName: allSubjectAltNames) {
                 if (subjectName.getType() == SubjectName.DNS) {
                     subjectAlts.add(subjectName.getValue());
                 }
@@ -262,7 +262,7 @@ public abstract class AbstractVerifier i
             return null;
         }
         final List<String> dnsAlts = new ArrayList<String>();
-        for (SubjectName subjectName: subjectAltNames) {
+        for (final SubjectName subjectName: subjectAltNames) {
             if (subjectName.getType() == SubjectName.DNS) {
                 dnsAlts.add(subjectName.getValue());
             }

Modified: httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java?rev=1788700&r1=1788699&r2=1788700&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java (original)
+++ httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java Sun Mar 26 01:02:56 2017
@@ -303,7 +303,7 @@ public final class DefaultHostnameVerifi
                 return Collections.emptyList();
             }
             final List<SubjectName> result = new ArrayList<SubjectName>();
-            for (List<?> entry: entries) {
+            for (final List<?> entry: entries) {
                 final Integer type = entry.size() >= 2 ? (Integer) entry.get(0) : null;
                 if (type != null) {
                     final String s = (String) entry.get(1);

Modified: httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java?rev=1788700&r1=1788699&r2=1788700&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java (original)
+++ httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/CredSspScheme.java Sun Mar 26 01:02:56 2017
@@ -176,11 +176,11 @@ public class CredSspScheme extends AuthS
         {
             sslContext = SSLContexts.custom().build();
         }
-        catch ( NoSuchAlgorithmException e )
+        catch ( final NoSuchAlgorithmException e )
         {
             throw new RuntimeException( "Error creating SSL Context: " + e.getMessage(), e );
         }
-        catch ( KeyManagementException e )
+        catch ( final KeyManagementException e )
         {
             throw new RuntimeException( "Error creating SSL Context: " + e.getMessage(), e );
         }
@@ -218,7 +218,7 @@ public class CredSspScheme extends AuthS
             sslContext.init( null, new TrustManager[]
                 { tm }, null );
         }
-        catch ( KeyManagementException e )
+        catch ( final KeyManagementException e )
         {
             throw new RuntimeException( "SSL Context initialization error: " + e.getMessage(), e );
         }
@@ -424,11 +424,11 @@ public class CredSspScheme extends AuthS
         {
             peerCertificates = sslEngine.getSession().getPeerCertificates();
         }
-        catch ( SSLPeerUnverifiedException e )
+        catch ( final SSLPeerUnverifiedException e )
         {
             throw new AuthenticationException( e.getMessage(), e );
         }
-        for ( Certificate peerCertificate : peerCertificates )
+        for ( final Certificate peerCertificate : peerCertificates )
         {
             if ( !( peerCertificate instanceof X509Certificate ) )
             {
@@ -550,7 +550,7 @@ public class CredSspScheme extends AuthS
         {
             return ntlmOutgoingHandle.signAndEncryptMessage( authInfo );
         }
-        catch ( NTLMEngineException e )
+        catch ( final NTLMEngineException e )
         {
             throw new AuthenticationException( e.getMessage(), e );
         }
@@ -599,7 +599,7 @@ public class CredSspScheme extends AuthS
             buf.get( subjectPublicKey );
             return subjectPublicKey;
         }
-        catch ( MalformedChallengeException e )
+        catch ( final MalformedChallengeException e )
         {
             throw new AuthenticationException( e.getMessage(), e );
         }
@@ -612,7 +612,7 @@ public class CredSspScheme extends AuthS
         {
             getSSLEngine().beginHandshake();
         }
-        catch ( SSLException e )
+        catch ( final SSLException e )
         {
             throw new AuthenticationException( "SSL Engine error: " + e.getMessage(), e );
         }
@@ -667,7 +667,7 @@ public class CredSspScheme extends AuthS
                 throw new AuthenticationException( "SSL Engine error status: " + engineResult.getStatus() );
             }
         }
-        catch ( SSLException e )
+        catch ( final SSLException e )
         {
             throw new AuthenticationException( "SSL Engine wrap error: " + e.getMessage(), e );
         }
@@ -717,7 +717,7 @@ public class CredSspScheme extends AuthS
             }
 
         }
-        catch ( SSLException e )
+        catch ( final SSLException e )
         {
             throw new MalformedChallengeException( "SSL Engine unwrap error: " + e.getMessage(), e );
         }

Modified: httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java?rev=1788700&r1=1788699&r2=1788700&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java (original)
+++ httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/DebugUtil.java Sun Mar 26 01:02:56 2017
@@ -57,7 +57,7 @@ class DebugUtil
             sb.append( "null" );
             return;
         }
-        for ( byte b : bytes )
+        for ( final byte b : bytes )
         {
             sb.append( String.format( "%02X ", b ) );
         }

Modified: httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java?rev=1788700&r1=1788699&r2=1788700&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java (original)
+++ httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java Sun Mar 26 01:02:56 2017
@@ -767,7 +767,7 @@ final class NTLMEngineImpl implements NT
         final private byte[] exportedSessionKey;
         private byte[] signingKey;
         private byte[] sealingKey;
-        private Cipher rc4;
+        private final Cipher rc4;
         final Mode mode;
         final private boolean isConnection;
         int sequenceNumber = 0;
@@ -831,7 +831,7 @@ final class NTLMEngineImpl implements NT
                     cipher.init( Cipher.DECRYPT_MODE, new SecretKeySpec( sealingKey, "RC4" ) );
                 }
             }
-            catch ( Exception e )
+            catch ( final Exception e )
             {
                 throw new NTLMEngineException( e.getMessage(), e );
             }
@@ -1792,11 +1792,11 @@ final class NTLMEngineImpl implements NT
                 final MessageDigest md5 = getMD5();
                 channelBindingsHash = md5.digest( channelBindingStruct );
             }
-            catch ( CertificateEncodingException e )
+            catch ( final CertificateEncodingException e )
             {
                 throw new NTLMEngineException( e.getMessage(), e );
             }
-            catch ( NoSuchAlgorithmException e )
+            catch ( final NoSuchAlgorithmException e )
             {
                 throw new NTLMEngineException( e.getMessage(), e );
             }
@@ -1838,7 +1838,7 @@ final class NTLMEngineImpl implements NT
     static MessageDigest getMD5() {
         try {
             return MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException ex) {
+        } catch (final NoSuchAlgorithmException ex) {
             throw new RuntimeException("MD5 message digest doesn't seem to exist - fatal error: "+ex.getMessage(), ex);
         }
     }

Modified: httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java?rev=1788700&r1=1788699&r2=1788700&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java (original)
+++ httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java Sun Mar 26 01:02:56 2017
@@ -1218,7 +1218,7 @@ public class HttpClientBuilder {
                         connectionEvictor.shutdown();
                         try {
                             connectionEvictor.awaitTermination(1L, TimeUnit.SECONDS);
-                        } catch (InterruptedException interrupted) {
+                        } catch (final InterruptedException interrupted) {
                             Thread.currentThread().interrupt();
                         }
                     }

Modified: httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java?rev=1788700&r1=1788699&r2=1788700&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java (original)
+++ httpcomponents/httpclient/branches/4.6.x/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java Sun Mar 26 01:02:56 2017
@@ -132,7 +132,7 @@ public class SystemDefaultCredentialsPro
                                     systemcreds = new PasswordAuthentication(proxyUser, proxyPassword != null ? proxyPassword.toCharArray() : new char[] {});
                                 }
                             }
-                        } catch (NumberFormatException ex) {
+                        } catch (final NumberFormatException ex) {
                         }
                     }
                 }