Skip to content

Commit f05f269

Browse files
authored
Merge BETA_JAVA26 to Master
#915
2 parents ad74e77 + f18f511 commit f05f269

16 files changed

Lines changed: 175 additions & 17 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 'openjdk-jdk25-latest'
13+
jdk 'openjdk-jdk26-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-25 -Pbree-libs -Papi-check -Pjavadoc\
24+
-Ptest-on-javase-26 -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/JDT Debug Test Suite.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
2828
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
2929
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
30-
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25"/>
30+
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-26"/>
3131
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jdt.debug.tests.AutomatedSuite"/>
3232
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
3333
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jdt.debug.tests"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ bin.includes = plugin.xml,\
2828
java16_/,\
2929
java23/,\
3030
java24/,\
31-
java25/,\
31+
java26/,\
3232
multirelease/
3333
source.javadebugtests.jar = test plugin/,\
3434
tests/,\
File renamed without changes.
File renamed without changes.

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

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2012, 2024 Eclipse Foundation and others.
3+
Copyright (c) 2012, 2026 Eclipse Foundation and others.
44
All rights reserved. This program and the accompanying materials
55
are made available under the terms of the Eclipse Distribution License v1.0
66
which accompanies this distribution, and is available at
@@ -117,5 +117,31 @@
117117
</plugins>
118118
</build>
119119
</profile>
120+
<profile>
121+
<id>test-on-javase-26</id>
122+
<build>
123+
<plugins>
124+
<plugin>
125+
<groupId>org.apache.maven.plugins</groupId>
126+
<artifactId>maven-toolchains-plugin</artifactId>
127+
<executions>
128+
<execution>
129+
<phase>validate</phase>
130+
<goals>
131+
<goal>toolchain</goal>
132+
</goals>
133+
</execution>
134+
</executions>
135+
<configuration>
136+
<toolchains>
137+
<jdk>
138+
<id>JavaSE-26</id>
139+
</jdk>
140+
</toolchains>
141+
</configuration>
142+
</plugin>
143+
</plugins>
144+
</build>
145+
</profile>
120146
</profiles>
121147
</project>

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public class JavaProjectHelper {
6969
public static final String JAVA_SE_23_EE_NAME = "JavaSE-23";
7070
public static final String JAVA_SE_24_EE_NAME = "JavaSE-24";
7171
public static final String JAVA_SE_25_EE_NAME = "JavaSE-25";
72+
public static final String JAVA_SE_26_EE_NAME = "JavaSE-26";
7273

7374
/**
7475
* path to the test src for 'testprograms'
@@ -112,6 +113,11 @@ public class JavaProjectHelper {
112113
*/
113114
public static final IPath TEST_25_SRC_DIR = new Path("java25");
114115

116+
/**
117+
* path to the 26 test source
118+
*/
119+
public static final IPath TEST_26_SRC_DIR = new Path("java26");
120+
115121
/**
116122
* path to the multirelease test source
117123
*/
@@ -223,6 +229,15 @@ public static boolean isJava25_Compatible() {
223229
return isCompatible(25);
224230
}
225231

232+
/**
233+
* Returns if the currently running VM is version compatible with Java 26
234+
*
235+
* @return <code>true</code> if a Java 26 (or greater) VM is running <code>false</code> otherwise
236+
*/
237+
public static boolean isJava26_Compatible() {
238+
return isCompatible(26);
239+
}
240+
226241
/**
227242
* Returns if the current running system is compatible with the given Java minor version
228243
*

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

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation
192192
public static final String TWENTYTHREE_PROJECT_NAME = "Two_Three";
193193
public static final String TWENTYFOUR_PROJECT_NAME = "Two_Four";
194194
public static final String TWENTYFIVE_PROJECT_NAME = "Two_Five";
195+
public static final String TWENTYSIX_PROJECT_NAME = "Two_Six";
195196
public static final String BOUND_JRE_PROJECT_NAME = "BoundJRE";
196197
public static final String MR_PROJECT_NAME = "MR";
197198
public static final String CLONE_SUFFIX = "Clone";
@@ -256,11 +257,13 @@ public abstract class AbstractDebugTest extends TestCase implements IEvaluation
256257
private static boolean loaded23 = false;
257258
private static boolean loaded24 = false;
258259
private static boolean loaded25 = false;
260+
private static boolean loaded26 = false;
259261
private static boolean loadedEE = false;
260262
private static boolean loadedJRE = false;
261263
private static boolean loadedMulti = false;
262264
private static boolean loadedMR;
263265
private static boolean welcomeClosed = false;
266+
protected boolean isJRE26plus = false;
264267

265268
/**
266269
* Constructor
@@ -270,6 +273,10 @@ public AbstractDebugTest(String name) {
270273
// set error dialog to non-blocking to avoid hanging the UI during test
271274
ErrorDialog.AUTOMATED_MODE = true;
272275
SafeRunnable.setIgnoreErrors(true);
276+
String javaVersion = System.getProperty("java.version");
277+
if (javaVersion.startsWith("26")) {
278+
isJRE26plus = true;
279+
}
273280
}
274281

275282
@Override
@@ -371,6 +378,11 @@ synchronized void assert14Project() {
371378
handleProjectCreationException(e, ONE_FOUR_PROJECT_CLOSED_NAME, jp);
372379
}
373380
jp = createProject(ONE_FOUR_PROJECT_NAME, JavaProjectHelper.TEST_SRC_DIR.toString(), JavaProjectHelper.JAVA_SE_1_8_EE_NAME, false);
381+
if (isJRE26plus) {
382+
// these files cannot be compiled against 26+
383+
jp.getProject().getFile("src/AppletImpl.java").delete(true, null);
384+
jp.getProject().getFile("src/RunnableAppletImpl.java").delete(true, null);
385+
}
374386
IPackageFragmentRoot src = jp.findPackageFragmentRoot(new Path(ONE_FOUR_PROJECT_NAME).append(JavaProjectHelper.SRC_DIR).makeAbsolute());
375387
assertNotNull("The 'src' package fragment root should not be null", src);
376388
File root = JavaTestPlugin.getDefault().getFileInPlugin(new Path("testjars"));
@@ -750,7 +762,7 @@ synchronized void assert25Project() {
750762
try {
751763
if (!loaded25) {
752764
jp = createProject(TWENTYFIVE_PROJECT_NAME, JavaProjectHelper.TEST_25_SRC_DIR.toString(), JavaProjectHelper.JAVA_SE_25_EE_NAME, false);
753-
jp.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
765+
jp.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.DISABLED);
754766
jp.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_25);
755767
jp.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_25);
756768
jp.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_25);
@@ -775,6 +787,36 @@ synchronized void assert25Project() {
775787
}
776788
}
777789

790+
synchronized void assert26Project() {
791+
IJavaProject jp = null;
792+
ArrayList<ILaunchConfiguration> cfgs = new ArrayList<>(1);
793+
try {
794+
if (!loaded26) {
795+
jp = createProject(TWENTYSIX_PROJECT_NAME, JavaProjectHelper.TEST_26_SRC_DIR.toString(), JavaProjectHelper.JAVA_SE_26_EE_NAME, false);
796+
jp.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.DISABLED);
797+
jp.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_26);
798+
jp.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_26);
799+
jp.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_26);
800+
cfgs.add(createLaunchConfiguration(jp, "Main1"));
801+
cfgs.add(createLaunchConfiguration(jp, "Main2"));
802+
loaded26 = true;
803+
waitForBuild();
804+
assertNoErrorMarkersExist(jp.getProject());
805+
}
806+
} catch (Exception e) {
807+
try {
808+
if (jp != null) {
809+
jp.getProject().delete(true, true, null);
810+
for (int i = 0; i < cfgs.size(); i++) {
811+
cfgs.get(i).delete();
812+
}
813+
}
814+
} catch (CoreException ce) {
815+
// ignore
816+
}
817+
handleProjectCreationException(e, TWENTYSIX_PROJECT_NAME, jp);
818+
}
819+
}
778820
/**
779821
* Creates the 'BoundJRE' project used for the JRE testing
780822
*/
@@ -1111,6 +1153,16 @@ protected IJavaProject get25Project() {
11111153
return getJavaProject(TWENTYFIVE_PROJECT_NAME);
11121154
}
11131155

1156+
/**
1157+
* Returns the 'Two_Six' project, used for Java 26 tests.
1158+
*
1159+
* @return the test project
1160+
*/
1161+
protected IJavaProject get26Project() {
1162+
assert26Project();
1163+
return getJavaProject(TWENTYSIX_PROJECT_NAME);
1164+
}
1165+
11141166
/**
11151167
* Returns the 'BoundJRE' project
11161168
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public AutomatedSuite() {
204204
addTest(new TestSuite(ConfigurationEncodingTests.class));
205205
addTest(new TestSuite(LaunchConfigurationManagerTests.class));
206206
addTest(new TestSuite(LaunchConfigurationTests.class));
207-
if (JavaProjectHelper.isJava25_Compatible()) {
207+
if (JavaProjectHelper.isJava26_Compatible()) {
208208
addTest(new TestSuite(InstanceMainMethodsTests.class));
209209
}
210210
addTest(new TestSuite(ProjectClasspathVariableTests.class));

org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/ConditionalBreakpointsWithFileClass.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ public void testFileConditionalBreakpointforTrue() throws Exception {
6565
mainThread = launchToBreakpoint(typeName);
6666
mainThread.getTopStackFrame().stepInto();
6767

68-
if (JavaProjectHelper.isJava25_Compatible()) {
68+
if (isJRE26plus) {
69+
bp2 = createConditionalLineBreakpoint(374, "java.io.File", "true", true);
70+
} else if (JavaProjectHelper.isJava25_Compatible()) {
6971
bp2 = createConditionalLineBreakpoint(369, "java.io.File", "true", true);
7072
} else {
7173
bp2 = createConditionalLineBreakpoint(364, "java.io.File", "true", true);
@@ -77,7 +79,9 @@ public void testFileConditionalBreakpointforTrue() throws Exception {
7779
waiter.waitForEvent();
7880
assertTrue("Thread should be suspended", mainThread.isSuspended());
7981
hitLine = mainThread.getStackFrames()[0].getLineNumber();
80-
if (JavaProjectHelper.isJava25_Compatible()) {
82+
if (isJRE26plus) {
83+
assertEquals("Didn't suspend at the expected line", 374, hitLine);
84+
} else if (JavaProjectHelper.isJava25_Compatible()) {
8185
assertEquals("Didn't suspend at the expected line", 369, hitLine);
8286
} else {
8387
assertEquals("Didn't suspend at the expected line", 364, hitLine);

0 commit comments

Comments
 (0)