Skip to content

Commit

Permalink
Merge branch 'BETA_JAVA22'
Browse files Browse the repository at this point in the history
# Conflicts:
#	org.eclipse.jdt.launching/META-INF/MANIFEST.MF
#	org.eclipse.jdt.launching/pom.xml

Change-Id: I4f305e7718a8b1f5b0a4c9b1c29ef0e7cb8bf5a5
  • Loading branch information
jarthana committed Mar 20, 2024
2 parents fbe88c8 + 2b75095 commit 0896f9c
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2023 IBM Corporation and others.
* Copyright (c) 2008, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -234,6 +234,8 @@ public static String getCompilerCompliance(IVMInstall2 vMInstall) {
String version = vMInstall.getJavaVersion();
if (version == null) {
return null;
} else if (version.startsWith(JavaCore.VERSION_22)) {
return JavaCore.VERSION_22;
} else if (version.startsWith(JavaCore.VERSION_21)) {
return JavaCore.VERSION_21;
} else if (version.startsWith(JavaCore.VERSION_20)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -845,8 +845,11 @@ public URL getDefaultJavadocLocation(File installLocation) {
*/
public static URL getDefaultJavadocLocation(String version) {
try {
if (version.startsWith(JavaCore.VERSION_21)) {
return new URL("https://docs.oracle.com/en/java/javase/20/docs/api/"); //$NON-NLS-1$
if (version.startsWith(JavaCore.VERSION_22)) {
// To modify to version 22 after the release
return new URL("https://docs.oracle.com/en/java/javase/22/docs/api/"); //$NON-NLS-1$
} else if (version.startsWith(JavaCore.VERSION_21)) {
return new URL("https://docs.oracle.com/en/java/javase/21/docs/api/"); //$NON-NLS-1$
} else if (version.startsWith(JavaCore.VERSION_20)) {
return new URL("https://docs.oracle.com/en/java/javase/20/docs/api/"); //$NON-NLS-1$
} else if (version.startsWith(JavaCore.VERSION_19)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2023 IBM Corporation and others.
* Copyright (c) 2005, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -196,7 +196,9 @@ public synchronized Analyzer[] getAnalyzers() {

private String getExecutionEnvironmentCompliance(IExecutionEnvironment executionEnvironment) {
String desc = executionEnvironment.getId();
if (desc.indexOf(JavaCore.VERSION_21) != -1) {
if (desc.indexOf(JavaCore.VERSION_22) != -1) {
return JavaCore.VERSION_22;
} else if (desc.indexOf(JavaCore.VERSION_21) != -1) {
return JavaCore.VERSION_21;
} else if (desc.indexOf(JavaCore.VERSION_20) != -1) {
return JavaCore.VERSION_20;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2023 IBM Corporation and others.
* Copyright (c) 2006, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -41,6 +41,7 @@ public class ExecutionEnvironmentAnalyzer implements IExecutionEnvironmentAnalyz

// XXX: Note that this string is not yet standardized by OSGi, see http://wiki.osgi.org/wiki/Execution_Environment

private static final String JavaSE_22 = "JavaSE-22"; //$NON-NLS-1$
private static final String JavaSE_21 = "JavaSE-21"; //$NON-NLS-1$
private static final String JavaSE_20 = "JavaSE-20"; //$NON-NLS-1$
private static final String JavaSE_19 = "JavaSE-19"; //$NON-NLS-1$
Expand Down Expand Up @@ -95,7 +96,7 @@ public class ExecutionEnvironmentAnalyzer implements IExecutionEnvironmentAnalyz
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_21 });
mappings.put(JavaSE_10_Plus, new String[] { JavaSE_22 });
mappings.put(JavaSE_11, new String[] { JavaSE_10 });
mappings.put(JavaSE_12, new String[] { JavaSE_11 });
mappings.put(JavaSE_13, new String[] { JavaSE_12 });
Expand All @@ -107,6 +108,7 @@ public class ExecutionEnvironmentAnalyzer implements IExecutionEnvironmentAnalyz
mappings.put(JavaSE_19, new String[] { JavaSE_18 });
mappings.put(JavaSE_20, new String[] { JavaSE_19 });
mappings.put(JavaSE_21, new String[] { JavaSE_20 });
mappings.put(JavaSE_22, new String[] { JavaSE_21 });
}
@Override
public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
Expand All @@ -132,7 +134,9 @@ public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor)
types = getTypes(CDC_FOUNDATION_1_1);
}
} else {
if (javaVersion.startsWith("21")) { //$NON-NLS-1$
if (javaVersion.startsWith("22")) { //$NON-NLS-1$
types = getTypes(JavaSE_22);
} else if (javaVersion.startsWith("21")) { //$NON-NLS-1$
types = getTypes(JavaSE_21);
} else if (javaVersion.startsWith("20")) { //$NON-NLS-1$
types = getTypes(JavaSE_20);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -3370,8 +3370,11 @@ private static void updateCompliance(IVMInstall vm) {
} else if (javaVersion.startsWith(JavaCore.VERSION_21)
&& (javaVersion.length() == JavaCore.VERSION_21.length() || javaVersion.charAt(JavaCore.VERSION_21.length()) == '.')) {
compliance = JavaCore.VERSION_21;
} else if (javaVersion.startsWith(JavaCore.VERSION_22)
&& (javaVersion.length() == JavaCore.VERSION_22.length() || javaVersion.charAt(JavaCore.VERSION_22.length()) == '.')) {
compliance = JavaCore.VERSION_22;
} else {
compliance = JavaCore.VERSION_21; // use latest by default
compliance = JavaCore.VERSION_22; // use latest by default
}

Hashtable<String, String> options= JavaCore.getOptions();
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.jdt.launching/plugin.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2000, 2023 IBM Corporation and others.
# Copyright (c) 2000, 202 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -83,6 +83,7 @@ environment.description.22 = Java Platform, Standard Edition 18
environment.description.23 = Java Platform, Standard Edition 19
environment.description.24 = Java Platform, Standard Edition 20
environment.description.25 = Java Platform, Standard Edition 21
environment.description.26 = Java Platform, Standard Edition 22

classpathVariableInitializer.deprecated = Use the JRE System Library instead

Expand Down
7 changes: 6 additions & 1 deletion org.eclipse.jdt.launching/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
Copyright (c) 2005, 2023 IBM Corporation and others.
Copyright (c) 2005, 2024 IBM Corporation and others.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -383,6 +383,11 @@
id="JavaSE-21"
compliance="21">
</environment>
<environment
description="%environment.description.26"
id="JavaSE-22"
compliance="22">
</environment>
<analyzer
class="org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer"
id="org.eclipse.jdt.launching.eeAnalyzer"/>
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.launching/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2023 Eclipse Foundation and others.
Copyright (c) 2012, 2024 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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2023 Eclipse Foundation and others.
Copyright (c) 2012, 2024 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
Expand Down

0 comments on commit 0896f9c

Please sign in to comment.