Support JvmPackageName with JvmMultifileClass

This is an internal feature of our standard library needed to compile
new API for unsigned types
This commit is contained in:
Alexander Udalov
2019-02-28 19:36:40 +01:00
parent ea21cda4df
commit 59fda8d7ce
26 changed files with 1164 additions and 210 deletions
File diff suppressed because it is too large Load Diff
@@ -39,6 +39,7 @@ import org.jetbrains.kotlin.psi.KtTypeAlias
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.MemberComparator
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.kotlin.resolve.jvm.diagnostics.MultifileClass
import org.jetbrains.kotlin.resolve.jvm.diagnostics.MultifileClassPart
import org.jetbrains.kotlin.resolve.jvm.diagnostics.OtherOrigin
@@ -49,7 +50,6 @@ import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedCallableMemberDescriptor
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedPropertyDescriptor
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedSimpleFunctionDescriptor
import org.jetbrains.kotlin.utils.SmartList
import org.jetbrains.org.objectweb.asm.MethodVisitor
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Type
@@ -66,7 +66,7 @@ class MultifileClassCodegenImpl(
) : MultifileClassCodegen {
private val facadeClassType = AsmUtil.asmTypeByFqNameWithoutInnerClasses(facadeFqName)
private val packageFragment = getOnlyPackageFragment(facadeFqName.parent(), files, state.module)
private val packageFragment = getOnlyPackageFragment(files, state.module)
private val compiledPackageFragment = getCompiledPackageFragment(facadeFqName, state)
@@ -329,6 +329,20 @@ class MultifileClassCodegenImpl(
arv.visit(null, internalName)
}
arv.visitEnd()
val kotlinPackageFqName =
packageFragment?.fqName ?: compiledPackageFragment?.fqName
?: error("Either source package or compiled package should not be null: $facadeClassType ($files)")
if (files.any { it.packageFqName != kotlinPackageFqName })
throw UnsupportedOperationException(
"Multi-file parts of a facade with JvmPackageName should all lie in the same Kotlin package:\n " +
files.joinToString("\n ") { file -> "$file: package ${file.packageFqName}" }
)
if (kotlinPackageFqName != JvmClassName.byInternalName(facadeClassType.internalName).packageFqName) {
av.visit(JvmAnnotationNames.METADATA_PACKAGE_NAME_FIELD_NAME, kotlinPackageFqName.asString())
}
}
}
@@ -350,21 +364,10 @@ class MultifileClassCodegenImpl(
private val J_L_OBJECT = AsmTypes.OBJECT_TYPE.internalName
private const val FACADE_CLASS_ATTRIBUTES = Opcodes.ACC_PUBLIC or Opcodes.ACC_FINAL or Opcodes.ACC_SUPER
private fun getOnlyPackageFragment(
packageFqName: FqName,
files: Collection<KtFile>,
moduleDescriptor: ModuleDescriptor
): PackageFragmentDescriptor? {
val fragments = SmartList<PackageFragmentDescriptor>()
for (file in files) {
val fragment = moduleDescriptor.findPackageFragmentForFile(file)
private fun getOnlyPackageFragment(files: Collection<KtFile>, moduleDescriptor: ModuleDescriptor): PackageFragmentDescriptor? {
val fragments = files.mapTo(linkedSetOf()) { file ->
moduleDescriptor.findPackageFragmentForFile(file)
?: throw AssertionError("package fragment is null for " + file + "\n" + file.text)
assert(packageFqName == fragment.fqName) { "expected package fq name: " + packageFqName + ", actual: " + fragment.fqName }
if (!fragments.contains(fragment)) {
fragments.add(fragment)
}
}
if (fragments.size > 1) {
throw IllegalStateException("More than one package fragment, files: $files | fragments: $fragments")
@@ -22,9 +22,11 @@ import org.jetbrains.kotlin.codegen.context.MultifileClassPartContext
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
import org.jetbrains.kotlin.load.java.JvmAnnotationNames.METADATA_PACKAGE_NAME_FIELD_NAME
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.kotlin.resolve.jvm.diagnostics.OtherOrigin
import org.jetbrains.org.objectweb.asm.Opcodes
@@ -97,6 +99,11 @@ class MultifileClassPartCodegen(
writeKotlinMetadata(v, state, KotlinClassHeader.Kind.MULTIFILE_CLASS_PART, extraFlags) { av ->
AsmUtil.writeAnnotationData(av, serializer, packageProto)
av.visit(JvmAnnotationNames.METADATA_MULTIFILE_CLASS_NAME_FIELD_NAME, facadeClassType.internalName)
val kotlinPackageFqName = element.packageFqName
if (kotlinPackageFqName != JvmClassName.byInternalName(partType.internalName).packageFqName) {
av.visit(METADATA_PACKAGE_NAME_FIELD_NAME, kotlinPackageFqName.asString())
}
}
}
@@ -28,7 +28,10 @@ import org.jetbrains.kotlin.resolve.AdditionalAnnotationChecker
import org.jetbrains.kotlin.resolve.AnnotationChecker
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.BindingTrace
import org.jetbrains.kotlin.resolve.descriptorUtil.*
import org.jetbrains.kotlin.resolve.descriptorUtil.annotationClass
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.descriptorUtil.getAnnotationRetention
import org.jetbrains.kotlin.resolve.descriptorUtil.isRepeatableAnnotation
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
object RepeatableAnnotationChecker: AdditionalAnnotationChecker {
@@ -81,12 +84,8 @@ object FileClassAnnotationsChecker: AdditionalAnnotationChecker {
if (classDescriptor.getAnnotationRetention() != KotlinRetention.SOURCE) {
trace.report(ErrorsJvm.ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES.on(entry, classFqName))
}
if (classFqName == JvmFileClassUtil.JVM_PACKAGE_NAME) {
trace.report(ErrorsJvm.JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_MULTIFILE_CLASSES.on(entry))
}
}
}
else {
} else {
for ((entry, classDescriptor) in fileAnnotationsToCheck) {
if (classDescriptor.fqNameSafe != JvmFileClassUtil.JVM_PACKAGE_NAME) continue
@@ -97,13 +96,11 @@ object FileClassAnnotationsChecker: AdditionalAnnotationChecker {
val value = (stringTemplateEntries.singleOrNull() as? KtLiteralStringTemplateEntry)?.text
if (value == null) {
trace.report(ErrorsJvm.JVM_PACKAGE_NAME_CANNOT_BE_EMPTY.on(entry))
}
else if (!isValidJavaFqName(value)) {
} else if (!isValidJavaFqName(value)) {
trace.report(ErrorsJvm.JVM_PACKAGE_NAME_MUST_BE_VALID_NAME.on(entry))
}
else if (entry.containingKtFile.declarations.any {
it !is KtFunction && it !is KtProperty && it !is KtTypeAlias
}) {
} else if (entry.containingKtFile.declarations.any {
it !is KtFunction && it !is KtProperty && it !is KtTypeAlias
}) {
trace.report(ErrorsJvm.JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_FILES_WITH_CLASSES.on(entry))
}
}
@@ -67,7 +67,6 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension {
MAP.put(NON_SOURCE_REPEATED_ANNOTATION, "Repeatable annotations with non-SOURCE retention are not yet supported");
MAP.put(ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES, "Annotation ''@{0}'' is not applicable to the multi-file classes", TO_STRING);
MAP.put(JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_MULTIFILE_CLASSES, "''@JvmPackageName'' annotation is not supported in multi-file classes");
MAP.put(JVM_PACKAGE_NAME_CANNOT_BE_EMPTY, "''@JvmPackageName'' annotation value cannot be empty");
MAP.put(JVM_PACKAGE_NAME_MUST_BE_VALID_NAME, "''@JvmPackageName'' annotation value must be a valid dot-qualified name of a package");
MAP.put(JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_FILES_WITH_CLASSES, "''@JvmPackageName'' annotation is not supported for files with class declarations");
@@ -68,7 +68,6 @@ public interface ErrorsJvm {
DiagnosticFactory0<KtAnnotationEntry> NON_SOURCE_REPEATED_ANNOTATION = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1<KtAnnotationEntry, FqName> ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES = DiagnosticFactory1.create(ERROR);
DiagnosticFactory0<KtAnnotationEntry> JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_MULTIFILE_CLASSES = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtAnnotationEntry> JVM_PACKAGE_NAME_CANNOT_BE_EMPTY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtAnnotationEntry> JVM_PACKAGE_NAME_MUST_BE_VALID_NAME = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtAnnotationEntry> JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_FILES_WITH_CLASSES = DiagnosticFactory0.create(ERROR);
@@ -0,0 +1,41 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: A1.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("baz.foo.quux.bar")
@file:JvmName("Facade")
@file:JvmMultifileClass
package foo.bar
val g: S? get() = f().substring(0, 0) + "K"
// FILE: A2.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("baz.foo.quux.bar")
@file:JvmName("Facade")
@file:JvmMultifileClass
package foo.bar
inline fun <T> i(block: () -> T): T = block()
// FILE: A3.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("baz.foo.quux.bar")
@file:JvmName("Facade")
@file:JvmMultifileClass
package foo.bar
typealias S = String
fun f(): String = "O"
// FILE: B.kt
import foo.bar.*
fun box(): S = i { f() + g }
@@ -0,0 +1,25 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: A.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("baz.foo.quux.bar")
@file:JvmName("Facade")
@file:JvmMultifileClass
package foo.bar
typealias S = String
fun f(): String = "O"
val g: S? get() = f().substring(0, 0) + "K"
inline fun <T> i(block: () -> T): T = block()
// FILE: B.kt
import foo.bar.*
fun box(): S = i { f() + g }
@@ -1,11 +1,5 @@
// !DIAGNOSTICS: -INVISIBLE_MEMBER -INVISIBLE_REFERENCE
// FILE: a.kt
<!JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_MULTIFILE_CLASSES!>@file:JvmPackageName("a")<!>
@file:JvmMultifileClass
package a
fun a() {}
// FILE: b.kt
<!JVM_PACKAGE_NAME_CANNOT_BE_EMPTY!>@file:JvmPackageName("")<!>
package b
@@ -1,9 +1,5 @@
package
package a {
public fun a(): kotlin.Unit
}
package b {
public fun b(): kotlin.Unit
}
@@ -0,0 +1,7 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("j1")
@file:JvmName("K1")
@file:JvmMultifileClass
package k1
fun f1() {}
@@ -0,0 +1,7 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("j1")
@file:JvmName("K1")
@file:JvmMultifileClass
package k1
val v2 = Unit
@@ -0,0 +1,7 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("j1")
@file:JvmName("K1")
@file:JvmMultifileClass
package k1
typealias T3 = List<String>
@@ -0,0 +1,7 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("j2")
@file:JvmName("K2")
@file:JvmMultifileClass
package k2
fun f1() {}
@@ -0,0 +1,7 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@file:JvmPackageName("j3")
@file:JvmName("K2")
@file:JvmMultifileClass
package k2
val v2 = Unit
@@ -0,0 +1,5 @@
@file:JvmName("K2")
@file:JvmMultifileClass
package k2
typealias T3 = List<String>
@@ -0,0 +1,8 @@
k1
j1/K1__K1_AKt (j1/K1)
j1/K1__K1_BKt (j1/K1)
j1/K1__K1_CKt (j1/K1)
k2
k2/K2__K2_CKt (k2/K2)
j2/K2__K2_AKt (j2/K2)
j3/K2__K2_BKt (j3/K2)
@@ -14655,6 +14655,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/jvmPackageName/metadataField.kt");
}
@TestMetadata("multifileClass.kt")
public void testMultifileClass() throws Exception {
runTest("compiler/testData/codegen/box/jvmPackageName/multifileClass.kt");
}
@TestMetadata("rootPackage.kt")
public void testRootPackage() throws Exception {
runTest("compiler/testData/codegen/box/jvmPackageName/rootPackage.kt");
@@ -188,6 +188,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
runTest("compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt");
}
@TestMetadata("jvmPackageNameMultifileClass.kt")
public void testJvmPackageNameMultifileClass() throws Exception {
runTest("compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameMultifileClass.kt");
}
@TestMetadata("jvmPackageNameWithJvmName.kt")
public void testJvmPackageNameWithJvmName() throws Exception {
runTest("compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt");
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
import org.jetbrains.kotlin.config.ApiVersion
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl
import org.jetbrains.kotlin.load.kotlin.loadModuleMapping
@@ -31,28 +30,28 @@ import java.io.File
class JvmModuleProtoBufTest : KtUsefulTestCase() {
private fun doTest(
relativeDirectory: String,
compileWith: LanguageVersion = LanguageVersion.LATEST_STABLE,
loadWith: LanguageVersion = LanguageVersion.LATEST_STABLE,
extraOptions: List<String> = emptyList()
relativeDirectory: String,
compileWith: LanguageVersion = LanguageVersion.LATEST_STABLE,
loadWith: LanguageVersion = LanguageVersion.LATEST_STABLE,
extraOptions: List<String> = emptyList()
) {
val directory = KotlinTestUtils.getTestDataPathBase() + relativeDirectory
val tmpdir = KotlinTestUtils.tmpDir(this::class.simpleName)
val moduleName = "main"
CompilerTestUtil.executeCompilerAssertSuccessful(K2JVMCompiler(), listOf(
CompilerTestUtil.executeCompilerAssertSuccessful(
K2JVMCompiler(), listOf(
directory,
"-d", tmpdir.path,
"-module-name", moduleName,
"-language-version", compileWith.versionString
) + extraOptions)
) + extraOptions
)
val mapping = ModuleMapping.loadModuleMapping(
File(tmpdir, "META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}").readBytes(), "test",
CompilerDeserializationConfiguration(
LanguageVersionSettingsImpl(loadWith, ApiVersion.createByLanguageVersion(loadWith))
),
::error
File(tmpdir, "META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}").readBytes(), "test",
CompilerDeserializationConfiguration(LanguageVersionSettingsImpl(loadWith, ApiVersion.createByLanguageVersion(loadWith))),
::error
)
val result = buildString {
for (annotationClassId in mapping.moduleData.annotations) {
@@ -82,18 +81,19 @@ class JvmModuleProtoBufTest : KtUsefulTestCase() {
}
fun testJvmPackageName() {
doTest("/moduleProtoBuf/jvmPackageName",
compileWith = LanguageVersion.KOTLIN_1_2, loadWith = LanguageVersion.KOTLIN_1_2)
doTest("/moduleProtoBuf/jvmPackageName")
}
fun testJvmPackageNameManyParts() {
doTest("/moduleProtoBuf/jvmPackageNameManyParts",
compileWith = LanguageVersion.KOTLIN_1_2, loadWith = LanguageVersion.KOTLIN_1_2)
doTest("/moduleProtoBuf/jvmPackageNameManyParts")
}
fun testJvmPackageNameLanguageVersion11() {
doTest("/moduleProtoBuf/jvmPackageNameLanguageVersion11",
compileWith = LanguageVersion.KOTLIN_1_2, loadWith = LanguageVersion.KOTLIN_1_1)
doTest("/moduleProtoBuf/jvmPackageNameLanguageVersion11", loadWith = LanguageVersion.KOTLIN_1_1)
}
fun testJvmPackageNameMultifileClass() {
doTest("/moduleProtoBuf/jvmPackageNameMultifileClass")
}
fun testExperimental() {
@@ -14655,6 +14655,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/jvmPackageName/metadataField.kt");
}
@TestMetadata("multifileClass.kt")
public void testMultifileClass() throws Exception {
runTest("compiler/testData/codegen/box/jvmPackageName/multifileClass.kt");
}
@TestMetadata("rootPackage.kt")
public void testRootPackage() throws Exception {
runTest("compiler/testData/codegen/box/jvmPackageName/rootPackage.kt");
@@ -14660,6 +14660,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/jvmPackageName/metadataField.kt");
}
@TestMetadata("multifileClass.kt")
public void testMultifileClass() throws Exception {
runTest("compiler/testData/codegen/box/jvmPackageName/multifileClass.kt");
}
@TestMetadata("rootPackage.kt")
public void testRootPackage() throws Exception {
runTest("compiler/testData/codegen/box/jvmPackageName/rootPackage.kt");
+17 -3
View File
@@ -41,11 +41,13 @@ message Module {
}
message PackageParts {
// Dot-separated Kotlin FQ name of the package.
required string package_fq_name = 1;
// Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
// (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
// Kotlin package name (i.e. it has not been changed with @JvmPackageName) are listed here.
// Kotlin package name (i.e. it has not been changed with @JvmPackageName) are listed here, the rest are listed in
// class_with_jvm_package_name_short_name.
repeated string short_class_name = 2;
// For each name in short_class_name, index of the name of the corresponding multi-file facade class in multifile_facade_short_name + 1,
@@ -54,12 +56,24 @@ message PackageParts {
repeated int32 multifile_facade_short_name_id = 3 [packed = true];
// Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -> facade mapping.
//
// The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by @JvmPackageName,
// and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
// otherwise behavior is unspecified.
repeated string multifile_facade_short_name = 4;
// Short names of files (single file facades), whose JVM package differs from the Kotlin package because of @JvmPackageName.
// The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
// Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
// @JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
repeated string class_with_jvm_package_name_short_name = 5;
// This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
// multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
// names of multi-file facades whose JVM package differs from the Kotlin package because of @JvmPackageName.
//
// For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
// multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];
// For each name in class_with_jvm_package_name_short_name, the index (into PackageTable#jvm_package_name) of the JVM package name.
// This list should have at least one element, otherwise classes with JVM package names are going to be ignored completely.
//
@@ -1702,14 +1702,26 @@ public final class JvmModuleProtoBuf {
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
boolean hasPackageFqName();
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
java.lang.String getPackageFqName();
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
org.jetbrains.kotlin.protobuf.ByteString
getPackageFqNameBytes();
@@ -1720,7 +1732,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -1731,7 +1744,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
int getShortClassNameCount();
@@ -1741,7 +1755,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
java.lang.String getShortClassName(int index);
@@ -1751,7 +1766,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
org.jetbrains.kotlin.protobuf.ByteString
@@ -1793,6 +1809,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -1802,6 +1821,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
int getMultifileFacadeShortNameCount();
@@ -1810,6 +1832,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
java.lang.String getMultifileFacadeShortName(int index);
@@ -1818,6 +1843,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
org.jetbrains.kotlin.protobuf.ByteString
@@ -1827,8 +1855,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -1837,8 +1865,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
int getClassWithJvmPackageNameShortNameCount();
@@ -1846,8 +1874,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
java.lang.String getClassWithJvmPackageNameShortName(int index);
@@ -1855,13 +1883,50 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
org.jetbrains.kotlin.protobuf.ByteString
getClassWithJvmPackageNameShortNameBytes(int index);
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
java.util.List<java.lang.Integer> getClassWithJvmPackageNameMultifileFacadeShortNameIdList();
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
int getClassWithJvmPackageNameMultifileFacadeShortNameIdCount();
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
int getClassWithJvmPackageNameMultifileFacadeShortNameId(int index);
/**
* <code>repeated int32 class_with_jvm_package_name_package_id = 6 [packed = true];</code>
*
@@ -2004,9 +2069,9 @@ public final class JvmModuleProtoBuf {
break;
}
case 48: {
if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
classWithJvmPackageNamePackageId_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000020;
mutable_bitField0_ |= 0x00000040;
}
classWithJvmPackageNamePackageId_.add(input.readInt32());
break;
@@ -2014,9 +2079,9 @@ public final class JvmModuleProtoBuf {
case 50: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) {
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040) && input.getBytesUntilLimit() > 0) {
classWithJvmPackageNamePackageId_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000020;
mutable_bitField0_ |= 0x00000040;
}
while (input.getBytesUntilLimit() > 0) {
classWithJvmPackageNamePackageId_.add(input.readInt32());
@@ -2024,6 +2089,27 @@ public final class JvmModuleProtoBuf {
input.popLimit(limit);
break;
}
case 56: {
if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
classWithJvmPackageNameMultifileFacadeShortNameId_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000020;
}
classWithJvmPackageNameMultifileFacadeShortNameId_.add(input.readInt32());
break;
}
case 58: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) {
classWithJvmPackageNameMultifileFacadeShortNameId_ = new java.util.ArrayList<java.lang.Integer>();
mutable_bitField0_ |= 0x00000020;
}
while (input.getBytesUntilLimit() > 0) {
classWithJvmPackageNameMultifileFacadeShortNameId_.add(input.readInt32());
}
input.popLimit(limit);
break;
}
}
}
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
@@ -2044,9 +2130,12 @@ public final class JvmModuleProtoBuf {
if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
classWithJvmPackageNameShortName_ = classWithJvmPackageNameShortName_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
classWithJvmPackageNamePackageId_ = java.util.Collections.unmodifiableList(classWithJvmPackageNamePackageId_);
}
if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
classWithJvmPackageNameMultifileFacadeShortNameId_ = java.util.Collections.unmodifiableList(classWithJvmPackageNameMultifileFacadeShortNameId_);
}
try {
unknownFieldsCodedOutput.flush();
} catch (java.io.IOException e) {
@@ -2077,12 +2166,20 @@ public final class JvmModuleProtoBuf {
private java.lang.Object packageFqName_;
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public boolean hasPackageFqName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public java.lang.String getPackageFqName() {
java.lang.Object ref = packageFqName_;
@@ -2100,6 +2197,10 @@ public final class JvmModuleProtoBuf {
}
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ByteString
getPackageFqNameBytes() {
@@ -2123,7 +2224,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -2136,7 +2238,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public int getShortClassNameCount() {
@@ -2148,7 +2251,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public java.lang.String getShortClassName(int index) {
@@ -2160,7 +2264,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ByteString
@@ -2216,6 +2321,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -2227,6 +2335,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public int getMultifileFacadeShortNameCount() {
@@ -2237,6 +2348,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public java.lang.String getMultifileFacadeShortName(int index) {
@@ -2247,6 +2361,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ByteString
@@ -2260,8 +2377,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -2272,8 +2389,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public int getClassWithJvmPackageNameShortNameCount() {
@@ -2283,8 +2400,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public java.lang.String getClassWithJvmPackageNameShortName(int index) {
@@ -2294,8 +2411,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ByteString
@@ -2303,6 +2420,53 @@ public final class JvmModuleProtoBuf {
return classWithJvmPackageNameShortName_.getByteString(index);
}
public static final int CLASS_WITH_JVM_PACKAGE_NAME_MULTIFILE_FACADE_SHORT_NAME_ID_FIELD_NUMBER = 7;
private java.util.List<java.lang.Integer> classWithJvmPackageNameMultifileFacadeShortNameId_;
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public java.util.List<java.lang.Integer>
getClassWithJvmPackageNameMultifileFacadeShortNameIdList() {
return classWithJvmPackageNameMultifileFacadeShortNameId_;
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public int getClassWithJvmPackageNameMultifileFacadeShortNameIdCount() {
return classWithJvmPackageNameMultifileFacadeShortNameId_.size();
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public int getClassWithJvmPackageNameMultifileFacadeShortNameId(int index) {
return classWithJvmPackageNameMultifileFacadeShortNameId_.get(index);
}
private int classWithJvmPackageNameMultifileFacadeShortNameIdMemoizedSerializedSize = -1;
public static final int CLASS_WITH_JVM_PACKAGE_NAME_PACKAGE_ID_FIELD_NUMBER = 6;
private java.util.List<java.lang.Integer> classWithJvmPackageNamePackageId_;
/**
@@ -2356,6 +2520,7 @@ public final class JvmModuleProtoBuf {
multifileFacadeShortNameId_ = java.util.Collections.emptyList();
multifileFacadeShortName_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
classWithJvmPackageNameShortName_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
classWithJvmPackageNameMultifileFacadeShortNameId_ = java.util.Collections.emptyList();
classWithJvmPackageNamePackageId_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
@@ -2401,6 +2566,13 @@ public final class JvmModuleProtoBuf {
for (int i = 0; i < classWithJvmPackageNamePackageId_.size(); i++) {
output.writeInt32NoTag(classWithJvmPackageNamePackageId_.get(i));
}
if (getClassWithJvmPackageNameMultifileFacadeShortNameIdList().size() > 0) {
output.writeRawVarint32(58);
output.writeRawVarint32(classWithJvmPackageNameMultifileFacadeShortNameIdMemoizedSerializedSize);
}
for (int i = 0; i < classWithJvmPackageNameMultifileFacadeShortNameId_.size(); i++) {
output.writeInt32NoTag(classWithJvmPackageNameMultifileFacadeShortNameId_.get(i));
}
output.writeRawBytes(unknownFields);
}
@@ -2469,6 +2641,20 @@ public final class JvmModuleProtoBuf {
}
classWithJvmPackageNamePackageIdMemoizedSerializedSize = dataSize;
}
{
int dataSize = 0;
for (int i = 0; i < classWithJvmPackageNameMultifileFacadeShortNameId_.size(); i++) {
dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32SizeNoTag(classWithJvmPackageNameMultifileFacadeShortNameId_.get(i));
}
size += dataSize;
if (!getClassWithJvmPackageNameMultifileFacadeShortNameIdList().isEmpty()) {
size += 1;
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
classWithJvmPackageNameMultifileFacadeShortNameIdMemoizedSerializedSize = dataSize;
}
size += unknownFields.size();
memoizedSerializedSize = size;
return size;
@@ -2573,8 +2759,10 @@ public final class JvmModuleProtoBuf {
bitField0_ = (bitField0_ & ~0x00000008);
classWithJvmPackageNameShortName_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
classWithJvmPackageNamePackageId_ = java.util.Collections.emptyList();
classWithJvmPackageNameMultifileFacadeShortNameId_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000020);
classWithJvmPackageNamePackageId_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
return this;
}
@@ -2623,9 +2811,14 @@ public final class JvmModuleProtoBuf {
}
result.classWithJvmPackageNameShortName_ = classWithJvmPackageNameShortName_;
if (((bitField0_ & 0x00000020) == 0x00000020)) {
classWithJvmPackageNamePackageId_ = java.util.Collections.unmodifiableList(classWithJvmPackageNamePackageId_);
classWithJvmPackageNameMultifileFacadeShortNameId_ = java.util.Collections.unmodifiableList(classWithJvmPackageNameMultifileFacadeShortNameId_);
bitField0_ = (bitField0_ & ~0x00000020);
}
result.classWithJvmPackageNameMultifileFacadeShortNameId_ = classWithJvmPackageNameMultifileFacadeShortNameId_;
if (((bitField0_ & 0x00000040) == 0x00000040)) {
classWithJvmPackageNamePackageId_ = java.util.Collections.unmodifiableList(classWithJvmPackageNamePackageId_);
bitField0_ = (bitField0_ & ~0x00000040);
}
result.classWithJvmPackageNamePackageId_ = classWithJvmPackageNamePackageId_;
result.bitField0_ = to_bitField0_;
return result;
@@ -2677,11 +2870,21 @@ public final class JvmModuleProtoBuf {
classWithJvmPackageNameShortName_.addAll(other.classWithJvmPackageNameShortName_);
}
}
if (!other.classWithJvmPackageNameMultifileFacadeShortNameId_.isEmpty()) {
if (classWithJvmPackageNameMultifileFacadeShortNameId_.isEmpty()) {
classWithJvmPackageNameMultifileFacadeShortNameId_ = other.classWithJvmPackageNameMultifileFacadeShortNameId_;
bitField0_ = (bitField0_ & ~0x00000020);
} else {
ensureClassWithJvmPackageNameMultifileFacadeShortNameIdIsMutable();
classWithJvmPackageNameMultifileFacadeShortNameId_.addAll(other.classWithJvmPackageNameMultifileFacadeShortNameId_);
}
}
if (!other.classWithJvmPackageNamePackageId_.isEmpty()) {
if (classWithJvmPackageNamePackageId_.isEmpty()) {
classWithJvmPackageNamePackageId_ = other.classWithJvmPackageNamePackageId_;
bitField0_ = (bitField0_ & ~0x00000020);
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureClassWithJvmPackageNamePackageIdIsMutable();
classWithJvmPackageNamePackageId_.addAll(other.classWithJvmPackageNamePackageId_);
@@ -2723,12 +2926,20 @@ public final class JvmModuleProtoBuf {
private java.lang.Object packageFqName_ = "";
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public boolean hasPackageFqName() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public java.lang.String getPackageFqName() {
java.lang.Object ref = packageFqName_;
@@ -2746,6 +2957,10 @@ public final class JvmModuleProtoBuf {
}
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ByteString
getPackageFqNameBytes() {
@@ -2762,6 +2977,10 @@ public final class JvmModuleProtoBuf {
}
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public Builder setPackageFqName(
java.lang.String value) {
@@ -2775,6 +2994,10 @@ public final class JvmModuleProtoBuf {
}
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public Builder clearPackageFqName() {
bitField0_ = (bitField0_ & ~0x00000001);
@@ -2784,6 +3007,10 @@ public final class JvmModuleProtoBuf {
}
/**
* <code>required string package_fq_name = 1;</code>
*
* <pre>
* Dot-separated Kotlin FQ name of the package.
* </pre>
*/
public Builder setPackageFqNameBytes(
org.jetbrains.kotlin.protobuf.ByteString value) {
@@ -2809,7 +3036,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -2822,7 +3050,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public int getShortClassNameCount() {
@@ -2834,7 +3063,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public java.lang.String getShortClassName(int index) {
@@ -2846,7 +3076,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ByteString
@@ -2859,7 +3090,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public Builder setShortClassName(
@@ -2878,7 +3110,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public Builder addShortClassName(
@@ -2897,7 +3130,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public Builder addAllShortClassName(
@@ -2914,7 +3148,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public Builder clearShortClassName() {
@@ -2929,7 +3164,8 @@ public final class JvmModuleProtoBuf {
* <pre>
* Short names of files, without extension, present in this package. Only single file facades and multi-file _parts_ are listed here
* (multi-file facades are not present in this list, they are defined below). Only files whose JVM package name is equal to the
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here.
* Kotlin package name (i.e. it has not been changed with &#64;JvmPackageName) are listed here, the rest are listed in
* class_with_jvm_package_name_short_name.
* </pre>
*/
public Builder addShortClassNameBytes(
@@ -3063,6 +3299,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -3074,6 +3313,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public int getMultifileFacadeShortNameCount() {
@@ -3084,6 +3326,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public java.lang.String getMultifileFacadeShortName(int index) {
@@ -3094,6 +3339,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ByteString
@@ -3105,6 +3353,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public Builder setMultifileFacadeShortName(
@@ -3122,6 +3373,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public Builder addMultifileFacadeShortName(
@@ -3139,6 +3393,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public Builder addAllMultifileFacadeShortName(
@@ -3154,6 +3411,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public Builder clearMultifileFacadeShortName() {
@@ -3167,6 +3427,9 @@ public final class JvmModuleProtoBuf {
*
* <pre>
* Short names of multi-file facades, used in multifile_facade_short_name_id to store the part -&gt; facade mapping.
* The package name of the multi-file facade is package_fq_name if this multi-file facade is not affected by &#64;JvmPackageName,
* and the JVM package name of any multi-file part otherwise. Note that in the latter case, all parts must have the same JVM package name,
* otherwise behavior is unspecified.
* </pre>
*/
public Builder addMultifileFacadeShortNameBytes(
@@ -3191,8 +3454,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ProtocolStringList
@@ -3203,8 +3466,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public int getClassWithJvmPackageNameShortNameCount() {
@@ -3214,8 +3477,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public java.lang.String getClassWithJvmPackageNameShortName(int index) {
@@ -3225,8 +3488,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public org.jetbrains.kotlin.protobuf.ByteString
@@ -3237,8 +3500,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public Builder setClassWithJvmPackageNameShortName(
@@ -3255,8 +3518,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public Builder addClassWithJvmPackageNameShortName(
@@ -3273,8 +3536,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public Builder addAllClassWithJvmPackageNameShortName(
@@ -3289,8 +3552,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public Builder clearClassWithJvmPackageNameShortName() {
@@ -3303,8 +3566,8 @@ public final class JvmModuleProtoBuf {
* <code>repeated string class_with_jvm_package_name_short_name = 5;</code>
*
* <pre>
* Short names of files (single file facades), whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* Short names of files (single file facades and multi-file _parts_), whose JVM package differs from the Kotlin package because of
* &#64;JvmPackageName. The JVM package name of each file is stored at the same index in class_with_jvm_package_name_package_id.
* </pre>
*/
public Builder addClassWithJvmPackageNameShortNameBytes(
@@ -3318,11 +3581,133 @@ public final class JvmModuleProtoBuf {
return this;
}
private java.util.List<java.lang.Integer> classWithJvmPackageNameMultifileFacadeShortNameId_ = java.util.Collections.emptyList();
private void ensureClassWithJvmPackageNameMultifileFacadeShortNameIdIsMutable() {
if (!((bitField0_ & 0x00000020) == 0x00000020)) {
classWithJvmPackageNameMultifileFacadeShortNameId_ = new java.util.ArrayList<java.lang.Integer>(classWithJvmPackageNameMultifileFacadeShortNameId_);
bitField0_ |= 0x00000020;
}
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public java.util.List<java.lang.Integer>
getClassWithJvmPackageNameMultifileFacadeShortNameIdList() {
return java.util.Collections.unmodifiableList(classWithJvmPackageNameMultifileFacadeShortNameId_);
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public int getClassWithJvmPackageNameMultifileFacadeShortNameIdCount() {
return classWithJvmPackageNameMultifileFacadeShortNameId_.size();
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public int getClassWithJvmPackageNameMultifileFacadeShortNameId(int index) {
return classWithJvmPackageNameMultifileFacadeShortNameId_.get(index);
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public Builder setClassWithJvmPackageNameMultifileFacadeShortNameId(
int index, int value) {
ensureClassWithJvmPackageNameMultifileFacadeShortNameIdIsMutable();
classWithJvmPackageNameMultifileFacadeShortNameId_.set(index, value);
return this;
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public Builder addClassWithJvmPackageNameMultifileFacadeShortNameId(int value) {
ensureClassWithJvmPackageNameMultifileFacadeShortNameIdIsMutable();
classWithJvmPackageNameMultifileFacadeShortNameId_.add(value);
return this;
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public Builder addAllClassWithJvmPackageNameMultifileFacadeShortNameId(
java.lang.Iterable<? extends java.lang.Integer> values) {
ensureClassWithJvmPackageNameMultifileFacadeShortNameIdIsMutable();
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
values, classWithJvmPackageNameMultifileFacadeShortNameId_);
return this;
}
/**
* <code>repeated int32 class_with_jvm_package_name_multifile_facade_short_name_id = 7 [packed = true];</code>
*
* <pre>
* This list is an addition to class_with_jvm_package_name_short_name exactly almost in the same way as
* multifile_facade_short_name_id is an addition to short_class_name. The only difference is that this list contains _full_ internal
* names of multi-file facades whose JVM package differs from the Kotlin package because of &#64;JvmPackageName.
* For each name in class_with_jvm_package_name_short_name, index of the name of the corresponding multi-file facade class in
* multifile_facade_short_name + 1, or 0 if the class is not a multi-file part.
* </pre>
*/
public Builder clearClassWithJvmPackageNameMultifileFacadeShortNameId() {
classWithJvmPackageNameMultifileFacadeShortNameId_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
private java.util.List<java.lang.Integer> classWithJvmPackageNamePackageId_ = java.util.Collections.emptyList();
private void ensureClassWithJvmPackageNamePackageIdIsMutable() {
if (!((bitField0_ & 0x00000020) == 0x00000020)) {
if (!((bitField0_ & 0x00000040) == 0x00000040)) {
classWithJvmPackageNamePackageId_ = new java.util.ArrayList<java.lang.Integer>(classWithJvmPackageNamePackageId_);
bitField0_ |= 0x00000020;
bitField0_ |= 0x00000040;
}
}
/**
@@ -3435,7 +3820,7 @@ public final class JvmModuleProtoBuf {
*/
public Builder clearClassWithJvmPackageNamePackageId() {
classWithJvmPackageNamePackageId_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000020);
bitField0_ = (bitField0_ & ~0x00000040);
return this;
}
@@ -27,7 +27,7 @@ class JvmMetadataVersion(versionArray: IntArray, val isStrictSemantics: Boolean)
companion object {
@JvmField
val INSTANCE = JvmMetadataVersion(1, 1, 14)
val INSTANCE = JvmMetadataVersion(1, 1, 15)
@JvmField
val INVALID_VERSION = JvmMetadataVersion()
@@ -75,10 +75,12 @@ class ModuleMapping private constructor(
val packageParts = result.getOrPut(packageFqName) { PackageParts(packageFqName) }
for ((index, partShortName) in proto.shortClassNameList.withIndex()) {
val multifileFacadeId = proto.multifileFacadeShortNameIdList.getOrNull(index)?.minus(1)
val facadeShortName = multifileFacadeId?.let(proto.multifileFacadeShortNameList::getOrNull)
val facadeInternalName = facadeShortName?.let { internalNameOf(packageFqName, it) }
packageParts.addPart(internalNameOf(packageFqName, partShortName), facadeInternalName)
packageParts.addPart(
internalNameOf(packageFqName, partShortName),
loadMultiFileFacadeInternalName(
proto.multifileFacadeShortNameIdList, proto.multifileFacadeShortNameList, index, packageFqName
)
)
}
if (isJvmPackageNameSupported) {
@@ -87,7 +89,16 @@ class ModuleMapping private constructor(
?: proto.classWithJvmPackageNamePackageIdList.lastOrNull()
?: continue
val jvmPackageName = moduleProto.jvmPackageNameList.getOrNull(packageId) ?: continue
packageParts.addPart(internalNameOf(jvmPackageName, partShortName), null)
packageParts.addPart(
internalNameOf(jvmPackageName, partShortName),
loadMultiFileFacadeInternalName(
proto.classWithJvmPackageNameMultifileFacadeShortNameIdList,
proto.multifileFacadeShortNameList,
index,
jvmPackageName
)
)
}
}
}
@@ -103,6 +114,17 @@ class ModuleMapping private constructor(
return ModuleMapping(result, BinaryModuleData(annotations), debugName)
}
private fun loadMultiFileFacadeInternalName(
multifileFacadeIds: List<Int>,
multifileFacadeShortNames: List<String>,
index: Int,
packageFqName: String
): String? {
val multifileFacadeId = multifileFacadeIds.getOrNull(index)?.minus(1)
val facadeShortName = multifileFacadeId?.let(multifileFacadeShortNames::getOrNull)
return facadeShortName?.let { internalNameOf(packageFqName, it) }
}
}
}
@@ -140,9 +162,10 @@ class PackageParts(val packageFqName: String) {
partInternalName.packageName == packageInternalName
}
writePartsWithinPackage(partsWithinPackage)
writePartsOutsidePackage(partsOutsidePackage, builder)
val facadeNameToId = mutableMapOf<String, Int>()
writePartsWithinPackage(partsWithinPackage, facadeNameToId)
writePartsOutsidePackage(partsOutsidePackage, facadeNameToId, builder)
writeMultifileFacadeNames(facadeNameToId)
})
}
@@ -154,26 +177,24 @@ class PackageParts(val packageFqName: String) {
}
}
private fun JvmModuleProtoBuf.PackageParts.Builder.writePartsWithinPackage(parts: List<String>) {
val facadeNameToId = mutableMapOf<String, Int>()
private fun JvmModuleProtoBuf.PackageParts.Builder.writePartsWithinPackage(
parts: List<String>,
facadeNameToId: MutableMap<String, Int>
) {
for ((facadeInternalName, partInternalNames) in parts.groupBy { getMultifileFacadeName(it) }.toSortedMap(nullsLast())) {
for (partInternalName in partInternalNames.sorted()) {
addShortClassName(partInternalName.className)
if (facadeInternalName != null) {
addMultifileFacadeShortNameId(1 + facadeNameToId.getOrPut(facadeInternalName.className) { facadeNameToId.size })
addMultifileFacadeShortNameId(getMultifileFacadeShortNameId(facadeInternalName, facadeNameToId))
}
}
}
for ((facadeId, facadeName) in facadeNameToId.values.zip(facadeNameToId.keys).sortedBy(Pair<Int, String>::first)) {
assert(facadeId == multifileFacadeShortNameCount) { "Multifile facades are loaded incorrectly: $facadeNameToId" }
addMultifileFacadeShortName(facadeName)
}
}
// Writes information about package parts which have a different JVM package from the Kotlin package (with the help of @JvmPackageName)
private fun JvmModuleProtoBuf.PackageParts.Builder.writePartsOutsidePackage(
parts: List<String>,
facadeNameToId: MutableMap<String, Int>,
packageTableBuilder: JvmModuleProtoBuf.Module.Builder
) {
val packageIds = mutableListOf<Int>()
@@ -183,9 +204,16 @@ class PackageParts(val packageFqName: String) {
packageTableBuilder.addJvmPackageName(packageFqName)
}
val packageId = packageTableBuilder.jvmPackageNameList.indexOf(packageFqName)
for (part in partsInPackage.map { it.className }.sorted()) {
addClassWithJvmPackageNameShortName(part)
packageIds.add(packageId)
for ((facadeInternalName, partInternalNames) in partsInPackage.groupBy { getMultifileFacadeName(it) }.toSortedMap(nullsLast())) {
for (partInternalName in partInternalNames.sorted()) {
addClassWithJvmPackageNameShortName(partInternalName.className)
if (facadeInternalName != null) {
addClassWithJvmPackageNameMultifileFacadeShortNameId(
getMultifileFacadeShortNameId(facadeInternalName, facadeNameToId)
)
}
packageIds.add(packageId)
}
}
}
@@ -197,6 +225,17 @@ class PackageParts(val packageFqName: String) {
addAllClassWithJvmPackageNamePackageId(packageIds)
}
private fun getMultifileFacadeShortNameId(facadeInternalName: String, facadeNameToId: MutableMap<String, Int>): Int {
return 1 + facadeNameToId.getOrPut(facadeInternalName.className) { facadeNameToId.size }
}
private fun JvmModuleProtoBuf.PackageParts.Builder.writeMultifileFacadeNames(facadeNameToId: Map<String, Int>) {
for ((facadeId, facadeName) in facadeNameToId.values.zip(facadeNameToId.keys).sortedBy(Pair<Int, String>::first)) {
assert(facadeId == multifileFacadeShortNameCount) { "Multifile facades are loaded incorrectly: $facadeNameToId" }
addMultifileFacadeShortName(facadeName)
}
}
private val String.packageName: String get() = substringBeforeLast('/', "")
private val String.className: String get() = substringAfterLast('/')