Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/javax/net/ssl/compatibility/JdkRelease.java
38853 views
/*1* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* JDK major versions.25*/26public enum JdkRelease {2728JDK6(6, "1.6"),29JDK7(7, "1.7"),30JDK8(8, "1.8"),31JDK9(9, "9"),32JDK10(10, "10"),33JDK11(11, "11");3435public final int sequence;36public final String release;3738private JdkRelease(int sequence, String release) {39this.sequence = sequence;40this.release = release;41}4243public static JdkRelease getRelease(String jdkVersion) {44if (jdkVersion.startsWith(JDK6.release)) {45return JDK6;46} else if (jdkVersion.startsWith(JDK7.release)) {47return JDK7;48} else if (jdkVersion.startsWith(JDK8.release)) {49return JDK8;50} else if (jdkVersion.startsWith(JDK9.release)) {51return JDK9;52} else if (jdkVersion.startsWith(JDK10.release)) {53return JDK10;54} else if (jdkVersion.startsWith(JDK11.release)) {55return JDK11;56}5758return null;59}60}616263