From 363852022e6795514a6f133ff0a5d0a06ae8cd10 Mon Sep 17 00:00:00 2001 From: Anusree Lakshmi Date: Tue, 28 Jan 2025 11:13:27 +0530 Subject: [PATCH] Removed the try-catch block for URISyntaxException and added it to the throws clause --- .../jaxrs/java/JaxRsWorkspaceSymbolParticipant.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 6fd6e9ed8..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 @@ -108,18 +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; - try { - url = new URI(methodInfo.getUrl()).toURL(); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } + URL url = new URI(methodInfo.getUrl()).toURL(); String path = url.getPath(); nameBuilder.append(path); nameBuilder.append(": ");