From 1025fe9307f62fd5cd6305ddfb086060e31b3153 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 30 Jan 2017 15:57:51 +0300 Subject: [PATCH] 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 --- .../js/KotlinJavaScriptMetaFileDecompiler.kt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/js/KotlinJavaScriptMetaFileDecompiler.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/js/KotlinJavaScriptMetaFileDecompiler.kt index 6403329e306..65c8dd9f906 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/js/KotlinJavaScriptMetaFileDecompiler.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/js/KotlinJavaScriptMetaFileDecompiler.kt @@ -16,7 +16,6 @@ package org.jetbrains.kotlin.idea.decompiler.js -import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.vfs.VirtualFile import com.intellij.psi.FileViewProvider import com.intellij.psi.PsiManager @@ -51,10 +50,6 @@ class KotlinJavaScriptMetaFileDecompiler : ClassFileDecompilers.Full() { KtDecompiledFile(provider, ::buildDecompiledTextFromJsMetadata) } } - - companion object { - internal val LOG = Logger.getInstance(KotlinJavaScriptMetaFileDecompiler::class.java) - } } private val decompilerRendererForJS = DescriptorRenderer.withOptions { defaultDecompilerRendererOptions() } @@ -125,9 +120,8 @@ sealed class KjsmFile { catch (e: IOException) { // 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. - // This looks like a platform issue, but we must still deal with it somehow here. - // Calling "refresh()" instead of catching an exception would be more correct, but is likely to degrade performance - KotlinJavaScriptMetaFileDecompiler.LOG.warn("Attempt to read non-existing file: $file", e) + // Note that although calling "refresh()" instead of catching an exception would seem more correct here, + // it's not always allowed and also is likely to degrade performance null } }