Merge remote-tracking branch 'origin/master' into BETA_JAVA_12
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 f993432..abb9da4 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
@@ -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:
@@ -205,6 +209,8 @@
 		String version = vMInstall.getJavaVersion();
 		if (version == null) {
 			return null;
+		} else if (version.startsWith(JavaCore.VERSION_12)) {
+			return JavaCore.VERSION_12;
 		} else if (version.startsWith(JavaCore.VERSION_11)) {
 			return JavaCore.VERSION_11;
 		} else if (version.startsWith(JavaCore.VERSION_10)) {
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 92279eb..afe5b6e 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,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:
@@ -818,7 +822,10 @@
 	 */
 	public static URL getDefaultJavadocLocation(String version) {
 		try {
-			if (version.startsWith(JavaCore.VERSION_11)) {
+			if (version.startsWith(JavaCore.VERSION_12)) {
+				// No URL yet for 12
+				return new URL("https://docs.oracle.com/en/java/javase/11/docs/api/"); //$NON-NLS-1$
+			} else if (version.startsWith(JavaCore.VERSION_11)) {
 				return new URL("https://docs.oracle.com/en/java/javase/11/docs/api/"); //$NON-NLS-1$
 			} else if (version.startsWith(JavaCore.VERSION_10)) {
 				return new URL("https://docs.oracle.com/javase/10/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 61cc15c..feaeefd 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_11) != -1) {
+		if (desc.indexOf(JavaCore.VERSION_12) != -1) {
+			return JavaCore.VERSION_12;
+		} else if (desc.indexOf(JavaCore.VERSION_11) != -1) {
 			return JavaCore.VERSION_11;
 		} else if (desc.indexOf(JavaCore.VERSION_10) != -1) {
 			return JavaCore.VERSION_10;
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironment.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironment.java
index 3e9ff14..fedc17a 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironment.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironment.java
@@ -558,4 +558,9 @@
 	private String getCompliance() {
 		return fElement.getAttribute("compliance"); //$NON-NLS-1$
 	}
+
+	@Override
+	public String toString() {
+		return this.fElement.getAttribute("id"); //$NON-NLS-1$
+	}
 }
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 2dada27..744fee9 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
@@ -41,6 +41,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_12 = "JavaSE-12"; //$NON-NLS-1$
 	private static final String JavaSE_11 = "JavaSE-11"; //$NON-NLS-1$
 	private static final String JavaSE_10_Plus = "JavaSE-10+"; //$NON-NLS-1$
 	private static final String JavaSE_10 = "JavaSE-10"; //$NON-NLS-1$
@@ -87,6 +88,7 @@
 		mappings.put(JavaSE_10, new String[] { JavaSE_9 });
 		mappings.put(JavaSE_10_Plus, new String[] { JavaSE_11 });
 		mappings.put(JavaSE_11, new String[] { JavaSE_10 });
+		mappings.put(JavaSE_12, new String[] { JavaSE_11 });
 	}
 	@Override
 	public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
@@ -112,7 +114,9 @@
 					types = getTypes(CDC_FOUNDATION_1_1);
 				}
 			} else {
-				if (javaVersion.startsWith("11")) { //$NON-NLS-1$
+				if (javaVersion.startsWith("12")) { //$NON-NLS-1$
+					types = getTypes(JavaSE_12);
+				} else if (javaVersion.startsWith("11")) { //$NON-NLS-1$
 					types = getTypes(JavaSE_11);
 				} else if (javaVersion.startsWith("10")) { //$NON-NLS-1$
 					types = getTypes(JavaSE_10);
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 574a381..33658f4 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
@@ -3299,8 +3299,11 @@
 				} else if (javaVersion.startsWith(JavaCore.VERSION_11)
 						&& (javaVersion.length() == JavaCore.VERSION_11.length() || javaVersion.charAt(JavaCore.VERSION_11.length()) == '.')) {
 					compliance = JavaCore.VERSION_11;
+				} else if (javaVersion.startsWith(JavaCore.VERSION_12)
+						&& (javaVersion.length() == JavaCore.VERSION_12.length() || javaVersion.charAt(JavaCore.VERSION_12.length()) == '.')) {
+					compliance = JavaCore.VERSION_12;
 				} else {
-					compliance = JavaCore.VERSION_11; // use latest by default
+					compliance = JavaCore.VERSION_12; // use latest by default
 				}
 
             	Hashtable<String, String> options= JavaCore.getOptions();
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/CompatibleEnvironment.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/CompatibleEnvironment.java
index e016a55..38c61d8 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/CompatibleEnvironment.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/CompatibleEnvironment.java
@@ -70,4 +70,9 @@
 	public boolean isStrictlyCompatbile() {
 		return fIsStrictlyCompatible;
 	}
+
+	@Override
+	public String toString() {
+		return this.fEnvironment.toString();
+	}
 }
diff --git a/org.eclipse.jdt.launching/plugin.properties b/org.eclipse.jdt.launching/plugin.properties
index 4446de0..8a75940 100644
--- a/org.eclipse.jdt.launching/plugin.properties
+++ b/org.eclipse.jdt.launching/plugin.properties
@@ -7,7 +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
 ###############################################################################
@@ -73,6 +75,7 @@
 environment.description.13 = Java Platform, Standard Edition 9
 environment.description.14 = Java Platform, Standard Edition 10
 environment.description.15 = Java Platform, Standard Edition 11
+environment.description.16 = Java Platform, Standard Edition 12
 
 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 1d41359..2c0e841 100644
--- a/org.eclipse.jdt.launching/plugin.xml
+++ b/org.eclipse.jdt.launching/plugin.xml
@@ -10,6 +10,10 @@
 
      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
  -->
@@ -331,7 +335,12 @@
             description="%environment.description.15"
             id="JavaSE-11"
             compliance="11">
-      </environment>            
+      </environment>
+            <environment
+            description="%environment.description.16"
+            id="JavaSE-12"
+            compliance="12">
+      </environment>         
       <analyzer
             class="org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer"
             id="org.eclipse.jdt.launching.eeAnalyzer"/>