Skip to content

Commit 1781d55

Browse files
committed
Update Java 22 tests
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
1 parent 25d7a0b commit 1781d55

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<unit id="org.eclipse.jdt.core.compiler.batch" version="0.0.0"/>
3232
<unit id="org.eclipse.jdt.core" version="0.0.0"/>
3333
<unit id="org.eclipse.jdt.apt.core" version="0.0.0"/>
34-
<repository location="https://download.eclipse.org/eclipse/updates/4.32-I-builds/I20240325-1800/"/>
34+
<repository location="https://download.eclipse.org/jdtls/jdt-core-incubator/snapshots/"/>
3535
</location>
3636
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
3737
<unit id="org.eclipse.xtext.xbase.lib" version="0.0.0"/>

org.eclipse.jdt.ls.tests/projects/eclipse/java22/src/main/java/foo/bar/Foo.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
/**
44
* It's a Foo class
55
*/
6-
public sealed interface Foo
7-
permits Bar {
6+
public class Foo {
7+
public Foo() {
8+
System.out.println();
9+
super();
10+
}
811
}
9-
record Bar(String name) implements Foo { }

org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/correction/ModifierCorrectionsQuickFixTest.java

+9-15
Original file line numberDiff line numberDiff line change
@@ -1203,11 +1203,9 @@ public void testClassExtendFinalClass() throws Exception {
12031203

12041204
@Test
12051205
public void testAddSealedMissingClassModifierProposal() throws Exception {
1206-
Map<String, String> options22 = new HashMap<>();
1207-
JavaModelUtil.setComplianceOptions(options22, JavaCore.VERSION_22);
1208-
options22.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
1209-
options22.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
1210-
fJProject.setOptions(options22);
1206+
Map<String, String> options17 = new HashMap<>();
1207+
JavaModelUtil.setComplianceOptions(options17, JavaCore.VERSION_17);
1208+
fJProject.setOptions(options17);
12111209
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test", false, null);
12121210
assertNoErrors(fJProject.getResource());
12131211

@@ -1250,11 +1248,9 @@ public void testAddSealedMissingClassModifierProposal() throws Exception {
12501248

12511249
@Test
12521250
public void testAddSealedAsDirectSuperClass() throws Exception {
1253-
Map<String, String> options22 = new HashMap<>();
1254-
JavaModelUtil.setComplianceOptions(options22, JavaCore.VERSION_22);
1255-
options22.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
1256-
options22.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
1257-
fJProject.setOptions(options22);
1251+
Map<String, String> options17 = new HashMap<>();
1252+
JavaModelUtil.setComplianceOptions(options17, JavaCore.VERSION_17);
1253+
fJProject.setOptions(options17);
12581254
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test", false, null);
12591255
assertNoErrors(fJProject.getResource());
12601256

@@ -1279,11 +1275,9 @@ public void testAddSealedAsDirectSuperClass() throws Exception {
12791275

12801276
@Test
12811277
public void testAddPermitsToDirectSuperClass() throws Exception {
1282-
Map<String, String> options22 = new HashMap<>();
1283-
JavaModelUtil.setComplianceOptions(options22, JavaCore.VERSION_22);
1284-
options22.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
1285-
options22.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
1286-
fJProject.setOptions(options22);
1278+
Map<String, String> options17 = new HashMap<>();
1279+
JavaModelUtil.setComplianceOptions(options17, JavaCore.VERSION_17);
1280+
fJProject.setOptions(options17);
12871281
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test", false, null);
12881282
assertNoErrors(fJProject.getResource());
12891283

org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/correction/UnresolvedTypesQuickFixTest.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -1492,11 +1492,9 @@ public void testDontImportTestClassesInMainCode() throws Exception {
14921492

14931493
@Test
14941494
public void testTypeInSealedTypeDeclaration() throws Exception {
1495-
Map<String, String> options22 = new HashMap<>();
1496-
JavaModelUtil.setComplianceOptions(options22, JavaCore.VERSION_22);
1497-
options22.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
1498-
options22.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
1499-
fJProject1.setOptions(options22);
1495+
Map<String, String> options17 = new HashMap<>();
1496+
JavaModelUtil.setComplianceOptions(options17, JavaCore.VERSION_17);
1497+
fJProject1.setOptions(options17);
15001498

15011499
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
15021500
StringBuilder buf = new StringBuilder();

0 commit comments

Comments
 (0)