Minor, remove unnecessary logging for valid erroneous case
It seems that it's normal for VirtualFile in this place to be invalid in this way
This commit is contained in:
+2
-8
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.decompiler.js
|
package org.jetbrains.kotlin.idea.decompiler.js
|
||||||
|
|
||||||
import com.intellij.openapi.diagnostic.Logger
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile
|
import com.intellij.openapi.vfs.VirtualFile
|
||||||
import com.intellij.psi.FileViewProvider
|
import com.intellij.psi.FileViewProvider
|
||||||
import com.intellij.psi.PsiManager
|
import com.intellij.psi.PsiManager
|
||||||
@@ -51,10 +50,6 @@ class KotlinJavaScriptMetaFileDecompiler : ClassFileDecompilers.Full() {
|
|||||||
KtDecompiledFile(provider, ::buildDecompiledTextFromJsMetadata)
|
KtDecompiledFile(provider, ::buildDecompiledTextFromJsMetadata)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
|
||||||
internal val LOG = Logger.getInstance(KotlinJavaScriptMetaFileDecompiler::class.java)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private val decompilerRendererForJS = DescriptorRenderer.withOptions { defaultDecompilerRendererOptions() }
|
private val decompilerRendererForJS = DescriptorRenderer.withOptions { defaultDecompilerRendererOptions() }
|
||||||
@@ -125,9 +120,8 @@ sealed class KjsmFile {
|
|||||||
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.
|
||||||
// Such files are valid (isValid() returns true), but an attempt to read their contents results in a FileNotFoundException.
|
// Such files are valid (isValid() returns true), but an attempt to read their contents results in a FileNotFoundException.
|
||||||
// This looks like a platform issue, but we must still deal with it somehow here.
|
// Note that although calling "refresh()" instead of catching an exception would seem more correct here,
|
||||||
// Calling "refresh()" instead of catching an exception would be more correct, but is likely to degrade performance
|
// it's not always allowed and also is likely to degrade performance
|
||||||
KotlinJavaScriptMetaFileDecompiler.LOG.warn("Attempt to read non-existing file: $file", e)
|
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user