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
|
if (file.fileType !== JavaClassFileType.INSTANCE) return null
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return ClsFileImpl.buildFileStub(file, file.contentsToByteArray())
|
return ClsFileImpl.buildFileStub(file, file.contentsToByteArray(false))
|
||||||
}
|
}
|
||||||
catch (e: ClsFormatException) {
|
catch (e: ClsFormatException) {
|
||||||
LOG.error("Failed to build java cls class for " + file.canonicalPath!!, e)
|
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
|
if (!file.isValid) return null
|
||||||
|
|
||||||
return try {
|
return try {
|
||||||
readFile(file.contentsToByteArray(), file)
|
readFile(file.contentsToByteArray(false), file)
|
||||||
}
|
}
|
||||||
catch (e: IOException) {
|
catch (e: IOException) {
|
||||||
// This is needed because sometimes we're given VirtualFile instances that point to non-existent .jar entries.
|
// 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 fileFinder = VirtualFileFinder.getInstance(project)
|
||||||
val classFile = fileFinder.findVirtualFileWithHeader(classId) ?: return null
|
val classFile = fileFinder.findVirtualFileWithHeader(classId) ?: return null
|
||||||
return classFile.contentsToByteArray()
|
return classFile.contentsToByteArray(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun readFromOutput(isForTestClasses: Boolean): ByteArray? {
|
fun readFromOutput(isForTestClasses: Boolean): ByteArray? {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class KotlinDecompilerServiceImpl : KotlinDecompilerService {
|
|||||||
}.map { it.path to it }
|
}.map { it.path to it }
|
||||||
|
|
||||||
return files.entries.associate {
|
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