Index: util/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java =================================================================== --- connectors/util/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java (revision 696420) +++ connectors/util/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java (working copy) @@ -49,27 +49,22 @@ public JSSEImplementation() throws ClassNotFoundException { // Check to see if JSSE is floating around somewhere Class.forName(SSLSocketClass); + String className; if( JdkCompat.isJava15() ) { - try { - Class factcl = Class.forName(JSSE15Factory); - factory = (JSSEFactory)factcl.newInstance(); - } catch(Exception ex) { - if(logger.isDebugEnabled()) - logger.debug("Error getting factory: " + JSSE15Factory, ex); - } + className = JSSE15Factory; } - if(factory == null && JdkCompat.isJava14() ) { - try { - Class factcl = Class.forName(JSSE14Factory); - factory = (JSSEFactory)factcl.newInstance(); - } catch(Exception ex) { - if(logger.isDebugEnabled()) { - logger.debug("Error getting factory: " + JSSE14Factory, ex); - } - } - } if(factory == null) { - factory = new JSSE13Factory(); + else if( JdkCompat.isJava14() ) { + className = JSSE14Factory; + } else { + className = JSSE13Factory; } + + try { + factory = (JSSEFactory) Class.forName(className).newInstance(); + } catch(Exception ex) { + if(logger.isDebugEnabled()) + logger.debug("Error getting factory: " + className, ex); + } }