Author: kkolinko Date: Thu Nov 10 05:50:36 2011 New Revision: 1200166 URL: http://svn.apache.org/viewvc?rev=1200166&view=rev Log: Merging revision 1187781 from tomcat/trunk: Whitespace removal from /java/org/apache/tomcat I won't merge all of it (as it spans bcel etc.), but only our code. Part 3.
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java?rev=1200166&r1=1200165&r2=1200166&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java Thu Nov 10 05:50:36 2011 @@ -34,18 +34,18 @@ import org.apache.tomcat.util.net.Server @author EKR */ - + public class JSSEImplementation extends SSLImplementation { @Override public String getImplementationName(){ return "JSSE"; } - + @Override public ServerSocketFactory getServerSocketFactory(AbstractEndpoint endpoint) { return new JSSESocketFactory(endpoint); - } + } @Override public SSLSupport getSSLSupport(Socket s) { Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java?rev=1200166&r1=1200165&r2=1200166&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java Thu Nov 10 05:50:36 2011 @@ -100,7 +100,7 @@ public final class JSSEKeyManager extend */ @Override public X509Certificate[] getCertificateChain(String alias) { - return delegate.getCertificateChain(alias); + return delegate.getCertificateChain(alias); } /** Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java?rev=1200166&r1=1200165&r2=1200166&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java Thu Nov 10 05:50:36 2011 @@ -70,7 +70,7 @@ import org.apache.tomcat.util.res.String * JSSE.<br/> * keytool -genkey -alias tomcat -keyalg RSA</br> * Use "changeit" as password (this is the default we use). - * + * * @author Harish Prabandham * @author Costin Manolache * @author Stefan Freyr Stefansson @@ -96,7 +96,7 @@ public class JSSESocketFactory implement private static final int defaultSessionTimeout = 86400; private static final String ALLOW_ALL_SUPPORTED_CIPHERS = "ALL"; public static final String DEFAULT_KEY_PASS = "changeit"; - + static { boolean result = false; SSLContext context; @@ -150,7 +150,7 @@ public class JSSESocketFactory implement initServerSocket(socket); return socket; } - + @Override public ServerSocket createSocket (int port, int backlog) throws IOException @@ -160,19 +160,19 @@ public class JSSESocketFactory implement initServerSocket(socket); return socket; } - + @Override public ServerSocket createSocket (int port, int backlog, InetAddress ifAddress) throws IOException - { + { init(); ServerSocket socket = sslProxy.createServerSocket(port, backlog, ifAddress); initServerSocket(socket); return socket; } - + @Override public Socket acceptSocket(ServerSocket socket) throws IOException @@ -185,7 +185,7 @@ public class JSSESocketFactory implement } return asock; } - + @Override public void handshake(Socket sock) throws IOException { // We do getSession instead of startHandshake() so we can call this multiple times @@ -266,7 +266,7 @@ public class JSSESocketFactory implement } } } - } + } if (vec != null) { result = new String[vec.size()]; @@ -278,7 +278,7 @@ public class JSSESocketFactory implement return result; } - + /* * Gets the SSL server's keystore password. */ @@ -399,10 +399,10 @@ public class JSSESocketFactory implement } istream = new FileInputStream(keyStoreFile); } - + char[] storePass = null; if (pass != null && !"".equals(pass)) { - storePass = pass.toCharArray(); + storePass = pass.toCharArray(); } ks.load(istream, storePass); } catch (FileNotFoundException fnfe) { @@ -465,7 +465,7 @@ public class JSSESocketFactory implement allowUnsafeLegacyRenegotiation = "true".equals( endpoint.getAllowUnsafeLegacyRenegotiation()); - + // Check the SSL config is OK checkConfig(); @@ -485,11 +485,11 @@ public class JSSESocketFactory implement protocol = defaultProtocol; } - SSLContext context = SSLContext.getInstance(protocol); + SSLContext context = SSLContext.getInstance(protocol); return context; } - + @Override public KeyManager[] getKeyManagers() throws Exception { String keystoreType = endpoint.getKeystoreType(); @@ -518,7 +518,7 @@ public class JSSESocketFactory implement if (truststoreType == null) { truststoreType = defaultKeystoreType; } - + String algorithm = endpoint.getTruststoreAlgorithm(); if (algorithm == null) { algorithm = TrustManagerFactory.getDefaultAlgorithm(); @@ -537,7 +537,7 @@ public class JSSESocketFactory implement } else { sessionCacheSize = defaultSessionCacheSize; } - + int sessionTimeout; if (endpoint.getSessionTimeout() != null) { sessionTimeout = Integer.parseInt(endpoint.getSessionTimeout()); @@ -596,7 +596,7 @@ public class JSSESocketFactory implement String keystoreProvider, String algorithm) throws Exception { String crlf = endpoint.getCrlFile(); - + String className = endpoint.getTrustManagerClassName(); if(className != null && className.length() > 0) { ClassLoader classLoader = getClass().getClassLoader(); @@ -608,10 +608,10 @@ public class JSSESocketFactory implement Object trustManagerObject = clazz.newInstance(); TrustManager trustManager = (TrustManager) trustManagerObject; return new TrustManager[]{ trustManager }; - } + } TrustManager[] tms = null; - + KeyStore trustStore = getTrustStore(keystoreType, keystoreProvider); if (trustStore != null || endpoint.getTrustManagerClassName() != null) { if (crlf == null) { @@ -630,21 +630,21 @@ public class JSSESocketFactory implement tms = tmf.getTrustManagers(); } } - + return tms; } /** * Return the initialization parameters for the TrustManager. * Currently, only the default <code>PKIX</code> is supported. - * + * * @param algorithm The algorithm to get parameters for. * @param crlf The path to the CRL file. * @param trustStore The configured TrustStore. * @return The parameters including the CRLs and TrustStore. */ - protected CertPathParameters getParameters(String algorithm, - String crlf, + protected CertPathParameters getParameters(String algorithm, + String crlf, KeyStore trustStore) throws Exception { CertPathParameters params = null; @@ -675,9 +675,9 @@ public class JSSESocketFactory implement /** * Load the collection of CRLs. - * + * */ - protected Collection<? extends CRL> getCRLs(String crlf) + protected Collection<? extends CRL> getCRLs(String crlf) throws IOException, CRLException, CertificateException { File crlFile = new File(crlf); @@ -697,7 +697,7 @@ public class JSSESocketFactory implement throw crle; } catch(CertificateException ce) { throw ce; - } finally { + } finally { if(is != null) { try{ is.close(); @@ -792,7 +792,7 @@ public class JSSESocketFactory implement } String[] requestedProtocols = endpoint.getSslEnabledProtocolsArray(); - setEnabledProtocols(socket, getEnabledProtocols(socket, + setEnabledProtocols(socket, getEnabledProtocols(socket, requestedProtocols)); // we don't know if client auth is needed - @@ -812,7 +812,7 @@ public class JSSESocketFactory implement try { // Set the timeout to 1ms as all we care about is if it throws an - // SSLException on accept. + // SSLException on accept. socket.setSoTimeout(1); socket.accept(); @@ -840,6 +840,6 @@ public class JSSESocketFactory implement socket.close(); } } - + } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java?rev=1200166&r1=1200165&r2=1200166&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java Thu Nov 10 05:50:36 2011 @@ -48,15 +48,15 @@ import org.apache.tomcat.util.res.String @author EKR @author Craig R. McClanahan @author Filip Hanik - Parts cribbed from JSSECertCompat + Parts cribbed from JSSECertCompat Parts cribbed from CertificatesValve */ class JSSESupport implements SSLSupport, SSLSessionManager { - + private static final org.apache.juli.logging.Log log = org.apache.juli.logging.LogFactory.getLog(JSSESupport.class); - + private static final StringManager sm = StringManager.getManager("org.apache.tomcat.util.net.jsse.res"); @@ -73,7 +73,7 @@ class JSSESupport implements SSLSupport, session = sock.getSession(); sock.addHandshakeCompletedListener(listener); } - + JSSESupport(SSLSession session) { this.session = session; } @@ -87,7 +87,7 @@ class JSSESupport implements SSLSupport, } @Override - public Object[] getPeerCertificateChain() + public Object[] getPeerCertificateChain() throws IOException { return getPeerCertificateChain(false); } @@ -102,8 +102,8 @@ class JSSESupport implements SSLSupport, return null; } if( certs==null ) return null; - - java.security.cert.X509Certificate [] x509Certs = + + java.security.cert.X509Certificate [] x509Certs = new java.security.cert.X509Certificate[certs.length]; for(int i=0; i < certs.length; i++) { if (certs[i] instanceof java.security.cert.X509Certificate ) { @@ -118,7 +118,7 @@ class JSSESupport implements SSLSupport, new ByteArrayInputStream(buffer); x509Certs[i] = (java.security.cert.X509Certificate) cf.generateCertificate(stream); - } catch(Exception ex) { + } catch(Exception ex) { log.info(sm.getString( "jseeSupport.certTranslationError", certs[i]), ex); return null; @@ -212,18 +212,18 @@ class JSSESupport implements SSLSupport, * Copied from <code>org.apache.catalina.valves.CertificateValve</code> */ @Override - public Integer getKeySize() + public Integer getKeySize() throws IOException { // Look up the current SSLSession SSLSupport.CipherData c_aux[]=ciphers; if (session == null) return null; - + Integer keySize = null; synchronized(keySizeCache) { keySize = keySizeCache.get(session); } - + if (keySize == null) { int size = 0; String cipherSuite = session.getCipherSuite(); @@ -249,7 +249,7 @@ class JSSESupport implements SSLSupport, return null; // Expose ssl_session (getId) byte [] ssl_session = session.getId(); - if ( ssl_session == null) + if ( ssl_session == null) return null; StringBuilder buf=new StringBuilder(); for(int x=0; x<ssl_session.length; x++) { Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java?rev=1200166&r1=1200165&r2=1200166&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java Thu Nov 10 05:50:36 2011 @@ -88,5 +88,5 @@ public class NioX509KeyManager extends X return super.chooseEngineServerAlias(keyType, issuers, engine); } - + } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java?rev=1200166&r1=1200165&r2=1200166&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java Thu Nov 10 05:50:36 2011 @@ -97,11 +97,11 @@ public class StringManager { /** Get a string from the underlying resource bundle or return null if the String is not found. - + @param key to desired resource String @return resource String matching <i>key</i> from underlying bundle or null if not found. - @throws IllegalArgumentException if <i>key</i> is null. + @throws IllegalArgumentException if <i>key</i> is null. */ public String getString(String key) { if(key == null){ @@ -195,7 +195,7 @@ public class StringManager { map = new Hashtable<Locale, StringManager>(); managers.put(packageName, map); } - + StringManager mgr = map.get(locale); if (mgr == null) { mgr = new StringManager(packageName, locale); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org