diff --git a/src/main/java/io/openliberty/tools/intellij/lsp4mp4ij/psi/internal/jaxrs/java/JaxRsWorkspaceSymbolParticipant.java b/src/main/java/io/openliberty/tools/intellij/lsp4mp4ij/psi/internal/jaxrs/java/JaxRsWorkspaceSymbolParticipant.java index 068eb33e9..02041fe8b 100644 --- a/src/main/java/io/openliberty/tools/intellij/lsp4mp4ij/psi/internal/jaxrs/java/JaxRsWorkspaceSymbolParticipant.java +++ b/src/main/java/io/openliberty/tools/intellij/lsp4mp4ij/psi/internal/jaxrs/java/JaxRsWorkspaceSymbolParticipant.java @@ -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 @@ -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; @@ -106,13 +108,13 @@ private static Set 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(": ");