jdks - minor cleanup, resolve note

IDEA-225308

GitOrigin-RevId: 5b01b2fa3143c18bb3c26dc9f38aab8d17342e71
This commit is contained in:
Eugene Petrenko
2019-10-24 01:01:01 +02:00
committed by intellij-monorepo-bot
parent 7932f60c1a
commit 856fdacfdb

View File

@@ -91,8 +91,7 @@ class JDKDownloader {
}
fun downloadModel(progress: ProgressIndicator?): JDKDownloadModel {
//use HTTP caches here, in-memory only
//note we use 3 copies of data here: String, JSON and Model (first two should GC)
//the file is ~15k, in-memory only via JSON tree, no caches needed
val rawData = HttpRequests.request(feedUrl).forceHttps(true).readString(progress)
val tree = om.readTree(rawData) as? ObjectNode ?: error("Unexpected JSON data")
val items = tree["jdks"] as? ArrayNode ?: error("`jdks` element is missing")