diff --git a/org.eclipse.xtend.core.tests/META-INF/MANIFEST.MF b/org.eclipse.xtend.core.tests/META-INF/MANIFEST.MF index 897da505875..6d8701fc553 100644 --- a/org.eclipse.xtend.core.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.xtend.core.tests/META-INF/MANIFEST.MF @@ -22,8 +22,7 @@ Require-Bundle: org.eclipse.xtend.core;bundle-version="2.38.0", org.objectweb.asm;bundle-version="[9.7.1,9.8.0)", org.eclipse.jdt.core;bundle-version="3.37.0", org.eclipse.xtext.builder.standalone;bundle-version="2.38.0", - org.eclipse.xtext.java;bundle-version="2.38.0", - org.eclipse.draw2d + org.eclipse.xtext.java;bundle-version="2.38.0" Import-Package: jakarta.inject;version="2.0.1", org.apache.log4j;version="1.2.24", org.apache.log4j.spi;version="1.2.24", diff --git a/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/validation/OverrideValidationTest.java b/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/validation/OverrideValidationTest.java index 346eb690bda..4917d42a962 100644 --- a/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/validation/OverrideValidationTest.java +++ b/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/validation/OverrideValidationTest.java @@ -18,9 +18,7 @@ import org.eclipse.xtend.core.xtend.XtendClass; import org.eclipse.xtend.core.xtend.XtendInterface; import org.eclipse.xtext.testing.validation.ValidationTestHelper; -import org.eclipse.xtext.util.JavaRuntimeVersion; import org.eclipse.xtext.xbase.XbasePackage; -import org.junit.Assume; import org.junit.Test; import com.google.inject.Inject; @@ -1068,18 +1066,11 @@ public void testClassMustBeAbstract_06() throws Exception { helper.assertNoWarnings(xtendClass, XTEND_FUNCTION, MISSING_SYNCHRONIZED); } - /** - * Since there's no record in the JDK and adding a Java source with a record in this - * project would require Java 21 compilation level, I'm using a known record from - * draw2d, which is in our target platform. - */ @Test public void testOverrideJavaRecord() throws Exception { - Assume.assumeTrue("Active only on Java 21 and later", JavaRuntimeVersion.isJava21OrLater()); - var javaRecord = "org.eclipse.draw2d.geometry.Interval"; - var source = "class Foo extends " + javaRecord + " { }"; + var source = "class Foo extends test.SomeRecord { }"; XtendClass xtendClass = clazz(source); helper.assertError(xtendClass, XTEND_CLASS, OVERRIDDEN_FINAL, - source.indexOf(javaRecord), javaRecord.length(), + source.indexOf("test.SomeRecord"), "test.SomeRecord".length(), "override", "final"); } diff --git a/org.eclipse.xtend.core.tests/testdata/test/SomeRecord.java b/org.eclipse.xtend.core.tests/testdata/test/SomeRecord.java new file mode 100644 index 00000000000..9fd25392255 --- /dev/null +++ b/org.eclipse.xtend.core.tests/testdata/test/SomeRecord.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright (c) 2024 Lorenzo Bettini and others. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package test; + +/** + * @author Lorenzo Bettini - Initial contribution and API + */ +public record SomeRecord() { + +}