Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated constructor 'URL.<init>(String)' changed to URI.toURL #1237

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024 Red Hat Inc. and others.
* Copyright (c) 2024, 2025 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -28,7 +28,9 @@
import org.eclipse.lsp4j.SymbolKind;

import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -106,13 +108,13 @@ private static Set<PsiClass> getAllJaxRsTypes(Module javaProject, IPsiUtils util
return jaxrsTypes;
}

private static SymbolInformation createSymbol(JaxRsMethodInfo methodInfo, IPsiUtils utils) throws MalformedURLException {
private static SymbolInformation createSymbol(JaxRsMethodInfo methodInfo, IPsiUtils utils) throws MalformedURLException, URISyntaxException {
TextRange sourceRange = methodInfo.getJavaMethod().getNameIdentifier().getTextRange();
Range r = utils.toRange(methodInfo.getJavaMethod(), sourceRange.getStartOffset(), sourceRange.getLength());
Location location = new Location(methodInfo.getDocumentUri(), r);

StringBuilder nameBuilder = new StringBuilder("@");
URL url = new URL(methodInfo.getUrl());
URL url = new URI(methodInfo.getUrl()).toURL();
String path = url.getPath();
nameBuilder.append(path);
nameBuilder.append(": ");
Expand Down
Loading