diff --git a/idea/idea-analysis/src/org/jetbrains/jet/plugin/decompiler/textBuilder/DeserializerForDecompiler.kt b/idea/idea-analysis/src/org/jetbrains/jet/plugin/decompiler/textBuilder/DeserializerForDecompiler.kt index f21ccb068ed..8c60cd9f34b 100644 --- a/idea/idea-analysis/src/org/jetbrains/jet/plugin/decompiler/textBuilder/DeserializerForDecompiler.kt +++ b/idea/idea-analysis/src/org/jetbrains/jet/plugin/decompiler/textBuilder/DeserializerForDecompiler.kt @@ -75,7 +75,7 @@ public class DeserializerForDecompiler(val packageDirectory: VirtualFile, val di private val storageManager = LockBasedStorageManager.NO_LOCKS private val annotationAndConstantLoader = - BinaryClassAnnotationAndConstantLoaderImpl(moduleDescriptor, storageManager, localClassFinder, LOGGING_REPORTER) + BinaryClassAnnotationAndConstantLoaderImpl(moduleDescriptor, storageManager, localClassFinder, LoggingErrorReporter(LOG)) private val packageFragmentProvider = object : PackageFragmentProvider { override fun getPackageFragments(fqName: FqName): List { @@ -112,17 +112,5 @@ public class DeserializerForDecompiler(val packageDirectory: VirtualFile, val di class object { private val LOG = Logger.getInstance(javaClass()) - - private object LOGGING_REPORTER: ErrorReporter { - override fun reportLoadingError(message: String, exception: Exception?) { - LOG.error(message, exception) - } - override fun reportCannotInferVisibility(descriptor: CallableMemberDescriptor) { - LOG.error("Could not infer visibility for $descriptor") - } - override fun reportIncompatibleAbiVersion(kotlinClass: KotlinJvmBinaryClass, actualVersion: Int) { - LOG.error("Incompatible ABI version for class ${kotlinClass.getClassId()}, actual version: $actualVersion") - } - } } } diff --git a/idea/idea-analysis/src/org/jetbrains/jet/plugin/decompiler/textBuilder/LoggingErrorReporter.kt b/idea/idea-analysis/src/org/jetbrains/jet/plugin/decompiler/textBuilder/LoggingErrorReporter.kt new file mode 100644 index 00000000000..f01ae50065b --- /dev/null +++ b/idea/idea-analysis/src/org/jetbrains/jet/plugin/decompiler/textBuilder/LoggingErrorReporter.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.plugin.decompiler.textBuilder + +import org.jetbrains.jet.lang.resolve.java.resolver.ErrorReporter +import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor +import org.jetbrains.jet.lang.resolve.kotlin.KotlinJvmBinaryClass +import com.intellij.openapi.diagnostic.Logger + +class LoggingErrorReporter(private val log: Logger) : ErrorReporter { + override fun reportLoadingError(message: String, exception: Exception?) { + log.error(message, exception) + } + + override fun reportCannotInferVisibility(descriptor: CallableMemberDescriptor) { + log.error("Could not infer visibility for $descriptor") + } + + override fun reportIncompatibleAbiVersion(kotlinClass: KotlinJvmBinaryClass, actualVersion: Int) { + log.error("Incompatible ABI version for class ${kotlinClass.getClassId()}, actual version: $actualVersion") + } +} \ No newline at end of file