diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/KotlinClassFileHeader.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/KotlinClassFileHeader.java index a63ca5eda7c..43a811aa69d 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/KotlinClassFileHeader.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/KotlinClassFileHeader.java @@ -13,6 +13,7 @@ import org.jetbrains.jet.descriptors.serialization.PackageData; import org.jetbrains.jet.lang.resolve.java.AbiVersionUtil; import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames; import org.jetbrains.jet.lang.resolve.java.JvmClassName; +import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.utils.ExceptionUtils; import java.io.IOException; @@ -102,10 +103,13 @@ public final class KotlinClassFileHeader { return type.isValidAnnotation() && isAbiVersionCompatible(version); } + /** + * @return FQ name for class header or package class FQ name for package header (e.g. test.TestPackage) + */ @NotNull - public JvmClassName getJvmClassName() { + public FqName getFqName() { assert jvmClassName != null; - return jvmClassName; + return jvmClassName.getFqName(); } public String[] getAnnotationData() { diff --git a/idea/src/org/jetbrains/jet/plugin/libraries/DecompiledDataFactory.java b/idea/src/org/jetbrains/jet/plugin/libraries/DecompiledDataFactory.java index 27730518ec1..f414aa3e2c5 100644 --- a/idea/src/org/jetbrains/jet/plugin/libraries/DecompiledDataFactory.java +++ b/idea/src/org/jetbrains/jet/plugin/libraries/DecompiledDataFactory.java @@ -69,7 +69,7 @@ public final class DecompiledDataFactory { } private JetDecompiledData build() { - FqName packageFqName = kotlinClassFileHeader.getJvmClassName().getFqName().parent(); + FqName packageFqName = kotlinClassFileHeader.getFqName().parent(); appendDecompiledTextAndPackageName(packageFqName); KotlinClassFileHeader.HeaderType type = kotlinClassFileHeader.getType(); if (type == KotlinClassFileHeader.HeaderType.PACKAGE) { @@ -87,8 +87,7 @@ public final class DecompiledDataFactory { } else { assert type == KotlinClassFileHeader.HeaderType.CLASS; - ClassDescriptor cd = javaDescriptorResolver.resolveClass(kotlinClassFileHeader.getJvmClassName().getFqName(), - INCLUDE_KOTLIN_SOURCES); + ClassDescriptor cd = javaDescriptorResolver.resolveClass(kotlinClassFileHeader.getFqName(), INCLUDE_KOTLIN_SOURCES); if (cd != null) { appendDescriptor(cd, ""); } diff --git a/idea/src/org/jetbrains/jet/plugin/vfilefinder/KotlinClassFileIndex.java b/idea/src/org/jetbrains/jet/plugin/vfilefinder/KotlinClassFileIndex.java index bf178ed0013..63c0cbe207b 100644 --- a/idea/src/org/jetbrains/jet/plugin/vfilefinder/KotlinClassFileIndex.java +++ b/idea/src/org/jetbrains/jet/plugin/vfilefinder/KotlinClassFileIndex.java @@ -13,7 +13,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.Map; public final class KotlinClassFileIndex extends ScalarIndexExtension { @@ -60,8 +59,7 @@ public final class KotlinClassFileIndex extends ScalarIndexExtension { try { KotlinClassFileHeader header = KotlinClassFileHeader.readKotlinHeaderFromClassFile(inputData.getFile()); if (header.isKotlinCompiledFile()) { - FqName fqName = header.getJvmClassName().getFqName(); - return Collections.singletonMap(fqName, null); + return Collections.singletonMap(header.getFqName(), null); } } catch (Throwable e) {