public static Jdk9Platform buildIfSupported() { // Find JDK 9 new methods try { Method setProtocolMethod = SSLParameters.class.getMethod("setApplicationProtocols", String[].class); Method getProtocolMethod = SSLSocket.class.getMethod("getApplicationProtocol"); return new Jdk9Platform(setProtocolMethod, getProtocolMethod); } catch (NoSuchMethodException ignored) { // pre JDK 9 } return null; } }
public static Jdk9Platform buildIfSupported() { // Find JDK 9 new methods try { Method setProtocolMethod = SSLParameters.class.getMethod("setApplicationProtocols", String[].class); Method getProtocolMethod = SSLSocket.class.getMethod("getApplicationProtocol"); return new Jdk9Platform(setProtocolMethod, getProtocolMethod); } catch (NoSuchMethodException ignored) { // pre JDK 9 } return null; } }
public static Jdk9Platform buildIfSupported() { // Find JDK 9 new methods try { Method setProtocolMethod = SSLParameters.class.getMethod("setApplicationProtocols", String[].class); Method getProtocolMethod = SSLSocket.class.getMethod("getApplicationProtocol"); return new Jdk9Platform(setProtocolMethod, getProtocolMethod); } catch (NoSuchMethodException ignored) { // pre JDK 9 } return null; } }
public static Jdk9Platform buildIfSupported() { // Find JDK 9 new methods try { Method setProtocolMethod = SSLParameters.class.getMethod("setApplicationProtocols", String[].class); Method getProtocolMethod = SSLSocket.class.getMethod("getApplicationProtocol"); return new Jdk9Platform(setProtocolMethod, getProtocolMethod); } catch (NoSuchMethodException ignored) { // pre JDK 9 } return null; } }