[java-opensaml] branch master updated: Checkstyle

Scott Cantor cantor.2 at osu.edu
Wed Apr 12 16:41:56 EDT 2017


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=a6217869d1a335ca39c14e89e12f2cc0441da708

The following commit(s) were added to refs/heads/master by this push:
       new  a621786   Checkstyle
a621786 is described below

commit a6217869d1a335ca39c14e89e12f2cc0441da708
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Apr 12 16:41:54 2017 -0400

    Checkstyle
---
 .../criteria/impl/EvaluableCredentialCriteriaRegistry.java       | 9 ++++++---
 .../httpclient/impl/SecurityEnhancedTLSSocketFactory.java        | 6 ++++--
 .../security/httpclient/impl/TrustEngineTLSSocketFactory.java    | 8 ++++++--
 .../httpclient/impl/TrustEngineTLSSocketFactoryTest.java         | 1 +
 4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/opensaml-security-impl/src/main/java/org/opensaml/security/credential/criteria/impl/EvaluableCredentialCriteriaRegistry.java b/opensaml-security-impl/src/main/java/org/opensaml/security/credential/criteria/impl/EvaluableCredentialCriteriaRegistry.java
index 2680882..30ea4a8 100644
--- a/opensaml-security-impl/src/main/java/org/opensaml/security/credential/criteria/impl/EvaluableCredentialCriteriaRegistry.java
+++ b/opensaml-security-impl/src/main/java/org/opensaml/security/credential/criteria/impl/EvaluableCredentialCriteriaRegistry.java
@@ -175,19 +175,21 @@ public final class EvaluableCredentialCriteriaRegistry {
         initialized = true;
     }
 
+// Checkstyle: ReturnCount OFF    
     /**
      * Load the default set of criteria-evaluator mappings from the default mappings properties file.
      */
     public static synchronized void loadDefaultMappings() {
-        Logger log = getLogger();
+        final Logger log = getLogger();
         log.debug("Loading default evaluable credential criteria mappings");
-        InputStream inStream = EvaluableCredentialCriteriaRegistry.class.getResourceAsStream(DEFAULT_MAPPINGS_FILE);
+        final InputStream inStream =
+                EvaluableCredentialCriteriaRegistry.class.getResourceAsStream(DEFAULT_MAPPINGS_FILE);
         if (inStream == null) {
             log.error("Could not open resource stream from default mappings file '{}'", DEFAULT_MAPPINGS_FILE);
             return;
         }
 
-        Properties defaultMappings = new Properties();
+        final Properties defaultMappings = new Properties();
         try {
             defaultMappings.load(inStream);
         } catch (IOException e) {
@@ -197,6 +199,7 @@ public final class EvaluableCredentialCriteriaRegistry {
 
         loadMappings(defaultMappings);
     }
+// Checkstyle: ReturnCount OFF
 
     /**
      * Load a set of criteria-evaluator mappings from the supplied properties set.
diff --git a/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/SecurityEnhancedTLSSocketFactory.java b/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/SecurityEnhancedTLSSocketFactory.java
index e763bb1..6823494 100644
--- a/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/SecurityEnhancedTLSSocketFactory.java
+++ b/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/SecurityEnhancedTLSSocketFactory.java
@@ -145,8 +145,8 @@ public class SecurityEnhancedTLSSocketFactory implements LayeredConnectionSocket
         return wrappedFactory.createSocket(context);
     }
 
+// CheckStyle: ParameterNumber OFF
     /** {@inheritDoc} */
-    // CheckStyle: ParameterNumber OFF
     public Socket connectSocket(int connectTimeout, Socket sock, HttpHost host,
             InetSocketAddress remoteAddress, InetSocketAddress localAddress,
             HttpContext context) throws IOException {
@@ -163,7 +163,7 @@ public class SecurityEnhancedTLSSocketFactory implements LayeredConnectionSocket
             teardown(context);
         }
     }
-    // CheckStyle: ParameterNumber ON
+// CheckStyle: ParameterNumber ON
 
     /** {@inheritDoc} */
     public Socket createLayeredSocket(Socket socket, String target, int port, HttpContext context) throws IOException {
@@ -198,6 +198,7 @@ public class SecurityEnhancedTLSSocketFactory implements LayeredConnectionSocket
         performTrustEval(socket, null, context);
     }
     
+// Checkstyle: ReturnCount OFF
     /**
      * Perform trust evaluation by extracting the server TLS {@link X509Credential} from the 
      * {@link SSLSession} and evaluating it via a {@link TrustEngine<Credential>} 
@@ -264,6 +265,7 @@ public class SecurityEnhancedTLSSocketFactory implements LayeredConnectionSocket
         }
         
     }
+// Checkstyle: ReturnCount ON
 
     /**
      * Extract the server TLS {@link X509Credential} from the supplied {@link SSLSocket}.
diff --git a/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactory.java b/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactory.java
index 4cce69e..88f34a8 100644
--- a/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactory.java
+++ b/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactory.java
@@ -86,7 +86,7 @@ import org.slf4j.LoggerFactory;
 public class TrustEngineTLSSocketFactory implements LayeredConnectionSocketFactory {
     
     /** Logger. */
-    private final Logger log = LoggerFactory.getLogger(TrustEngineTLSSocketFactory.class);
+    @Nonnull private final Logger log = LoggerFactory.getLogger(TrustEngineTLSSocketFactory.class);
     
     /** The HttpClient socket factory instance wrapped by this implementation. */
     @Nonnull private LayeredConnectionSocketFactory wrappedFactory;
@@ -111,6 +111,7 @@ public class TrustEngineTLSSocketFactory implements LayeredConnectionSocketFacto
         return wrappedFactory.createSocket(context);
     }
 
+// Checkstyle: ParameterNumber OFF
     /** {@inheritDoc} */
     public Socket connectSocket(int connectTimeout, Socket sock, HttpHost host,
             InetSocketAddress remoteAddress, InetSocketAddress localAddress,
@@ -123,6 +124,7 @@ public class TrustEngineTLSSocketFactory implements LayeredConnectionSocketFacto
         return socket;
         
     }
+// Checkstyle: ParameterNumber ON
 
     /** {@inheritDoc} */
     public Socket createLayeredSocket(Socket socket, String target, int port, HttpContext context) throws IOException {
@@ -133,6 +135,7 @@ public class TrustEngineTLSSocketFactory implements LayeredConnectionSocketFacto
         return layeredSocket;
     }
     
+// Checkstyle: ReturnCount OFF
     /**
      * Perform trust evaluation by extracting the server TLS {@link X509Credential} from the 
      * {@link SSLSession} and evaluating it via a {@link TrustEngine<Credential>} 
@@ -150,7 +153,7 @@ public class TrustEngineTLSSocketFactory implements LayeredConnectionSocketFacto
             log.debug("Socket was not an instance of SSLSocket, skipping trust eval");
             return;
         }
-        SSLSocket sslSocket = (SSLSocket) socket;
+        final SSLSocket sslSocket = (SSLSocket) socket;
         
         log.debug("Attempting to evaluate server TLS credential against supplied TrustEngine and CriteriaSet");
         
@@ -192,6 +195,7 @@ public class TrustEngineTLSSocketFactory implements LayeredConnectionSocketFacto
         }
         
     }
+// Checkstyle: ReturnCount ON
 
     /**
      * Extract the server TLS {@link X509Credential} from the supplied {@link SSLSocket}.
diff --git a/opensaml-security-impl/src/test/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactoryTest.java b/opensaml-security-impl/src/test/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactoryTest.java
index 5179663..5473fa8 100644
--- a/opensaml-security-impl/src/test/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactoryTest.java
+++ b/opensaml-security-impl/src/test/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactoryTest.java
@@ -46,6 +46,7 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+ at SuppressWarnings("deprecation")
 public class TrustEngineTLSSocketFactoryTest {
     
     private static final String DATA_PATH = "/org/opensaml/security/x509/impl/";

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list