mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
Fix non-closed readers
(cherry picked from commit 67143d5d08f607959bf7bfc8bff4f9f7e6ae1db7) IJ-CR-122485 GitOrigin-RevId: cf14cb341278a6fb02690a5108ace56c34b450f9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bb0a671865
commit
04b1b89032
@@ -129,8 +129,9 @@ class YamlInspectionProfileImpl private constructor(override val profileName: St
|
||||
}
|
||||
|
||||
|
||||
|
||||
return loadFrom(configFile.reader(), includeProvider, toolsSupplier, profileManager)
|
||||
return configFile.reader().use { reader ->
|
||||
loadFrom(reader, includeProvider, toolsSupplier, profileManager)
|
||||
}
|
||||
}
|
||||
|
||||
private fun findBaseProfile(profileManager: InspectionProfileManager, profileName: String?): InspectionProfileImpl {
|
||||
|
||||
@@ -70,7 +70,9 @@ private fun readRaw(reader: Reader, includeReaders: (Path) -> Reader): Map<Strin
|
||||
val includedConfigs = (rawConfig["include"] as? List<*>)?.filterIsInstance(String::class.java).orEmpty().map { Paths.get(it) }
|
||||
|
||||
return includedConfigs.fold(rawConfig) { accumulator, path ->
|
||||
val includedYaml = readRaw(includeReaders.invoke(path)) { includeReaders.invoke(path.resolveSibling(it)) }
|
||||
val includedYaml = includeReaders.invoke(path).use { includeReader ->
|
||||
readRaw(includeReader) { includeReaders.invoke(path.resolveSibling(it)) }
|
||||
}
|
||||
merge(accumulator, includedYaml.filterKeys { field -> field in FIELDS_TO_MERGE })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user