Skip to content

Commit

Permalink
Revert ":wastebasket: 'constructor URL(String!, String!, Int, String!…
Browse files Browse the repository at this point in the history
…)' is deprecated. Deprecated in Java"

This reverts commit 57272f0.
  • Loading branch information
CephalonCosmic committed Dec 11, 2024
1 parent c4fdf09 commit 1b071e2
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import one.devos.yiski.module.loader.api.discovery.ModuleDiscoverer
import one.devos.yiski.module.loader.impl.ModuleLoader
import one.devos.yiski.module.loader.impl.logger
import one.devos.yiski.module.metadata.ModuleMetadata
import java.net.URI
import java.net.URL
import java.nio.file.Path
import java.nio.file.Paths
Expand All @@ -31,7 +30,7 @@ class ClasspathModuleDiscoverer : ModuleDiscoverer {
private fun fetchCodeSource(url: URL, path: String): Path {
val urlPath = url.path
if (urlPath.endsWith(path))
return Paths.get(URI(url.protocol, url.host, url.port.toString(), urlPath.substring(0, urlPath.length - path.length)))
return Paths.get(URL(url.protocol, url.host, url.port, urlPath.substring(0, urlPath.length - path.length)).toURI())

throw IllegalStateException("Failed to fetch code source for file \"$path\" inside \"$url\"!")
}
Expand Down

0 comments on commit 1b071e2

Please sign in to comment.