Skip to content

Commit b5cbd61

Browse files
authored
Merge pull request #643 from jarthana/master
[24] Merge BETA_JAVA24 into master
2 parents f7ab749 + 6011533 commit b5cbd61

25 files changed

Lines changed: 257 additions & 169 deletions

File tree

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pipeline {
1010
}
1111
tools {
1212
maven 'apache-maven-latest'
13-
jdk 'temurin-jdk21-latest'
13+
jdk 'openjdk-jdk24-latest'
1414
}
1515
environment {
1616
NON_MODULAR_JAVA_HOME = tool(type:'jdk', name:'temurin-jdk8-latest')
@@ -21,7 +21,7 @@ pipeline {
2121
xvnc(useXauthority: true) {
2222
sh """
2323
mvn clean verify --batch-mode --fail-at-end -Dmaven.repo.local=$WORKSPACE/.m2/repository \
24-
-Ptest-on-javase-23 -Pbree-libs -Papi-check -Pjavadoc\
24+
-Ptest-on-javase-24 -Pbree-libs -Papi-check -Pjavadoc\
2525
-Dmaven.test.failure.ignore=true\
2626
-Dcompare-version-with-baselines.skip=false \
2727
-Dproject.build.sourceEncoding=UTF-8 \

org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.jdt.debug.tests; singleton:=true
5-
Bundle-Version: 3.12.600.qualifier
5+
Bundle-Version: 3.12.650.qualifier
66
Bundle-ClassPath: javadebugtests.jar
77
Bundle-Activator: org.eclipse.jdt.debug.testplugin.JavaTestPlugin
88
Bundle-Vendor: %providerName

org.eclipse.jdt.debug.tests/build.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ bin.includes = plugin.xml,\
2626
java8/,\
2727
java9/,\
2828
java16_/,\
29-
java23/
29+
java23/,\
30+
java24/
3031
source.javadebugtests.jar = test plugin/,\
3132
tests/,\
3233
console tests/
File renamed without changes.
File renamed without changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation -- initial API and implementation
13+
*******************************************************************************/
14+
public class Main21 {
15+
public static void main(String[] args) throws InterruptedException {
16+
try {
17+
Thread.startVirtualThread(() -> {
18+
int p = 21;
19+
System.out.println("From Virtual Thread");
20+
}).join();
21+
} catch (Exception e) {
22+
23+
}
24+
}
25+
}

org.eclipse.jdt.debug.tests/pom.xml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</parent>
1919
<groupId>org.eclipse.jdt</groupId>
2020
<artifactId>org.eclipse.jdt.debug.tests</artifactId>
21-
<version>3.12.600-SNAPSHOT</version>
21+
<version>3.12.650-SNAPSHOT</version>
2222
<packaging>eclipse-test-plugin</packaging>
2323
<properties>
2424
<testSuite>${project.artifactId}</testSuite>
@@ -65,5 +65,31 @@
6565
</plugins>
6666
</build>
6767
</profile>
68+
<profile>
69+
<id>test-on-javase-24</id>
70+
<build>
71+
<plugins>
72+
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
74+
<artifactId>maven-toolchains-plugin</artifactId>
75+
<executions>
76+
<execution>
77+
<phase>validate</phase>
78+
<goals>
79+
<goal>toolchain</goal>
80+
</goals>
81+
</execution>
82+
</executions>
83+
<configuration>
84+
<toolchains>
85+
<jdk>
86+
<id>JavaSE-24</id>
87+
</jdk>
88+
</toolchains>
89+
</configuration>
90+
</plugin>
91+
</plugins>
92+
</build>
93+
</profile>
6894
</profiles>
6995
</project>

org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2024 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -66,6 +66,7 @@ public class JavaProjectHelper {
6666
public static final String JAVA_SE_16_EE_NAME = "JavaSE-16";
6767
public static final String JAVA_SE_21_EE_NAME = "JavaSE-21";
6868
public static final String JAVA_SE_23_EE_NAME = "JavaSE-23";
69+
public static final String JAVA_SE_24_EE_NAME = "JavaSE-24";
6970

7071
/**
7172
* path to the test src for 'testprograms'
@@ -100,6 +101,10 @@ public class JavaProjectHelper {
100101
* path to the 23 test source
101102
*/
102103
public static final IPath TEST_23_SRC_DIR = new Path("java23");
104+
/**
105+
* path to the 24 test source
106+
*/
107+
public static final IPath TEST_24_SRC_DIR = new Path("java24");
103108

104109
/**
105110
* path to the compiler error java file
@@ -189,6 +194,15 @@ public static boolean isJava23_Compatible() {
189194
return isCompatible(23);
190195
}
191196

197+
/**
198+
* Returns if the currently running VM is version compatible with Java 24
199+
*
200+
* @return <code>true</code> if a Java 24 (or greater) VM is running <code>false</code> otherwise
201+
*/
202+
public static boolean isJava24_Compatible() {
203+
return isCompatible(24);
204+
}
205+
192206
/**
193207
* Returns if the current running system is compatible with the given Java minor version
194208
*

org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation
181181
public static final String ONESIX_PROJECT_NAME = "One_Six";
182182
public static final String TWENTYONE_PROJECT_NAME = "Two_One";
183183
public static final String TWENTYTHREE_PROJECT_NAME = "Two_Three";
184+
public static final String TWENTYFOUR_PROJECT_NAME = "Two_Four";
184185
public static final String BOUND_JRE_PROJECT_NAME = "BoundJRE";
185186
public static final String CLONE_SUFFIX = "Clone";
186187

@@ -241,6 +242,7 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation
241242
private static boolean loaded16_ = false;
242243
private static boolean loaded21 = false;
243244
private static boolean loaded23 = false;
245+
private static boolean loaded24 = false;
244246
private static boolean loadedEE = false;
245247
private static boolean loadedJRE = false;
246248
private static boolean loadedMulti = false;
@@ -622,20 +624,15 @@ synchronized void assert21Project() {
622624
}
623625
}
624626

625-
/**
626-
* Creates the Java 23 compliant project
627-
*/
628627
synchronized void assert23Project() {
629628
IJavaProject jp = null;
630629
ArrayList<ILaunchConfiguration> cfgs = new ArrayList<>(1);
631630
try {
632631
if (!loaded23) {
633632
jp = createProject(TWENTYTHREE_PROJECT_NAME, JavaProjectHelper.TEST_23_SRC_DIR.toString(), JavaProjectHelper.JAVA_SE_23_EE_NAME, false);
634-
jp.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
635633
jp.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_23);
636634
jp.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_23);
637-
cfgs.add(createLaunchConfiguration(jp, "Main1"));
638-
cfgs.add(createLaunchConfiguration(jp, "Main2"));
635+
cfgs.add(createLaunchConfiguration(jp, "Main21"));
639636
loaded23 = true;
640637
waitForBuild();
641638
assertNoErrorMarkersExist(jp.getProject());
@@ -655,6 +652,41 @@ synchronized void assert23Project() {
655652
}
656653
}
657654

655+
/**
656+
* Creates the Java 24 compliant project
657+
*/
658+
synchronized void assert24Project() {
659+
IJavaProject jp = null;
660+
ArrayList<ILaunchConfiguration> cfgs = new ArrayList<>(1);
661+
try {
662+
if (!loaded24) {
663+
jp = createProject(TWENTYFOUR_PROJECT_NAME, JavaProjectHelper.TEST_24_SRC_DIR.toString(), JavaProjectHelper.JAVA_SE_24_EE_NAME, false);
664+
jp.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
665+
jp.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_24);
666+
jp.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_24);
667+
jp.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_24);
668+
cfgs.add(createLaunchConfiguration(jp, "Main1"));
669+
cfgs.add(createLaunchConfiguration(jp, "Main2"));
670+
cfgs.add(createLaunchConfiguration(jp, "Main21"));
671+
loaded24 = true;
672+
waitForBuild();
673+
assertNoErrorMarkersExist(jp.getProject());
674+
}
675+
} catch (Exception e) {
676+
try {
677+
if (jp != null) {
678+
jp.getProject().delete(true, true, null);
679+
for (int i = 0; i < cfgs.size(); i++) {
680+
cfgs.get(i).delete();
681+
}
682+
}
683+
} catch (CoreException ce) {
684+
// ignore
685+
}
686+
handleProjectCreationException(e, TWENTYFOUR_PROJECT_NAME, jp);
687+
}
688+
}
689+
658690
/**
659691
* Creates the 'BoundJRE' project used for the JRE testing
660692
*/
@@ -696,9 +728,9 @@ void assertBoundeEeProject() {
696728
JavaProjectHelper.addSourceContainer(jp, JavaProjectHelper.SRC_DIR, JavaProjectHelper.BIN_DIR);
697729

698730
// add VM specific JRE container
699-
IExecutionEnvironment j2se14 = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(JavaProjectHelper.JAVA_SE_1_8_EE_NAME);
700-
assertNotNull("Missing J2SE-1.4 environment", j2se14);
701-
IPath path = JavaRuntime.newJREContainerPath(j2se14);
731+
IExecutionEnvironment javase1_8 = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(JavaProjectHelper.JAVA_SE_1_8_EE_NAME);
732+
assertNotNull("Missing JavaSE-1.8 environment", javase1_8);
733+
IPath path = JavaRuntime.newJREContainerPath(javase1_8);
702734
JavaProjectHelper.addContainerEntry(jp, path);
703735
loadedEE = true;
704736
waitForBuild();
@@ -961,6 +993,16 @@ protected IJavaProject get23Project() {
961993
return getJavaProject(TWENTYTHREE_PROJECT_NAME);
962994
}
963995

996+
/**
997+
* Returns the 'Two_Four' project, used for Java 24 tests.
998+
*
999+
* @return the test project
1000+
*/
1001+
protected IJavaProject get24Project() {
1002+
assert24Project();
1003+
return getJavaProject(TWENTYFOUR_PROJECT_NAME);
1004+
}
1005+
9641006
/**
9651007
* Returns the 'BoundJRE' project
9661008
*

org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public AutomatedSuite() {
199199
addTest(new TestSuite(ConfigurationEncodingTests.class));
200200
addTest(new TestSuite(LaunchConfigurationManagerTests.class));
201201
addTest(new TestSuite(LaunchConfigurationTests.class));
202-
if (JavaProjectHelper.isJava23_Compatible()) {
202+
if (JavaProjectHelper.isJava24_Compatible()) {
203203
addTest(new TestSuite(InstanceMainMethodsTests.class));
204204
}
205205
addTest(new TestSuite(ProjectClasspathVariableTests.class));
@@ -420,7 +420,7 @@ public AutomatedSuite() {
420420
if (JavaProjectHelper.isJava16_Compatible()) {
421421
addTest(new TestSuite(RecordBreakpointTests.class));
422422
}
423-
if (Runtime.version().feature() == 23 && JavaProjectHelper.isJava23_Compatible()) {
423+
if (JavaProjectHelper.isJava23_Compatible()) {
424424
addTest(new TestSuite(VirtualThreadsDebugViewTests.class));
425425
}
426426
}

0 commit comments

Comments
 (0)