Bug 572006 - [16] Merge Debug from Beta to master

Merge remote-tracking branch 'origin/BETA_JAVA16'

Conflicts:
	org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF
	org.eclipse.jdt.debug.tests/pom.xml
	org.eclipse.jdt.launching/META-INF/MANIFEST.MF
	org.eclipse.jdt.launching/pom.xml

Change-Id: I7c5915a857bb1b9b0c09737495ec039032183868
diff --git a/org.eclipse.jdt.debug.tests/java16_/a/b/c/RecordTests.java b/org.eclipse.jdt.debug.tests/java16_/a/b/c/RecordTests.java
new file mode 100644
index 0000000..c9a1186
--- /dev/null
+++ b/org.eclipse.jdt.debug.tests/java16_/a/b/c/RecordTests.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 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/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package a.b.c;
+record R(int i, String s) {}
+
+public class RecordTests {
+
+ 	public static void main(String[] args) {
+ 		RecordTests dt = new RecordTests();
+ 	}
+
+}
diff --git a/org.eclipse.jdt.debug.tests/pom.xml b/org.eclipse.jdt.debug.tests/pom.xml
index 195bb52..f64d9f2 100644
--- a/org.eclipse.jdt.debug.tests/pom.xml
+++ b/org.eclipse.jdt.debug.tests/pom.xml
@@ -5,6 +5,7 @@
   are made available under the terms of the Eclipse Distribution License v1.0
   which accompanies this distribution, and is available at
   http://www.eclipse.org/org/documents/edl-v10.php
+  
  
   Contributors:
      Igor Fedorenko - initial implementation
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java
index c1656b8..b412ed4 100644
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java
+++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- *  Copyright (c) 2000, 2019 IBM Corporation and others.
+ *  Copyright (c) 2000, 2021 IBM Corporation and others.
  *
  *  This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License 2.0
@@ -63,6 +63,7 @@
 	public static final String JAVA_SE_1_7_EE_NAME = "JavaSE-1.7";
 	public static final String JAVA_SE_1_8_EE_NAME = "JavaSE-1.8";
 	public static final String JAVA_SE_9_EE_NAME = "JavaSE-9";
+	public static final String JAVA_SE_16_EE_NAME = "JavaSE-16";
 
 	/**
 	 * path to the test src for 'testprograms'
@@ -85,6 +86,10 @@
 	 * path to the 9 test source
 	 */
 	public static final IPath TEST_9_SRC_DIR = new Path("java9");
+	/**
+	 * path to the 16 test source
+	 */
+	public static final IPath TEST_16_SRC_DIR = new Path("java16_");
 
 	/**
 	 * path to the compiler error java file
@@ -139,6 +144,15 @@
 	}
 
 	/**
+	 * Returns if the currently running VM is version compatible with Java 16
+	 *
+	 * @return <code>true</code> if a Java 16 (or greater) VM is running <code>false</code> otherwise
+	 */
+	public static boolean isJava16_Compatible() {
+		return isCompatible(16);
+	}
+
+	/**
 	 * Returns if the current running system is compatible with the given Java minor version
 	 *
 	 * @param ver the version to test - either 4, 5, 6, 7 or 8
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
index ab32cb6..dec4564 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
@@ -187,6 +187,7 @@
 	public static final String ONE_SEVEN_PROJECT_NAME = "OneSeven";
 	public static final String ONE_EIGHT_PROJECT_NAME = "OneEight";
 	public static final String NINE_PROJECT_NAME = "Nine";
+	public static final String ONESIX_PROJECT_NAME = "One_Six";
 	public static final String BOUND_JRE_PROJECT_NAME = "BoundJRE";
 	public static final String CLONE_SUFFIX = "Clone";
 
@@ -239,6 +240,7 @@
 	private static boolean loaded17 = false;
 	private static boolean loaded18 = false;
 	private static boolean loaded9 = false;
+	private static boolean loaded16_ = false;
 	private static boolean loadedEE = false;
 	private static boolean loadedJRE = false;
 	private static boolean loadedMulti = false;
@@ -270,6 +272,8 @@
 		loaded18 = pro.exists();
 		pro = ResourcesPlugin.getWorkspace().getRoot().getProject(NINE_PROJECT_NAME);
 		loaded9 = pro.exists();
+		pro = ResourcesPlugin.getWorkspace().getRoot().getProject(ONESIX_PROJECT_NAME);
+		loaded16_ = pro.exists();
 		pro = ResourcesPlugin.getWorkspace().getRoot().getProject(BOUND_JRE_PROJECT_NAME);
 		loadedJRE = pro.exists();
 		pro = ResourcesPlugin.getWorkspace().getRoot().getProject(BOUND_EE_PROJECT_NAME);
@@ -537,6 +541,34 @@
 	}
 
 	/**
+	 * Creates the Java 16 compliant project
+	 */
+	synchronized void assert16_Project() {
+		IJavaProject jp = null;
+		ArrayList<ILaunchConfiguration> cfgs = new ArrayList<>(1);
+		try {
+			if (!loaded16_) {
+				jp = createProject(ONESIX_PROJECT_NAME, JavaProjectHelper.TEST_16_SRC_DIR.toString(), JavaProjectHelper.JAVA_SE_16_EE_NAME, false);
+				cfgs.add(createLaunchConfiguration(jp, "RecordTests"));
+				loaded16_ = true;
+				waitForBuild();
+			}
+		} catch (Exception e) {
+			try {
+				if (jp != null) {
+					jp.getProject().delete(true, true, null);
+					for (int i = 0; i < cfgs.size(); i++) {
+						cfgs.get(i).delete();
+					}
+				}
+			} catch (CoreException ce) {
+				// ignore
+			}
+			handleProjectCreationException(e, ONESIX_PROJECT_NAME, jp);
+		}
+	}
+
+	/**
 	 * Creates the 'BoundJRE' project used for the JRE testing
 	 */
 	synchronized void assertBoundJreProject() {
@@ -760,6 +792,16 @@
 	 *
 	 * @return the test project
 	 */
+	protected IJavaProject get16_Project() {
+		assert16_Project();
+		return getJavaProject(ONESIX_PROJECT_NAME);
+	}
+
+	/**
+	 * Returns the 'DebugTests' project.
+	 *
+	 * @return the test project
+	 */
 	protected IJavaProject get14Project() {
 		assert14Project();
 		return getJavaProject(ONE_FOUR_PROJECT_NAME);
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java
index ff5a253..b1b583a 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2020 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -38,6 +38,7 @@
 import org.eclipse.jdt.debug.tests.breakpoints.MiscBreakpointsTests;
 import org.eclipse.jdt.debug.tests.breakpoints.PatternBreakpointTests;
 import org.eclipse.jdt.debug.tests.breakpoints.PreLaunchBreakpointTest;
+import org.eclipse.jdt.debug.tests.breakpoints.RecordBreakpointTests;
 import org.eclipse.jdt.debug.tests.breakpoints.RunToLineTests;
 import org.eclipse.jdt.debug.tests.breakpoints.SpecialExceptionBreakpointTests;
 import org.eclipse.jdt.debug.tests.breakpoints.SuspendVMBreakpointsTests;
@@ -384,5 +385,9 @@
 			addTest(new TestSuite(AlternateStratumTests.class));
 		}
 		addTest(new TestSuite(ConditionalBreakpointsTests.class));
+
+		if (JavaProjectHelper.isJava16_Compatible()) {
+			addTest(new TestSuite(RecordBreakpointTests.class));
+		}
 	}
 }
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/RecordBreakpointTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/RecordBreakpointTests.java
new file mode 100644
index 0000000..4e651bd
--- /dev/null
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/RecordBreakpointTests.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 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/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.debug.tests.breakpoints;
+
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.debug.core.IJavaClassPrepareBreakpoint;
+import org.eclipse.jdt.debug.tests.AbstractDebugTest;
+
+public class RecordBreakpointTests extends AbstractDebugTest {
+
+	public RecordBreakpointTests(String name) {
+		super(name);
+	}
+
+	/**
+	 * Returns the project context for the current test - each test must implement this method
+	 */
+	@Override
+	protected IJavaProject getProjectContext() {
+		return get16_Project();
+	}
+	public void testRecordClassBreakpoint() throws Exception {
+
+		try {
+			// create a classLoad breakpoint to test
+			IJavaClassPrepareBreakpoint classPrepareBreakpoint = createClassPrepareBreakpoint("a.b.c.RecordTests");
+			assertEquals("wrong type name", "a.b.c.RecordTests", classPrepareBreakpoint.getTypeName());
+		} catch (Exception e) {
+			throw e;
+		} finally {
+			removeAllBreakpoints();
+		}
+	}
+
+}
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 de55b1f..27c8f89 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,9 +7,6 @@
  * 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
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 ab8994f..0615bf9 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2020 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -7,9 +7,6 @@
  * 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
@@ -850,8 +847,7 @@
 	public static URL getDefaultJavadocLocation(String version) {
 		try {
 			if (version.startsWith(JavaCore.VERSION_16)) {
-				// TODO: Needs an update after Java 16 release
-				return new URL("https://docs.oracle.com/en/java/javase/15/docs/api/"); //$NON-NLS-1$
+				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$
 			} else if (version.startsWith(JavaCore.VERSION_14)) {
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 3f6e8de..1263e34 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
@@ -7,9 +7,6 @@
  *  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
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 db58fd3..ef0056c 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
@@ -7,9 +7,6 @@
  * 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
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 904806f..e01afd6 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
@@ -7,9 +7,6 @@
  * 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
diff --git a/org.eclipse.jdt.launching/plugin.properties b/org.eclipse.jdt.launching/plugin.properties
index 294869a..117a8b1 100644
--- a/org.eclipse.jdt.launching/plugin.properties
+++ b/org.eclipse.jdt.launching/plugin.properties
@@ -7,10 +7,6 @@
 # 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
 ###############################################################################
diff --git a/org.eclipse.jdt.launching/plugin.xml b/org.eclipse.jdt.launching/plugin.xml
index ad6aff0..31b2d5b 100644
--- a/org.eclipse.jdt.launching/plugin.xml
+++ b/org.eclipse.jdt.launching/plugin.xml
@@ -9,9 +9,6 @@
      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
diff --git a/org.eclipse.jdt.launching/pom.xml b/org.eclipse.jdt.launching/pom.xml
index 9eead60..60f7ac5 100644
--- a/org.eclipse.jdt.launching/pom.xml
+++ b/org.eclipse.jdt.launching/pom.xml
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright (c) 2012, 2020 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
   http://www.eclipse.org/org/documents/edl-v10.php
- 
+  
   Contributors:
      Igor Fedorenko - initial implementation
 -->