Skip to content

Commit

Permalink
Update target platform to newer 4.33-I-builds (I20240716-1800).
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
rgrunber committed Jul 19, 2024
1 parent 2d99976 commit 9ba5c1e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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;
}

}
2 changes: 0 additions & 2 deletions org.eclipse.jdt.ls.product/languageServer.product
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
<plugin id="org.eclipse.core.filesystem"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.net"/>
<plugin id="org.eclipse.core.net.linux" fragment="true"/>
<plugin id="org.eclipse.core.net.win32" fragment="true"/>
<plugin id="org.eclipse.core.resources"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.variables"/>
Expand Down
2 changes: 0 additions & 2 deletions org.eclipse.jdt.ls.product/syntaxServer.product
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
<plugin id="org.eclipse.core.filesystem"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.net"/>
<plugin id="org.eclipse.core.net.linux" fragment="true"/>
<plugin id="org.eclipse.core.net.win32" fragment="true"/>
<plugin id="org.eclipse.core.resources"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.variables"/>
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<unit id="org.mockito.mockito-core" version="0.0.0"/>
<unit id="org.apache.commons.commons-io" version="0.0.0"/>
<unit id="org.eclipse.jdt.apt.pluggable.core" version="0.0.0"/>
<repository location="https://download.eclipse.org/eclipse/updates/4.33-I-builds/I20240621-0030/"/>
<repository location="https://download.eclipse.org/eclipse/updates/4.33-I-builds/I20240716-1800/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jdt.core.compiler.batch" version="0.0.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Diagnostic> diagnostics = DiagnosticsHandler.toDiagnosticsArray(cu, Arrays.asList(problems), true);
assertEquals(2, diagnostics.size());
assertEquals(1, diagnostics.size());
List<DiagnosticTag> tags = diagnostics.get(0).getTags();
assertEquals(1, tags.size());
assertEquals(DiagnosticTag.Deprecated, tags.get(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void setup() throws Exception {

private void setOptions() {
Hashtable<String, String> options = TestOptions.getDefaultOptions();
JavaCore.setComplianceOptions("16", options);
JavaCore.setComplianceOptions("17", options);
semanticTokensProject.setOptions(options);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ba5c1e

Please sign in to comment.