Bug 573521 : Merge remote-tracking branch 'origin/master' into BETA_JAVA17

Change-Id: I7eda581a1e0ec7ccb9ebb11d233b7d8db2da4cff
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 27c8f89..50fc3e9 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
@@ -234,6 +237,8 @@
 		String version = vMInstall.getJavaVersion();
 		if (version == null) {
 			return null;
+		} else if (version.startsWith(JavaCore.VERSION_17)) {
+			return JavaCore.VERSION_17;
 		} else if (version.startsWith(JavaCore.VERSION_16)) {
 			return JavaCore.VERSION_16;
 		} else if (version.startsWith(JavaCore.VERSION_15)) {
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 0615bf9..06c77e5 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:
@@ -846,7 +850,10 @@
 	 */
 	public static URL getDefaultJavadocLocation(String version) {
 		try {
-			if (version.startsWith(JavaCore.VERSION_16)) {
+			if (version.startsWith(JavaCore.VERSION_17)) {
+				// TODO: Needs an update after Java 16 release
+				return new URL("https://docs.oracle.com/en/java/javase/16/docs/api/"); //$NON-NLS-1$
+			} else if (version.startsWith(JavaCore.VERSION_16)) {
 				return new URL("https://docs.oracle.com/en/java/javase/16/docs/api/"); //$NON-NLS-1$
 			} else if (version.startsWith(JavaCore.VERSION_15)) {
 				return new URL("https://docs.oracle.com/en/java/javase/15/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 1263e34..5c30e9f 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_16) != -1) {
+		if (desc.indexOf(JavaCore.VERSION_17) != -1) {
+			return JavaCore.VERSION_17;
+		} else if (desc.indexOf(JavaCore.VERSION_16) != -1) {
 			return JavaCore.VERSION_16;
 		} else if (desc.indexOf(JavaCore.VERSION_15) != -1) {
 			return JavaCore.VERSION_15;
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 ef0056c..b37d368 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
@@ -8,6 +8,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
  *
@@ -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_17 = "JavaSE-17"; //$NON-NLS-1$
 	private static final String JavaSE_16 = "JavaSE-16"; //$NON-NLS-1$
 	private static final String JavaSE_15 = "JavaSE-15"; //$NON-NLS-1$
 	private static final String JavaSE_14 = "JavaSE-14"; //$NON-NLS-1$
@@ -90,13 +95,14 @@
 		mappings.put(JavaSE_1_8, new String[] { JavaSE_1_7 });
 		mappings.put(JavaSE_9, new String[] { JavaSE_1_8 });
 		mappings.put(JavaSE_10, new String[] { JavaSE_9 });
-		mappings.put(JavaSE_10_Plus, new String[] { JavaSE_16 });
+		mappings.put(JavaSE_10_Plus, new String[] { JavaSE_17 });
 		mappings.put(JavaSE_11, new String[] { JavaSE_10 });
 		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 });
 		mappings.put(JavaSE_16, new String[] { JavaSE_15 });
+		mappings.put(JavaSE_17, new String[] { JavaSE_16 });
 	}
 	@Override
 	public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
@@ -122,7 +128,9 @@
 					types = getTypes(CDC_FOUNDATION_1_1);
 				}
 			} else {
-				if (javaVersion.startsWith("16")) { //$NON-NLS-1$
+				if (javaVersion.startsWith("17")) { //$NON-NLS-1$
+					types = getTypes(JavaSE_17);
+				} else if (javaVersion.startsWith("16")) { //$NON-NLS-1$
 					types = getTypes(JavaSE_16);
 				} else if (javaVersion.startsWith("15")) { //$NON-NLS-1$
 					types = getTypes(JavaSE_15);
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 a08cddc..1cd9863 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,11 @@
  * 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:
@@ -3358,8 +3363,11 @@
 				} else if (javaVersion.startsWith(JavaCore.VERSION_16)
 						&& (javaVersion.length() == JavaCore.VERSION_16.length() || javaVersion.charAt(JavaCore.VERSION_16.length()) == '.')) {
 					compliance = JavaCore.VERSION_16;
+				} else if (javaVersion.startsWith(JavaCore.VERSION_17)
+						&& (javaVersion.length() == JavaCore.VERSION_17.length() || javaVersion.charAt(JavaCore.VERSION_17.length()) == '.')) {
+					compliance = JavaCore.VERSION_17;
 				} else {
-					compliance = JavaCore.VERSION_16; // use latest by default
+					compliance = JavaCore.VERSION_17; // 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 117a8b1..a118366 100644
--- a/org.eclipse.jdt.launching/plugin.properties
+++ b/org.eclipse.jdt.launching/plugin.properties
@@ -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:
 #     IBM Corporation - initial API and implementation
@@ -77,6 +81,7 @@
 environment.description.18 = Java Platform, Standard Edition 14
 environment.description.19 = Java Platform, Standard Edition 15
 environment.description.20 = Java Platform, Standard Edition 16
+environment.description.21 = Java Platform, Standard Edition 17
 
 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 31b2d5b..060a675 100644
--- a/org.eclipse.jdt.launching/plugin.xml
+++ b/org.eclipse.jdt.launching/plugin.xml
@@ -1,13 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <!--
-     Copyright (c) 2005, 2020 IBM Corporation and others.
+     Copyright (c) 2005, 2021 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:
@@ -357,6 +361,11 @@
             description="%environment.description.20"
             id="JavaSE-16"
             compliance="16">
+      </environment>
+      <environment
+            description="%environment.description.21"
+            id="JavaSE-17"
+            compliance="17">
       </environment>         
       <analyzer
             class="org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer"
diff --git a/pom.xml b/pom.xml
index 8093395..8308b92 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright (c) 2012, 2016 Eclipse Foundation and others.
+  Copyright (c) 2012, 2021 Eclipse Foundation and others.
   All rights reserved. This program and the accompanying materials
   are made available under the terms of the Eclipse Distribution License v1.0
   which accompanies this distribution, and is available at
@@ -35,6 +35,10 @@
   <profiles>
     <profile>
       <id>build-individual-bundles</id>
+      <properties>
+      	<eclipse-p2-repo.url>http://download.eclipse.org/eclipse/updates/Y-builds</eclipse-p2-repo.url>
+      	<skipAPIAnalysis>true</skipAPIAnalysis>
+ 	  </properties>
       <repositories>
         <repository>
           <releases>