From 66a26625634ec73c3755b5dba2cf85e03a0b6a59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 09:50:26 +0000 Subject: [PATCH 1/2] Initial plan From ca6b6008c38ac7fe8201ede3da15fc85e01fc24e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 10:03:10 +0000 Subject: [PATCH 2/2] Replace deprecated new URL() constructor with URI parsing in Absolute.uri(String) - Use new URI(preprocessed) instead of new URL(preprocessed) for parsing - Use URI.toURL() for scheme validation (maintains fallback for unknown protocols) - Use URI.getPath() (decoded) instead of URLDecoder.decode(url.getPath()) - Pre-encode [, ], ^ chars that URI is strict about - Remove unused imports: java.net.URL, URLDecoder, StandardCharsets Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com> --- .../com/github/_1c_syntax/utils/Absolute.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/_1c_syntax/utils/Absolute.java b/src/main/java/com/github/_1c_syntax/utils/Absolute.java index 4146e2c..7db04ee 100644 --- a/src/main/java/com/github/_1c_syntax/utils/Absolute.java +++ b/src/main/java/com/github/_1c_syntax/utils/Absolute.java @@ -28,9 +28,6 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; -import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; import java.nio.file.Path; /** @@ -47,16 +44,23 @@ public final class Absolute { */ public static URI uri(String uri) { try { - var url = new URL(uri.replace("+", "%2B").replace("%%", "%25%")); - var decodedPath = URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8); + var preprocessed = uri + .replace("+", "%2B") + .replace("%%", "%25%") + .replace("[", "%5B") + .replace("]", "%5D") + .replace("^", "%5E"); + var parsedUri = new URI(preprocessed); + parsedUri.toURL(); + var decodedPath = parsedUri.getPath(); var decodedUri = new URI( - url.getProtocol(), - url.getUserInfo(), - url.getHost(), - url.getPort(), + parsedUri.getScheme(), + parsedUri.getUserInfo(), + parsedUri.getHost(), + parsedUri.getPort(), decodedPath, - url.getQuery(), - url.getRef() + parsedUri.getQuery(), + parsedUri.getFragment() ); return checkFileAuthorityAndReturnURI(decodedUri);