Do not cache contents in VFS when reading contents of .jar files
This follows the standard IDEA policy of caching file contents.
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ class ClsJavaStubByVirtualFileCache {
|
||||
if (file.fileType !== JavaClassFileType.INSTANCE) return null
|
||||
|
||||
try {
|
||||
return ClsFileImpl.buildFileStub(file, file.contentsToByteArray())
|
||||
return ClsFileImpl.buildFileStub(file, file.contentsToByteArray(false))
|
||||
}
|
||||
catch (e: ClsFormatException) {
|
||||
LOG.error("Failed to build java cls class for " + file.canonicalPath!!, e)
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ abstract class KotlinMetadataDecompiler<out V : BinaryVersion>(
|
||||
if (!file.isValid) return null
|
||||
|
||||
return try {
|
||||
readFile(file.contentsToByteArray(), file)
|
||||
readFile(file.contentsToByteArray(false), file)
|
||||
}
|
||||
catch (e: IOException) {
|
||||
// This is needed because sometimes we're given VirtualFile instances that point to non-existent .jar entries.
|
||||
|
||||
@@ -141,7 +141,7 @@ private fun readClassFileImpl(project: Project,
|
||||
|
||||
val fileFinder = VirtualFileFinder.getInstance(project)
|
||||
val classFile = fileFinder.findVirtualFileWithHeader(classId) ?: return null
|
||||
return classFile.contentsToByteArray()
|
||||
return classFile.contentsToByteArray(false)
|
||||
}
|
||||
|
||||
fun readFromOutput(isForTestClasses: Boolean): ByteArray? {
|
||||
|
||||
@@ -69,7 +69,7 @@ class KotlinDecompilerServiceImpl : KotlinDecompilerService {
|
||||
}.map { it.path to it }
|
||||
|
||||
return files.entries.associate {
|
||||
Pair(File(it.key), { it.value.contentsToByteArray() })
|
||||
Pair(File(it.key), { it.value.contentsToByteArray(false) })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user