From bad0c91723dab5ca1a08c7b44a574d13dfd8524c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Wed, 11 Sep 2024 19:50:02 +0300 Subject: [PATCH] Fix compilation against 2024-09 --- .../corrosion/test/actions/OpenTestAction.java | 17 +++++++---------- .../newproject/NewCargoProjectWizardPage.java | 7 +++---- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/org.eclipse.corrosion/src/org/eclipse/corrosion/test/actions/OpenTestAction.java b/org.eclipse.corrosion/src/org/eclipse/corrosion/test/actions/OpenTestAction.java index d8d8dc8..a4879af 100644 --- a/org.eclipse.corrosion/src/org/eclipse/corrosion/test/actions/OpenTestAction.java +++ b/org.eclipse.corrosion/src/org/eclipse/corrosion/test/actions/OpenTestAction.java @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright (c) 2017, 2021 Red Hat Inc. and others. + * Copyright (c) 2017, 2024 Red Hat Inc. and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -12,7 +12,6 @@ *******************************************************************************/ package org.eclipse.corrosion.test.actions; -import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -70,12 +69,8 @@ public void run() { if (project == null) { return; } - LanguageServerWrapper languageServer = null; - try { - languageServer = LanguageServiceAccessor.getLSWrapper(project, CorrosionPlugin.languageServerDefinition()); - } catch (IOException ex) { - CorrosionPlugin.logError(ex); - } + LanguageServerWrapper languageServer = LanguageServiceAccessor.getLSWrapper(project, + CorrosionPlugin.languageServerDefinition()); if (languageServer == null) { return; } @@ -155,12 +150,14 @@ private static List getQualifiedSymbols(LanguageServerWrapper return parents; } - private static List getSymbols(LanguageServerWrapper languageServer, final String name, String parent, + private static List getSymbols(LanguageServerWrapper languageServer, final String name, + String parent, SymbolKind kind) { List result = new ArrayList<>(); WorkspaceSymbolParams params = new WorkspaceSymbolParams(name); - CompletableFuture, List>> symbols = languageServer.execute(ls -> ls.getWorkspaceService().symbol(params)); + CompletableFuture, List>> symbols = languageServer + .execute(ls -> ls.getWorkspaceService().symbol(params)); try { List items = (List) symbols.get(10, TimeUnit.SECONDS).get(); diff --git a/org.eclipse.corrosion/src/org/eclipse/corrosion/wizards/newproject/NewCargoProjectWizardPage.java b/org.eclipse.corrosion/src/org/eclipse/corrosion/wizards/newproject/NewCargoProjectWizardPage.java index 38a37b8..ba6d6a7 100644 --- a/org.eclipse.corrosion/src/org/eclipse/corrosion/wizards/newproject/NewCargoProjectWizardPage.java +++ b/org.eclipse.corrosion/src/org/eclipse/corrosion/wizards/newproject/NewCargoProjectWizardPage.java @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright (c) 2017, 2021 Red Hat Inc. and others. + * Copyright (c) 2017, 2024 Red Hat Inc. and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -39,7 +39,6 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; @@ -233,7 +232,7 @@ private void createLocationPart(Composite container) { linesAboveLinkLayoutData.heightHint = linesAboveLinkLayoutData.widthHint = 30; linesAboveLink.setLayoutData(linesAboveLinkLayoutData); linesAboveLink.addPaintListener(e -> { - e.gc.setForeground(((Control) e.widget).getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); + e.gc.setForeground(e.widget.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); e.gc.drawLine(0, e.height / 2, e.width / 2, e.height / 2); e.gc.drawLine(e.width / 2, e.height / 2, e.width / 2, e.height); }); @@ -277,7 +276,7 @@ private void createLocationPart(Composite container) { linesBelowLinkLayoutData.heightHint = linesBelowLinkLayoutData.widthHint = 30; linesBelowLink.setLayoutData(linesAboveLinkLayoutData); linesBelowLink.addPaintListener(e -> { - e.gc.setForeground(((Control) e.widget).getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); + e.gc.setForeground(e.widget.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); e.gc.drawLine(0, e.height / 2, e.width / 2, e.height / 2); e.gc.drawLine(e.width / 2, e.height / 2, e.width / 2, 0); });