Skip to content

Commit 126bed6

Browse files
committed
Remove withoutQuery
1 parent cc3700a commit 126bed6

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

server/src/main/kotlin/org/javacs/kt/externalsources/JarClassContentProvider.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,15 @@ class JarClassContentProvider(
5656
}
5757

5858
private fun tryReadContentOf(uri: KlsURI): Pair<String, String>? = try {
59-
val actualUri = uri.withoutQuery()
60-
when (actualUri.fileExtension) {
61-
"class" -> Pair(actualUri.extractToTemporaryFile(tempDir)
59+
when (uri.fileExtension) {
60+
"class" -> Pair(uri.extractToTemporaryFile(tempDir)
6261
.let(decompiler::decompileClass)
6362
.let { Files.newInputStream(it) }
6463
.bufferedReader()
6564
.use(BufferedReader::readText)
6665
.let(this::convertToKotlinIfNeeded), if (config.autoConvertToKotlin) "kt" else "java")
67-
"java" -> if (uri.source) Pair(actualUri.readContents(), "java") else Pair(convertToKotlinIfNeeded(actualUri.readContents()), "kt")
68-
else -> Pair(actualUri.readContents(), "kt") // e.g. for Kotlin source files
66+
"java" -> if (uri.source) Pair(uri.readContents(), "java") else Pair(convertToKotlinIfNeeded(uri.readContents()), "kt")
67+
else -> Pair(uri.readContents(), "kt") // e.g. for Kotlin source files
6968
}
7069
} catch (e: FileNotFoundException) { null }
7170
}

server/src/main/kotlin/org/javacs/kt/externalsources/KlsURI.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ data class KlsURI(val fileUri: URI, val query: Map<QueryParam, String>) {
7777
return KlsURI(fileUri, newQuery)
7878
}
7979

80-
fun withoutQuery(): KlsURI = KlsURI(fileUri, mapOf())
81-
8280
fun toURI(): URI = URI(fileUri.toString() + queryString)
8381

8482
private fun toJarURL(): URL = URL("jar:${fileUri.schemeSpecificPart}")

0 commit comments

Comments
 (0)