Bug 562137 - [15] Add Execution Environment for JavaSE-15

Change-Id: Ibc99d9a1f27a4ab5e3d3e6f4010452ad2e2675f5
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
index 9fae66e..30a3bc9 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EECompilationParticipant.java
@@ -7,6 +7,9 @@
  * https://www.eclipse.org/legal/epl-2.0/
  *
  * SPDX-License-Identifier: EPL-2.0
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
@@ -232,6 +235,8 @@
 		String version = vMInstall.getJavaVersion();
 		if (version == null) {
 			return null;
+		} else if (version.startsWith(JavaCore.VERSION_15)) {
+			return JavaCore.VERSION_15;
 		} else if (version.startsWith(JavaCore.VERSION_14)) {
 			return JavaCore.VERSION_14;
 		} else if (version.startsWith(JavaCore.VERSION_13)) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
index c64fecb..2742a1e 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
@@ -6,8 +6,12 @@
  * which accompanies this distribution, and is available at
  * https://www.eclipse.org/legal/epl-2.0/
  *
- * SPDX-License-Identifier: EPL-2.0
  *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * SPDX-License-Identifier: EPL-2.0
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Michael Allman - Bug 211648, Bug 156343 - Standard VM not supported on MacOS
@@ -844,7 +848,10 @@
 	 */
 	public static URL getDefaultJavadocLocation(String version) {
 		try {
-			if (version.startsWith(JavaCore.VERSION_14)) {
+			if (version.startsWith(JavaCore.VERSION_15)) {
+				// Needs an update after Java 15 release
+				return new URL("https://docs.oracle.com/en/java/javase/14/docs/api/"); //$NON-NLS-1$
+			} else if (version.startsWith(JavaCore.VERSION_14)) {
 				return new URL("https://docs.oracle.com/en/java/javase/14/docs/api/"); //$NON-NLS-1$
 			} else if (version.startsWith(JavaCore.VERSION_13)) {
 				return new URL("https://docs.oracle.com/en/java/javase/13/docs/api/"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java
index 0c237e4..c894ddf 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java
@@ -6,6 +6,10 @@
  *  which accompanies this distribution, and is available at
  *  https://www.eclipse.org/legal/epl-2.0/
  *
+ *  This is an implementation of an early-draft specification developed under the Java
+ *  Community Process (JCP) and is made available for testing and evaluation purposes
+ *  only. The code is not compatible with any specification of the JCP.
+ *
  *  SPDX-License-Identifier: EPL-2.0
  *
  *  Contributors:
@@ -196,7 +200,9 @@
 
 	private String getExecutionEnvironmentCompliance(IExecutionEnvironment executionEnvironment) {
 		String desc = executionEnvironment.getId();
-		if (desc.indexOf(JavaCore.VERSION_14) != -1) {
+		if (desc.indexOf(JavaCore.VERSION_15) != -1) {
+			return JavaCore.VERSION_15;
+		} else if (desc.indexOf(JavaCore.VERSION_14) != -1) {
 			return JavaCore.VERSION_14;
 		} else if (desc.indexOf(JavaCore.VERSION_13) != -1) {
 			return JavaCore.VERSION_13;
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java
index 1597004..8cba2db 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java
@@ -6,6 +6,10 @@
  * which accompanies this distribution, and is available at
  * https://www.eclipse.org/legal/epl-2.0/
  *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
  * SPDX-License-Identifier: EPL-2.0
  *
  * Contributors:
@@ -41,6 +45,7 @@
 
 	// XXX: Note that this string is not yet standardized by OSGi, see http://wiki.osgi.org/wiki/Execution_Environment
 
+	private static final String JavaSE_15 = "JavaSE-15"; //$NON-NLS-1$
 	private static final String JavaSE_14 = "JavaSE-14"; //$NON-NLS-1$
 	private static final String JavaSE_13 = "JavaSE-13"; //$NON-NLS-1$
 	private static final String JavaSE_12 = "JavaSE-12"; //$NON-NLS-1$
@@ -93,6 +98,7 @@
 		mappings.put(JavaSE_12, new String[] { JavaSE_11 });
 		mappings.put(JavaSE_13, new String[] { JavaSE_12 });
 		mappings.put(JavaSE_14, new String[] { JavaSE_13 });
+		mappings.put(JavaSE_15, new String[] { JavaSE_14 });
 	}
 	@Override
 	public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
@@ -118,7 +124,9 @@
 					types = getTypes(CDC_FOUNDATION_1_1);
 				}
 			} else {
-				if (javaVersion.startsWith("14")) { //$NON-NLS-1$
+				if (javaVersion.startsWith("15")) { //$NON-NLS-1$
+					types = getTypes(JavaSE_15);
+				} else if (javaVersion.startsWith("14")) { //$NON-NLS-1$
 					types = getTypes(JavaSE_14);
 				} else if (javaVersion.startsWith("13")) { //$NON-NLS-1$
 					types = getTypes(JavaSE_13);
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
index fdfbba1..d8ee60a 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
@@ -6,6 +6,10 @@
  * which accompanies this distribution, and is available at
  * https://www.eclipse.org/legal/epl-2.0/
  *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
  * SPDX-License-Identifier: EPL-2.0
  *
  * Contributors:
@@ -3336,8 +3340,11 @@
 				} else if (javaVersion.startsWith(JavaCore.VERSION_14)
 						&& (javaVersion.length() == JavaCore.VERSION_14.length() || javaVersion.charAt(JavaCore.VERSION_14.length()) == '.')) {
 					compliance = JavaCore.VERSION_14;
+				} else if (javaVersion.startsWith(JavaCore.VERSION_15)
+						&& (javaVersion.length() == JavaCore.VERSION_15.length() || javaVersion.charAt(JavaCore.VERSION_15.length()) == '.')) {
+					compliance = JavaCore.VERSION_15;
 				} else {
-					compliance = JavaCore.VERSION_14; // use latest by default
+					compliance = JavaCore.VERSION_15; // use latest by default
 				}
 
             	Hashtable<String, String> options= JavaCore.getOptions();
diff --git a/org.eclipse.jdt.launching/plugin.properties b/org.eclipse.jdt.launching/plugin.properties
index 83284ca..22b9ca4 100644
--- a/org.eclipse.jdt.launching/plugin.properties
+++ b/org.eclipse.jdt.launching/plugin.properties
@@ -1,11 +1,15 @@
 ###############################################################################
-# Copyright (c) 2000, 2019 IBM Corporation and others.
+# Copyright (c) 2000, 2020 IBM Corporation and others.
 #
 # This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License 2.0
 # which accompanies this distribution, and is available at
 # https://www.eclipse.org/legal/epl-2.0/
 
+# This is an implementation of an early-draft specification developed under the Java
+# Community Process (JCP) and is made available for testing and evaluation purposes
+#only. The code is not compatible with any specification of the JCP.
+ 
 # SPDX-License-Identifier: EPL-2.0
 #
 # Contributors:
@@ -76,6 +80,7 @@
 environment.description.16 = Java Platform, Standard Edition 12
 environment.description.17 = Java Platform, Standard Edition 13
 environment.description.18 = Java Platform, Standard Edition 14
+environment.description.19 = Java Platform, Standard Edition 15
 
 classpathVariableInitializer.deprecated = Use the JRE System Library instead
 
diff --git a/org.eclipse.jdt.launching/plugin.xml b/org.eclipse.jdt.launching/plugin.xml
index 311969d..be033aa 100644
--- a/org.eclipse.jdt.launching/plugin.xml
+++ b/org.eclipse.jdt.launching/plugin.xml
@@ -1,14 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <!--
-     Copyright (c) 2005, 2019 IBM Corporation and others.
+     Copyright (c) 2005, 2020 IBM Corporation and others.
 
      This program and the accompanying materials
      are made available under the terms of the Eclipse Public License 2.0
      which accompanies this distribution, and is available at
      https://www.eclipse.org/legal/epl-2.0/
 
-     SPDX-License-Identifier: EPL-2.0
+     This is an implementation of an early-draft specification developed under the Java
+ 	 Community Process (JCP) and is made available for testing and evaluation purposes
+ 	 only. The code is not compatible with any specification of the JCP.
+ 	SPDX-License-Identifier: EPL-2.0
  
      Contributors:
          IBM Corporation - initial API and implementation
@@ -343,11 +346,16 @@
             id="JavaSE-13"
             compliance="13">
       </environment> 
-            <environment
+      <environment
             description="%environment.description.18"
             id="JavaSE-14"
             compliance="14">
-      </environment>        
+      </environment>
+      <environment
+            description="%environment.description.19"
+            id="JavaSE-15"
+            compliance="15">
+      </environment>         
       <analyzer
             class="org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer"
             id="org.eclipse.jdt.launching.eeAnalyzer"/>