From 9ba5c1e194dc607ae6dda53f55f7cb89e2a217fa Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Wed, 17 Jul 2024 16:07:09 -0400 Subject: [PATCH] Update target platform to newer 4.33-I-builds (I20240716-1800). - Adjust deprecation test due to eclipse-jdt/eclipse.jdt.core#2679 - Ensure Java 17 compliance is used for projects with sealed classes - core.net fragments merged into host eclipse-platform/eclipse.platform#1440 Signed-off-by: Roland Grunberg --- .../proposals/TypeMismatchSubProcessor.java | 12 ++++++++++-- org.eclipse.jdt.ls.product/languageServer.product | 2 -- org.eclipse.jdt.ls.product/syntaxServer.product | 2 -- .../org.eclipse.jdt.ls.tp.target | 2 +- .../projects/maven/semantic-tokens/pom.xml | 4 ++-- .../internal/handlers/CompletionHandlerTest.java | 2 +- .../internal/handlers/DiagnosticHandlerTest.java | 3 ++- .../internal/handlers/SemanticTokensHandlerTest.java | 2 +- .../managers/EclipseProjectImporterTest.java | 2 +- 9 files changed, 18 insertions(+), 13 deletions(-) diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corrections/proposals/TypeMismatchSubProcessor.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corrections/proposals/TypeMismatchSubProcessor.java index a797f92711..58f3dba5ae 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corrections/proposals/TypeMismatchSubProcessor.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corrections/proposals/TypeMismatchSubProcessor.java @@ -40,8 +40,6 @@ import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; -import org.eclipse.jdt.ui.text.java.IInvocationContext; -import org.eclipse.jdt.ui.text.java.IProblemLocation; import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance; import org.eclipse.jdt.internal.ui.text.correction.TypeMismatchBaseSubProcessor; import org.eclipse.jdt.internal.ui.text.correction.proposals.CastCorrectionProposalCore; @@ -55,6 +53,8 @@ import org.eclipse.jdt.ls.core.internal.corrections.CorrectionMessages; import org.eclipse.jdt.ls.core.internal.corrections.ProposalKindWrapper; import org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler; +import org.eclipse.jdt.ui.text.java.IInvocationContext; +import org.eclipse.jdt.ui.text.java.IProblemLocation; import org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposalCore; import org.eclipse.lsp4j.CodeActionKind; @@ -236,4 +236,12 @@ protected ProposalKindWrapper createIncompatibleForEachTypeProposal(String label return CodeActionHandler.wrap(proposal, CodeActionKind.QuickFix); } + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.ui.text.correction.TypeMismatchBaseSubProcessor#createChangeConstructorTypeProposal(org.eclipse.jdt.core.ICompilationUnit, org.eclipse.jdt.core.dom.ASTNode, org.eclipse.jdt.core.dom.CompilationUnit, org.eclipse.jdt.core.dom.ITypeBinding, int) + */ + @Override + protected ProposalKindWrapper createChangeConstructorTypeProposal(ICompilationUnit targetCu, ASTNode callerNode, CompilationUnit astRoot, ITypeBinding castTypeBinding, int relevance) { + return null; + } + } diff --git a/org.eclipse.jdt.ls.product/languageServer.product b/org.eclipse.jdt.ls.product/languageServer.product index acd8839f5b..189d6a782b 100644 --- a/org.eclipse.jdt.ls.product/languageServer.product +++ b/org.eclipse.jdt.ls.product/languageServer.product @@ -35,8 +35,6 @@ - - diff --git a/org.eclipse.jdt.ls.product/syntaxServer.product b/org.eclipse.jdt.ls.product/syntaxServer.product index 0b22d39ca1..3776e1eec6 100644 --- a/org.eclipse.jdt.ls.product/syntaxServer.product +++ b/org.eclipse.jdt.ls.product/syntaxServer.product @@ -30,8 +30,6 @@ - - diff --git a/org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target b/org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target index 3c3a7b9e54..9536b9b952 100644 --- a/org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target +++ b/org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target @@ -25,7 +25,7 @@ - + diff --git a/org.eclipse.jdt.ls.tests/projects/maven/semantic-tokens/pom.xml b/org.eclipse.jdt.ls.tests/projects/maven/semantic-tokens/pom.xml index 737b57c7a4..1209644e03 100644 --- a/org.eclipse.jdt.ls.tests/projects/maven/semantic-tokens/pom.xml +++ b/org.eclipse.jdt.ls.tests/projects/maven/semantic-tokens/pom.xml @@ -13,8 +13,8 @@ org.apache.maven.plugins maven-compiler-plugin - 11 - 11 + 17 + 17 diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java index b00471b4bb..3fcb81ae09 100644 --- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java +++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java @@ -2276,7 +2276,7 @@ public void testCompletion_type() throws Exception { assertEquals(CompletionItemKind.Class, ci.getKind()); assertEquals("ArrayList - java.util", ci.getLabel()); assertEquals("java.util.ArrayList", ci.getDetail()); - assertEquals("999999148", ci.getSortText()); + assertEquals("999999116", ci.getSortText()); assertNotNull(ci.getTextEdit().getLeft()); } diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/DiagnosticHandlerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/DiagnosticHandlerTest.java index f051d4340a..33e7af30da 100644 --- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/DiagnosticHandlerTest.java +++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/DiagnosticHandlerTest.java @@ -200,12 +200,13 @@ public void testDeprecated() throws Exception { StringBuilder buf = new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.security.Certificate;\n"); + buf.append("public interface E extends Certificate {}\n"); ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null); CompilationUnit astRoot = CoreASTProvider.getInstance().getAST(cu, CoreASTProvider.WAIT_YES, monitor); IProblem[] problems = astRoot.getProblems(); List diagnostics = DiagnosticsHandler.toDiagnosticsArray(cu, Arrays.asList(problems), true); - assertEquals(2, diagnostics.size()); + assertEquals(1, diagnostics.size()); List tags = diagnostics.get(0).getTags(); assertEquals(1, tags.size()); assertEquals(DiagnosticTag.Deprecated, tags.get(0)); diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/SemanticTokensHandlerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/SemanticTokensHandlerTest.java index b851e9e22d..4f9123e52b 100644 --- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/SemanticTokensHandlerTest.java +++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/SemanticTokensHandlerTest.java @@ -66,7 +66,7 @@ public void setup() throws Exception { private void setOptions() { Hashtable options = TestOptions.getDefaultOptions(); - JavaCore.setComplianceOptions("16", options); + JavaCore.setComplianceOptions("17", options); semanticTokensProject.setOptions(options); } diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/managers/EclipseProjectImporterTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/managers/EclipseProjectImporterTest.java index 705073da5b..c0b2640df5 100644 --- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/managers/EclipseProjectImporterTest.java +++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/managers/EclipseProjectImporterTest.java @@ -186,7 +186,7 @@ public void testPreviewFeatures16() throws Exception { importProjects("eclipse/" + name); IProject project = getProject(name); assertIsJavaProject(project); - assertHasErrors(project, "The Java feature 'Sealed Types' is only available with source level 17 and above"); + assertHasErrors(project, "Syntax error on token \"sealed\", static expected"); } @Test