From 1036506b25d0ce0dcbcb90206e38a26fd1d6b409 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 21 Sep 2015 20:35:27 +0300 Subject: [PATCH] Introduce new string table optimized for JVM class files This format of the string table allows to reduce the size of the Kotlin metadata in JVM class files by reusing constants already present in the constant pool. Currently the string table produced by JvmStringTable is not fully optimized in serialization (in particular, the 'substring' operation which will be used to extract type names out of generic signature, is not used at all), but the format and its complete support in the deserialization (JvmNameResolver) allows future improvement without changing the binary version --- .../org/jetbrains/kotlin/codegen/AsmUtil.java | 8 +- .../kotlin/codegen/ClosureCodegen.java | 2 +- .../codegen/ImplementationBodyCodegen.java | 2 +- .../codegen/JvmSerializerExtension.java | 3 +- .../codegen/MultifileClassPartCodegen.kt | 2 +- .../kotlin/codegen/PackageCodegen.java | 2 +- .../kotlin/codegen/PackagePartCodegen.java | 2 +- .../codegen/serialization/JvmStringTable.kt | 132 + .../noPrivateMemberInJavaInterface.kt | 4 +- .../kotlin/serialization/DebugProtoBuf.java | 16 + .../serialization/jvm/DebugJvmProtoBuf.java | 2308 ++++++++++++++++- .../serialization/jvm/JvmNameResolverTest.kt | 161 ++ .../src/jvm_descriptors.proto | 39 + .../kotlin/load/kotlin/JvmNameResolver.kt | 136 + .../kotlin/serialization/jvm/JvmProtoBuf.java | 1904 ++++++++++++++ .../serialization/jvm/JvmProtoBufUtil.kt | 6 +- .../kotlin/serialization/ProtoBuf.java | 16 + .../src/kotlin/reflect/jvm/reflectLambda.kt | 8 +- .../classFilesComparison.kt | 35 +- 19 files changed, 4719 insertions(+), 67 deletions(-) create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmStringTable.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/serialization/jvm/JvmNameResolverTest.kt create mode 100644 core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin/JvmNameResolver.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java index f432d7bf2f8..b04a315ea02 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java @@ -46,6 +46,8 @@ import org.jetbrains.kotlin.resolve.jvm.JvmClassName; import org.jetbrains.kotlin.resolve.jvm.JvmPackage; import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType; import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin; +import org.jetbrains.kotlin.serialization.DescriptorSerializer; +import org.jetbrains.kotlin.codegen.serialization.JvmStringTable; import org.jetbrains.kotlin.serialization.jvm.BitEncoding; import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor; import org.jetbrains.kotlin.types.JetType; @@ -842,7 +844,7 @@ public class AsmUtil { av.visitEnd(); } - public static void writeAnnotationData(@NotNull AnnotationVisitor av, @NotNull byte[] bytes) { + public static void writeAnnotationData(@NotNull AnnotationVisitor av, @NotNull DescriptorSerializer serializer, @NotNull byte[] bytes) { JvmCodegenUtil.writeAbiVersion(av); AnnotationVisitor data = av.visitArray(JvmAnnotationNames.DATA_FIELD_NAME); for (String string : BitEncoding.encodeBytes(bytes)) { @@ -850,7 +852,9 @@ public class AsmUtil { } data.visitEnd(); AnnotationVisitor strings = av.visitArray(JvmAnnotationNames.STRINGS_FIELD_NAME); - // TODO: write the actual string table + for (String string : ((JvmStringTable) serializer.getStringTable()).getStrings()) { + strings.visit(null, string); + } strings.visitEnd(); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java index 4f179c112fb..f28adb22200 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java @@ -230,7 +230,7 @@ public class ClosureCodegen extends MemberCodegen { ProtoBuf.Callable callableProto = serializer.callableProto(funDescriptor).build(); AnnotationVisitor av = v.getVisitor().visitAnnotation(asmDescByFqNameWithoutInnerClasses(JvmAnnotationNames.KOTLIN_CALLABLE), true); - writeAnnotationData(av, serializer.serialize(callableProto)); + writeAnnotationData(av, serializer, serializer.serialize(callableProto)); av.visitEnd(); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index 8bfcbf4d641..c51584fc998 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -253,7 +253,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { ProtoBuf.Class classProto = serializer.classProto(descriptor).build(); AnnotationVisitor av = v.getVisitor().visitAnnotation(asmDescByFqNameWithoutInnerClasses(JvmAnnotationNames.KOTLIN_CLASS), true); - writeAnnotationData(av, serializer.serialize(classProto)); + writeAnnotationData(av, serializer, serializer.serialize(classProto)); if (kind != null) { av.visitEnum( JvmAnnotationNames.KIND_FIELD_NAME, diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmSerializerExtension.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmSerializerExtension.java index 5775784cf12..a6f8134f142 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmSerializerExtension.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmSerializerExtension.java @@ -20,6 +20,7 @@ import com.intellij.openapi.util.Pair; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.builtins.KotlinBuiltIns; +import org.jetbrains.kotlin.codegen.serialization.JvmStringTable; import org.jetbrains.kotlin.codegen.state.JetTypeMapper; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor; @@ -39,7 +40,7 @@ import static org.jetbrains.kotlin.codegen.JvmSerializationBindings.*; public class JvmSerializerExtension extends SerializerExtension { private final JvmSerializationBindings bindings; private final JetTypeMapper typeMapper; - private final StringTableImpl stringTable = new StringTableImpl(this); + private final StringTable stringTable = new JvmStringTable(this); private final AnnotationSerializer annotationSerializer = new AnnotationSerializer(stringTable); public JvmSerializerExtension(@NotNull JvmSerializationBindings bindings, @NotNull JetTypeMapper typeMapper) { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/MultifileClassPartCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/MultifileClassPartCodegen.kt index 32a5c11572c..108eca557cf 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/MultifileClassPartCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/MultifileClassPartCodegen.kt @@ -95,7 +95,7 @@ public class MultifileClassPartCodegen( if (packageProto.memberCount == 0) return val av = v.newAnnotation(AsmUtil.asmDescByFqNameWithoutInnerClasses(JvmAnnotationNames.KOTLIN_MULTIFILE_CLASS_PART), true) - AsmUtil.writeAnnotationData(av, serializer.serialize(packageProto)) + AsmUtil.writeAnnotationData(av, serializer, serializer.serialize(packageProto)) av.visit(JvmAnnotationNames.MULTIFILE_CLASS_NAME_FIELD_NAME, multifileClassFqName.shortName().asString()) av.visitEnd() } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/PackageCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/PackageCodegen.java index 204fb2db4e8..f1c5b5071c0 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/PackageCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/PackageCodegen.java @@ -290,7 +290,7 @@ public class PackageCodegen { ProtoBuf.Package packageProto = serializer.packageProtoWithoutDescriptors().build(); AnnotationVisitor av = v.newAnnotation(asmDescByFqNameWithoutInnerClasses(JvmAnnotationNames.KOTLIN_PACKAGE), true); - AsmUtil.writeAnnotationData(av, serializer.serialize(packageProto)); + AsmUtil.writeAnnotationData(av, serializer, serializer.serialize(packageProto)); av.visitEnd(); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/PackagePartCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/PackagePartCodegen.java index 2ad4b24860e..2c585f3b2b1 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/PackagePartCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/PackagePartCodegen.java @@ -128,7 +128,7 @@ public class PackagePartCodegen extends MemberCodegen { if (packageProto.getMemberCount() == 0) return; AnnotationVisitor av = v.newAnnotation(asmDescByFqNameWithoutInnerClasses(JvmAnnotationNames.KOTLIN_FILE_FACADE), true); - writeAnnotationData(av, serializer.serialize(packageProto)); + writeAnnotationData(av, serializer, serializer.serialize(packageProto)); av.visitEnd(); } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmStringTable.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmStringTable.kt new file mode 100644 index 00000000000..0603c954612 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmStringTable.kt @@ -0,0 +1,132 @@ +/* + * Copyright 2010-2015 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.kotlin.codegen.serialization + +import org.jetbrains.kotlin.descriptors.ClassDescriptor +import org.jetbrains.kotlin.descriptors.ClassOrPackageFragmentDescriptor +import org.jetbrains.kotlin.descriptors.DeclarationDescriptor +import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor +import org.jetbrains.kotlin.load.kotlin.JvmNameResolver +import org.jetbrains.kotlin.resolve.descriptorUtil.classId +import org.jetbrains.kotlin.serialization.SerializerExtension +import org.jetbrains.kotlin.serialization.StringTable +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record +import org.jetbrains.kotlin.types.ErrorUtils +import java.io.OutputStream +import java.util.* + +class JvmStringTable(private val extension: SerializerExtension) : StringTable { + public val strings = ArrayList() + private val records = ArrayList() + private val map = HashMap() + private val localNames = HashSet() + + override fun getStringIndex(string: String): Int = + map.getOrPut(string) { + strings.size().apply { + strings.add(string) + records.add(Record.newBuilder().apply { + // TODO: optimize, don't always store the operation + setOperation(Record.Operation.NONE) + }.build()) + } + } + + override fun getFqNameIndex(descriptor: ClassDescriptor): Int { + if (ErrorUtils.isError(descriptor)) { + throw IllegalStateException("Cannot get FQ name of error class: " + descriptor) + } + + val string: String + val storeAsLiteral: Boolean + + val parent = sequence(descriptor, DeclarationDescriptor::getContainingDeclaration).first { it !is ClassDescriptor } + if (parent is PackageFragmentDescriptor) { + val classId = descriptor.classId + val packageName = classId.packageFqName + val className = classId.relativeClassName.asString() + string = + if (packageName.isRoot) className + else packageName.asString().replace('.', '/') + "/" + className + + // If any of the class names contains '$', we can't simply replace all '$' with '.' upon deserialization. + // This case is rather rare, so we're storing a literal string + storeAsLiteral = '$' in string && classId.relativeClassName.pathSegments().any { '$' in it.asString() } + } + else { + storeAsLiteral = true + string = descriptor.localClassName() + } + + val isLocal = descriptor.containingDeclaration !is ClassOrPackageFragmentDescriptor + + map[string]?.let { recordedIndex -> + if (isLocal == (recordedIndex in localNames)) { + return recordedIndex + } + } + + val index = strings.size() + if (isLocal) { + localNames.add(index) + } + + val record = Record.newBuilder() + + if (storeAsLiteral) { + strings.add(string) + // TODO: optimize, don't always store the operation + record.setOperation(Record.Operation.NONE) + } + else { + val predefinedIndex = JvmNameResolver.getPredefinedStringIndex(string) + if (predefinedIndex != null) { + record.setPredefinedIndex(predefinedIndex) + record.setOperation(Record.Operation.NONE) + // TODO: move all records with predefined names to the end and do not write associated strings for them (since they are ignored) + strings.add("") + } + else { + record.setOperation(Record.Operation.DESC_TO_CLASS_ID) + strings.add("L$string;") + } + } + + records.add(record.build()) + + map[string] = index + + return index + } + + private fun ClassDescriptor.localClassName(): String { + val container = containingDeclaration + return when (container) { + is ClassDescriptor -> container.localClassName() + "." + name.asString() + else -> extension.getLocalClassName(this) + } + } + + override fun serializeTo(output: OutputStream) { + with(JvmProtoBuf.StringTableTypes.newBuilder()) { + addAllRecord(records) + addAllLocalName(localNames) + build().writeDelimitedTo(output) + } + } +} diff --git a/compiler/testData/codegen/bytecodeText/interfaces/noPrivateMemberInJavaInterface.kt b/compiler/testData/codegen/bytecodeText/interfaces/noPrivateMemberInJavaInterface.kt index 8f97d153bd9..416089932f6 100644 --- a/compiler/testData/codegen/bytecodeText/interfaces/noPrivateMemberInJavaInterface.kt +++ b/compiler/testData/codegen/bytecodeText/interfaces/noPrivateMemberInJavaInterface.kt @@ -12,6 +12,6 @@ interface A { } } -// 1 foo +// 1 foo\( // 1 getProp -// 1 defaultFun\$ \ No newline at end of file +// 1 defaultFun\$ diff --git a/compiler/tests/org/jetbrains/kotlin/serialization/DebugProtoBuf.java b/compiler/tests/org/jetbrains/kotlin/serialization/DebugProtoBuf.java index 896ee68679d..3b3f241cf28 100644 --- a/compiler/tests/org/jetbrains/kotlin/serialization/DebugProtoBuf.java +++ b/compiler/tests/org/jetbrains/kotlin/serialization/DebugProtoBuf.java @@ -13042,7 +13042,9 @@ public final class DebugProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ boolean hasFlags(); @@ -13059,7 +13061,9 @@ public final class DebugProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ int getFlags(); @@ -14599,7 +14603,9 @@ public final class DebugProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public boolean hasFlags() { @@ -14618,7 +14624,9 @@ public final class DebugProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public int getFlags() { @@ -15352,7 +15360,9 @@ public final class DebugProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public boolean hasFlags() { @@ -15371,7 +15381,9 @@ public final class DebugProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public int getFlags() { @@ -15390,7 +15402,9 @@ public final class DebugProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public Builder setFlags(int value) { @@ -15412,7 +15426,9 @@ public final class DebugProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public Builder clearFlags() { diff --git a/compiler/tests/org/jetbrains/kotlin/serialization/jvm/DebugJvmProtoBuf.java b/compiler/tests/org/jetbrains/kotlin/serialization/jvm/DebugJvmProtoBuf.java index 264b7970a94..7816ac33e71 100644 --- a/compiler/tests/org/jetbrains/kotlin/serialization/jvm/DebugJvmProtoBuf.java +++ b/compiler/tests/org/jetbrains/kotlin/serialization/jvm/DebugJvmProtoBuf.java @@ -15,6 +15,2150 @@ public final class DebugJvmProtoBuf { registry.add(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.index); registry.add(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.classAnnotation); } + public interface StringTableTypesOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + java.util.List + getRecordList(); + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record getRecord(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + int getRecordCount(); + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + java.util.List + getRecordOrBuilderList(); + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.RecordOrBuilder getRecordOrBuilder( + int index); + + // repeated int32 local_name = 5 [packed = true]; + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + java.util.List getLocalNameList(); + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + int getLocalNameCount(); + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + int getLocalName(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes} + */ + public static final class StringTableTypes extends + com.google.protobuf.GeneratedMessage + implements StringTableTypesOrBuilder { + // Use StringTableTypes.newBuilder() to construct. + private StringTableTypes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private StringTableTypes(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final StringTableTypes defaultInstance; + public static StringTableTypes getDefaultInstance() { + return defaultInstance; + } + + public StringTableTypes getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StringTableTypes( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + record_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + record_.add(input.readMessage(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.PARSER, extensionRegistry)); + break; + } + case 40: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + localName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + localName_.add(input.readInt32()); + break; + } + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) { + localName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + localName_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + record_ = java.util.Collections.unmodifiableList(record_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + localName_ = java.util.Collections.unmodifiableList(localName_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.class, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public StringTableTypes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StringTableTypes(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface RecordOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional int32 range = 1 [default = 1]; + /** + * optional int32 range = 1 [default = 1]; + * + *
+       * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+       * 
+ */ + boolean hasRange(); + /** + * optional int32 range = 1 [default = 1]; + * + *
+       * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+       * 
+ */ + int getRange(); + + // optional int32 predefined_index = 2; + /** + * optional int32 predefined_index = 2; + * + *
+       * Index of the predefined constant. If this field is present, the associated string is ignored
+       * 
+ */ + boolean hasPredefinedIndex(); + /** + * optional int32 predefined_index = 2; + * + *
+       * Index of the predefined constant. If this field is present, the associated string is ignored
+       * 
+ */ + int getPredefinedIndex(); + + // optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + boolean hasOperation(); + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation getOperation(); + + // repeated int32 substring_index = 4 [packed = true]; + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + java.util.List getSubstringIndexList(); + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + int getSubstringIndexCount(); + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + int getSubstringIndex(int index); + + // repeated int32 replace_char = 5 [packed = true]; + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + java.util.List getReplaceCharList(); + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + int getReplaceCharCount(); + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + int getReplaceChar(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record} + */ + public static final class Record extends + com.google.protobuf.GeneratedMessage + implements RecordOrBuilder { + // Use Record.newBuilder() to construct. + private Record(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Record(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Record defaultInstance; + public static Record getDefaultInstance() { + return defaultInstance; + } + + public Record getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Record( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + range_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + predefinedIndex_ = input.readInt32(); + break; + } + case 24: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation value = org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + bitField0_ |= 0x00000004; + operation_ = value; + } + break; + } + case 32: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + substringIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + substringIndex_.add(input.readInt32()); + break; + } + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) { + substringIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + while (input.getBytesUntilLimit() > 0) { + substringIndex_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 40: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + replaceChar_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + replaceChar_.add(input.readInt32()); + break; + } + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) { + replaceChar_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + while (input.getBytesUntilLimit() > 0) { + replaceChar_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + substringIndex_ = java.util.Collections.unmodifiableList(substringIndex_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + replaceChar_ = java.util.Collections.unmodifiableList(replaceChar_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.class, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Record parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Record(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation} + */ + public enum Operation + implements com.google.protobuf.ProtocolMessageEnum { + /** + * NONE = 0; + */ + NONE(0, 0), + /** + * INTERNAL_TO_CLASS_ID = 1; + * + *
+         * replaceAll('$', '.')
+         * java/util/Map$Entry -> java/util/Map.Entry;
+         * 
+ */ + INTERNAL_TO_CLASS_ID(1, 1), + /** + * DESC_TO_CLASS_ID = 2; + * + *
+         * substring(1, length - 1) and then replaceAll('$', '.')
+         * Ljava/util/Map$Entry; -> java/util/Map.Entry
+         * 
+ */ + DESC_TO_CLASS_ID(2, 2), + ; + + /** + * NONE = 0; + */ + public static final int NONE_VALUE = 0; + /** + * INTERNAL_TO_CLASS_ID = 1; + * + *
+         * replaceAll('$', '.')
+         * java/util/Map$Entry -> java/util/Map.Entry;
+         * 
+ */ + public static final int INTERNAL_TO_CLASS_ID_VALUE = 1; + /** + * DESC_TO_CLASS_ID = 2; + * + *
+         * substring(1, length - 1) and then replaceAll('$', '.')
+         * Ljava/util/Map$Entry; -> java/util/Map.Entry
+         * 
+ */ + public static final int DESC_TO_CLASS_ID_VALUE = 2; + + + public final int getNumber() { return value; } + + public static Operation valueOf(int value) { + switch (value) { + case 0: return NONE; + case 1: return INTERNAL_TO_CLASS_ID; + case 2: return DESC_TO_CLASS_ID; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Operation findValueByNumber(int number) { + return Operation.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.getDescriptor().getEnumTypes().get(0); + } + + private static final Operation[] VALUES = values(); + + public static Operation valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private Operation(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation) + } + + private int bitField0_; + // optional int32 range = 1 [default = 1]; + public static final int RANGE_FIELD_NUMBER = 1; + private int range_; + /** + * optional int32 range = 1 [default = 1]; + * + *
+       * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+       * 
+ */ + public boolean hasRange() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 range = 1 [default = 1]; + * + *
+       * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+       * 
+ */ + public int getRange() { + return range_; + } + + // optional int32 predefined_index = 2; + public static final int PREDEFINED_INDEX_FIELD_NUMBER = 2; + private int predefinedIndex_; + /** + * optional int32 predefined_index = 2; + * + *
+       * Index of the predefined constant. If this field is present, the associated string is ignored
+       * 
+ */ + public boolean hasPredefinedIndex() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 predefined_index = 2; + * + *
+       * Index of the predefined constant. If this field is present, the associated string is ignored
+       * 
+ */ + public int getPredefinedIndex() { + return predefinedIndex_; + } + + // optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + public static final int OPERATION_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation operation_; + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation getOperation() { + return operation_; + } + + // repeated int32 substring_index = 4 [packed = true]; + public static final int SUBSTRING_INDEX_FIELD_NUMBER = 4; + private java.util.List substringIndex_; + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + public java.util.List + getSubstringIndexList() { + return substringIndex_; + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + public int getSubstringIndexCount() { + return substringIndex_.size(); + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + public int getSubstringIndex(int index) { + return substringIndex_.get(index); + } + private int substringIndexMemoizedSerializedSize = -1; + + // repeated int32 replace_char = 5 [packed = true]; + public static final int REPLACE_CHAR_FIELD_NUMBER = 5; + private java.util.List replaceChar_; + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + public java.util.List + getReplaceCharList() { + return replaceChar_; + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + public int getReplaceCharCount() { + return replaceChar_.size(); + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + public int getReplaceChar(int index) { + return replaceChar_.get(index); + } + private int replaceCharMemoizedSerializedSize = -1; + + private void initFields() { + range_ = 1; + predefinedIndex_ = 0; + operation_ = org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation.NONE; + substringIndex_ = java.util.Collections.emptyList(); + replaceChar_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, range_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, predefinedIndex_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, operation_.getNumber()); + } + if (getSubstringIndexList().size() > 0) { + output.writeRawVarint32(34); + output.writeRawVarint32(substringIndexMemoizedSerializedSize); + } + for (int i = 0; i < substringIndex_.size(); i++) { + output.writeInt32NoTag(substringIndex_.get(i)); + } + if (getReplaceCharList().size() > 0) { + output.writeRawVarint32(42); + output.writeRawVarint32(replaceCharMemoizedSerializedSize); + } + for (int i = 0; i < replaceChar_.size(); i++) { + output.writeInt32NoTag(replaceChar_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, range_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, predefinedIndex_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, operation_.getNumber()); + } + { + int dataSize = 0; + for (int i = 0; i < substringIndex_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(substringIndex_.get(i)); + } + size += dataSize; + if (!getSubstringIndexList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + substringIndexMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < replaceChar_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(replaceChar_.get(i)); + } + size += dataSize; + if (!getReplaceCharList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + replaceCharMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.RecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.class, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder.class); + } + + // Construct using org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + range_ = 1; + bitField0_ = (bitField0_ & ~0x00000001); + predefinedIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + operation_ = org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation.NONE; + bitField0_ = (bitField0_ & ~0x00000004); + substringIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + replaceChar_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_descriptor; + } + + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record build() { + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record buildPartial() { + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record result = new org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.range_ = range_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.predefinedIndex_ = predefinedIndex_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.operation_ = operation_; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + substringIndex_ = java.util.Collections.unmodifiableList(substringIndex_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.substringIndex_ = substringIndex_; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + replaceChar_ = java.util.Collections.unmodifiableList(replaceChar_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.replaceChar_ = replaceChar_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record) { + return mergeFrom((org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record other) { + if (other == org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.getDefaultInstance()) return this; + if (other.hasRange()) { + setRange(other.getRange()); + } + if (other.hasPredefinedIndex()) { + setPredefinedIndex(other.getPredefinedIndex()); + } + if (other.hasOperation()) { + setOperation(other.getOperation()); + } + if (!other.substringIndex_.isEmpty()) { + if (substringIndex_.isEmpty()) { + substringIndex_ = other.substringIndex_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSubstringIndexIsMutable(); + substringIndex_.addAll(other.substringIndex_); + } + onChanged(); + } + if (!other.replaceChar_.isEmpty()) { + if (replaceChar_.isEmpty()) { + replaceChar_ = other.replaceChar_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureReplaceCharIsMutable(); + replaceChar_.addAll(other.replaceChar_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional int32 range = 1 [default = 1]; + private int range_ = 1; + /** + * optional int32 range = 1 [default = 1]; + * + *
+         * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+         * 
+ */ + public boolean hasRange() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 range = 1 [default = 1]; + * + *
+         * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+         * 
+ */ + public int getRange() { + return range_; + } + /** + * optional int32 range = 1 [default = 1]; + * + *
+         * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+         * 
+ */ + public Builder setRange(int value) { + bitField0_ |= 0x00000001; + range_ = value; + onChanged(); + return this; + } + /** + * optional int32 range = 1 [default = 1]; + * + *
+         * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+         * 
+ */ + public Builder clearRange() { + bitField0_ = (bitField0_ & ~0x00000001); + range_ = 1; + onChanged(); + return this; + } + + // optional int32 predefined_index = 2; + private int predefinedIndex_ ; + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + public boolean hasPredefinedIndex() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + public int getPredefinedIndex() { + return predefinedIndex_; + } + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + public Builder setPredefinedIndex(int value) { + bitField0_ |= 0x00000002; + predefinedIndex_ = value; + onChanged(); + return this; + } + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + public Builder clearPredefinedIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + predefinedIndex_ = 0; + onChanged(); + return this; + } + + // optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + private org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation operation_ = org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation.NONE; + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation getOperation() { + return operation_; + } + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public Builder setOperation(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + operation_ = value; + onChanged(); + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public Builder clearOperation() { + bitField0_ = (bitField0_ & ~0x00000004); + operation_ = org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Operation.NONE; + onChanged(); + return this; + } + + // repeated int32 substring_index = 4 [packed = true]; + private java.util.List substringIndex_ = java.util.Collections.emptyList(); + private void ensureSubstringIndexIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + substringIndex_ = new java.util.ArrayList(substringIndex_); + bitField0_ |= 0x00000008; + } + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public java.util.List + getSubstringIndexList() { + return java.util.Collections.unmodifiableList(substringIndex_); + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public int getSubstringIndexCount() { + return substringIndex_.size(); + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public int getSubstringIndex(int index) { + return substringIndex_.get(index); + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public Builder setSubstringIndex( + int index, int value) { + ensureSubstringIndexIsMutable(); + substringIndex_.set(index, value); + onChanged(); + return this; + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public Builder addSubstringIndex(int value) { + ensureSubstringIndexIsMutable(); + substringIndex_.add(value); + onChanged(); + return this; + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public Builder addAllSubstringIndex( + java.lang.Iterable values) { + ensureSubstringIndexIsMutable(); + super.addAll(values, substringIndex_); + onChanged(); + return this; + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public Builder clearSubstringIndex() { + substringIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + // repeated int32 replace_char = 5 [packed = true]; + private java.util.List replaceChar_ = java.util.Collections.emptyList(); + private void ensureReplaceCharIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + replaceChar_ = new java.util.ArrayList(replaceChar_); + bitField0_ |= 0x00000010; + } + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public java.util.List + getReplaceCharList() { + return java.util.Collections.unmodifiableList(replaceChar_); + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public int getReplaceCharCount() { + return replaceChar_.size(); + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public int getReplaceChar(int index) { + return replaceChar_.get(index); + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public Builder setReplaceChar( + int index, int value) { + ensureReplaceCharIsMutable(); + replaceChar_.set(index, value); + onChanged(); + return this; + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public Builder addReplaceChar(int value) { + ensureReplaceCharIsMutable(); + replaceChar_.add(value); + onChanged(); + return this; + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public Builder addAllReplaceChar( + java.lang.Iterable values) { + ensureReplaceCharIsMutable(); + super.addAll(values, replaceChar_); + onChanged(); + return this; + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public Builder clearReplaceChar() { + replaceChar_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record) + } + + static { + defaultInstance = new Record(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record) + } + + // repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + public static final int RECORD_FIELD_NUMBER = 1; + private java.util.List record_; + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List getRecordList() { + return record_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List + getRecordOrBuilderList() { + return record_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public int getRecordCount() { + return record_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record getRecord(int index) { + return record_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.RecordOrBuilder getRecordOrBuilder( + int index) { + return record_.get(index); + } + + // repeated int32 local_name = 5 [packed = true]; + public static final int LOCAL_NAME_FIELD_NUMBER = 5; + private java.util.List localName_; + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + public java.util.List + getLocalNameList() { + return localName_; + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + public int getLocalNameCount() { + return localName_.size(); + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + public int getLocalName(int index) { + return localName_.get(index); + } + private int localNameMemoizedSerializedSize = -1; + + private void initFields() { + record_ = java.util.Collections.emptyList(); + localName_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < record_.size(); i++) { + output.writeMessage(1, record_.get(i)); + } + if (getLocalNameList().size() > 0) { + output.writeRawVarint32(42); + output.writeRawVarint32(localNameMemoizedSerializedSize); + } + for (int i = 0; i < localName_.size(); i++) { + output.writeInt32NoTag(localName_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < record_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, record_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < localName_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(localName_.get(i)); + } + size += dataSize; + if (!getLocalNameList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + localNameMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.class, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Builder.class); + } + + // Construct using org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getRecordFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (recordBuilder_ == null) { + record_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + recordBuilder_.clear(); + } + localName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_descriptor; + } + + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes build() { + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes buildPartial() { + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes result = new org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes(this); + int from_bitField0_ = bitField0_; + if (recordBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + record_ = java.util.Collections.unmodifiableList(record_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.record_ = record_; + } else { + result.record_ = recordBuilder_.build(); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + localName_ = java.util.Collections.unmodifiableList(localName_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.localName_ = localName_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes) { + return mergeFrom((org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes other) { + if (other == org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.getDefaultInstance()) return this; + if (recordBuilder_ == null) { + if (!other.record_.isEmpty()) { + if (record_.isEmpty()) { + record_ = other.record_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRecordIsMutable(); + record_.addAll(other.record_); + } + onChanged(); + } + } else { + if (!other.record_.isEmpty()) { + if (recordBuilder_.isEmpty()) { + recordBuilder_.dispose(); + recordBuilder_ = null; + record_ = other.record_; + bitField0_ = (bitField0_ & ~0x00000001); + recordBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getRecordFieldBuilder() : null; + } else { + recordBuilder_.addAllMessages(other.record_); + } + } + } + if (!other.localName_.isEmpty()) { + if (localName_.isEmpty()) { + localName_ = other.localName_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLocalNameIsMutable(); + localName_.addAll(other.localName_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + private java.util.List record_ = + java.util.Collections.emptyList(); + private void ensureRecordIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + record_ = new java.util.ArrayList(record_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.RecordOrBuilder> recordBuilder_; + + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List getRecordList() { + if (recordBuilder_ == null) { + return java.util.Collections.unmodifiableList(record_); + } else { + return recordBuilder_.getMessageList(); + } + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public int getRecordCount() { + if (recordBuilder_ == null) { + return record_.size(); + } else { + return recordBuilder_.getCount(); + } + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record getRecord(int index) { + if (recordBuilder_ == null) { + return record_.get(index); + } else { + return recordBuilder_.getMessage(index); + } + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder setRecord( + int index, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record value) { + if (recordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.set(index, value); + onChanged(); + } else { + recordBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder setRecord( + int index, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder builderForValue) { + if (recordBuilder_ == null) { + ensureRecordIsMutable(); + record_.set(index, builderForValue.build()); + onChanged(); + } else { + recordBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord(org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record value) { + if (recordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.add(value); + onChanged(); + } else { + recordBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + int index, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record value) { + if (recordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.add(index, value); + onChanged(); + } else { + recordBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder builderForValue) { + if (recordBuilder_ == null) { + ensureRecordIsMutable(); + record_.add(builderForValue.build()); + onChanged(); + } else { + recordBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + int index, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder builderForValue) { + if (recordBuilder_ == null) { + ensureRecordIsMutable(); + record_.add(index, builderForValue.build()); + onChanged(); + } else { + recordBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addAllRecord( + java.lang.Iterable values) { + if (recordBuilder_ == null) { + ensureRecordIsMutable(); + super.addAll(values, record_); + onChanged(); + } else { + recordBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder clearRecord() { + if (recordBuilder_ == null) { + record_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + recordBuilder_.clear(); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder removeRecord(int index) { + if (recordBuilder_ == null) { + ensureRecordIsMutable(); + record_.remove(index); + onChanged(); + } else { + recordBuilder_.remove(index); + } + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder getRecordBuilder( + int index) { + return getRecordFieldBuilder().getBuilder(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.RecordOrBuilder getRecordOrBuilder( + int index) { + if (recordBuilder_ == null) { + return record_.get(index); } else { + return recordBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List + getRecordOrBuilderList() { + if (recordBuilder_ != null) { + return recordBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(record_); + } + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder addRecordBuilder() { + return getRecordFieldBuilder().addBuilder( + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.getDefaultInstance()); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder addRecordBuilder( + int index) { + return getRecordFieldBuilder().addBuilder( + index, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.getDefaultInstance()); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List + getRecordBuilderList() { + return getRecordFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.RecordOrBuilder> + getRecordFieldBuilder() { + if (recordBuilder_ == null) { + recordBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.Record.Builder, org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf.StringTableTypes.RecordOrBuilder>( + record_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + record_ = null; + } + return recordBuilder_; + } + + // repeated int32 local_name = 5 [packed = true]; + private java.util.List localName_ = java.util.Collections.emptyList(); + private void ensureLocalNameIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + localName_ = new java.util.ArrayList(localName_); + bitField0_ |= 0x00000002; + } + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public java.util.List + getLocalNameList() { + return java.util.Collections.unmodifiableList(localName_); + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public int getLocalNameCount() { + return localName_.size(); + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public int getLocalName(int index) { + return localName_.get(index); + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public Builder setLocalName( + int index, int value) { + ensureLocalNameIsMutable(); + localName_.set(index, value); + onChanged(); + return this; + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public Builder addLocalName(int value) { + ensureLocalNameIsMutable(); + localName_.add(value); + onChanged(); + return this; + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public Builder addAllLocalName( + java.lang.Iterable values) { + ensureLocalNameIsMutable(); + super.addAll(values, localName_); + onChanged(); + return this; + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public Builder clearLocalName() { + localName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes) + } + + static { + defaultInstance = new StringTableTypes(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes) + } + public interface JvmMethodSignatureOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -31,10 +2175,18 @@ public final class DebugJvmProtoBuf { // required int32 desc = 2; /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
*/ boolean hasDesc(); /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
*/ int getDesc(); } @@ -160,12 +2312,20 @@ public final class DebugJvmProtoBuf { private int desc_; /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
*/ public boolean hasDesc() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
*/ public int getDesc() { return desc_; @@ -468,18 +2628,30 @@ public final class DebugJvmProtoBuf { private int desc_ ; /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
*/ public boolean hasDesc() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
*/ public int getDesc() { return desc_; } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
*/ public Builder setDesc(int value) { bitField0_ |= 0x00000002; @@ -489,6 +2661,10 @@ public final class DebugJvmProtoBuf { } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
*/ public Builder clearDesc() { bitField0_ = (bitField0_ & ~0x00000002); @@ -524,10 +2700,18 @@ public final class DebugJvmProtoBuf { // required int32 desc = 2; /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
*/ boolean hasDesc(); /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
*/ int getDesc(); @@ -678,12 +2862,20 @@ public final class DebugJvmProtoBuf { private int desc_; /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
*/ public boolean hasDesc() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
*/ public int getDesc() { return desc_; @@ -1029,18 +3221,30 @@ public final class DebugJvmProtoBuf { private int desc_ ; /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
*/ public boolean hasDesc() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
*/ public int getDesc() { return desc_; } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
*/ public Builder setDesc(int value) { bitField0_ |= 0x00000002; @@ -1050,6 +3254,10 @@ public final class DebugJvmProtoBuf { } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
*/ public Builder clearDesc() { bitField0_ = (bitField0_ & ~0x00000002); @@ -2390,6 +4598,16 @@ public final class DebugJvmProtoBuf { .newFileScopedGeneratedExtension( org.jetbrains.kotlin.serialization.DebugProtoBuf.Annotation.class, org.jetbrains.kotlin.serialization.DebugProtoBuf.Annotation.getDefaultInstance()); + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_org_jetbrains_kotlin_serialization_jvm_JvmMethodSignature_descriptor; private static @@ -2419,57 +4637,79 @@ public final class DebugJvmProtoBuf { "lin.serialization.jvm\0320core/deserializat" + "ion/src/ext_options.debug.proto\0320core/de" + "serialization/src/descriptors.debug.prot" + - "o\"<\n\022JvmMethodSignature\022\022\n\004name\030\001 \002(\005B\004\230" + - "\265\030\001\022\022\n\004desc\030\002 \002(\005B\004\230\265\030\001\"^\n\021JvmFieldSigna" + - "ture\022\022\n\004name\030\001 \002(\005B\004\230\265\030\001\022\022\n\004desc\030\002 \002(\005B\004" + - "\230\265\030\001\022!\n\022is_static_in_outer\030\003 \001(\010:\005false\"" + - "\316\002\n\024JvmPropertySignature\022H\n\005field\030\001 \001(\0132", - "9.org.jetbrains.kotlin.serialization.jvm" + - ".JvmFieldSignature\022T\n\020synthetic_method\030\002" + - " \001(\0132:.org.jetbrains.kotlin.serializatio" + - "n.jvm.JvmMethodSignature\022J\n\006getter\030\003 \001(\013" + - "2:.org.jetbrains.kotlin.serialization.jv" + - "m.JvmMethodSignature\022J\n\006setter\030\004 \001(\0132:.o" + - "rg.jetbrains.kotlin.serialization.jvm.Jv" + - "mMethodSignature:\202\001\n\020method_signature\022,." + - "org.jetbrains.kotlin.serialization.Calla" + - "ble\030d \001(\0132:.org.jetbrains.kotlin.seriali", - "zation.jvm.JvmMethodSignature:\206\001\n\022proper" + - "ty_signature\022,.org.jetbrains.kotlin.seri" + - "alization.Callable\030e \001(\0132<.org.jetbrains" + - ".kotlin.serialization.jvm.JvmPropertySig" + - "nature:K\n\017impl_class_name\022,.org.jetbrain" + - "s.kotlin.serialization.Callable\030f \001(\005B\004\210" + - "\265\030\001:q\n\017type_annotation\022(.org.jetbrains.k" + - "otlin.serialization.Type\030d \003(\0132..org.jet" + - "brains.kotlin.serialization.Annotation:8" + - "\n\006is_raw\022(.org.jetbrains.kotlin.serializ", - "ation.Type\030e \001(\010:J\n\005index\022;.org.jetbrain" + - "s.kotlin.serialization.Callable.ValuePar" + - "ameter\030d \001(\005:s\n\020class_annotation\022).org.j" + - "etbrains.kotlin.serialization.Class\030d \003(" + - "\0132..org.jetbrains.kotlin.serialization.A" + - "nnotationB\022B\020DebugJvmProtoBuf" + "o\"\224\003\n\020StringTableTypes\022O\n\006record\030\001 \003(\0132?" + + ".org.jetbrains.kotlin.serialization.jvm." + + "StringTableTypes.Record\022\026\n\nlocal_name\030\005 " + + "\003(\005B\002\020\001\032\226\002\n\006Record\022\020\n\005range\030\001 \001(\005:\0011\022\030\n\020" + + "predefined_index\030\002 \001(\005\022b\n\toperation\030\003 \001(", + "\0162I.org.jetbrains.kotlin.serialization.j" + + "vm.StringTableTypes.Record.Operation:\004NO" + + "NE\022\033\n\017substring_index\030\004 \003(\005B\002\020\001\022\030\n\014repla" + + "ce_char\030\005 \003(\005B\002\020\001\"E\n\tOperation\022\010\n\004NONE\020\000" + + "\022\030\n\024INTERNAL_TO_CLASS_ID\020\001\022\024\n\020DESC_TO_CL" + + "ASS_ID\020\002\"<\n\022JvmMethodSignature\022\022\n\004name\030\001" + + " \002(\005B\004\230\265\030\001\022\022\n\004desc\030\002 \002(\005B\004\230\265\030\001\"^\n\021JvmFie" + + "ldSignature\022\022\n\004name\030\001 \002(\005B\004\230\265\030\001\022\022\n\004desc\030" + + "\002 \002(\005B\004\230\265\030\001\022!\n\022is_static_in_outer\030\003 \001(\010:" + + "\005false\"\316\002\n\024JvmPropertySignature\022H\n\005field", + "\030\001 \001(\01329.org.jetbrains.kotlin.serializat" + + "ion.jvm.JvmFieldSignature\022T\n\020synthetic_m" + + "ethod\030\002 \001(\0132:.org.jetbrains.kotlin.seria" + + "lization.jvm.JvmMethodSignature\022J\n\006gette" + + "r\030\003 \001(\0132:.org.jetbrains.kotlin.serializa" + + "tion.jvm.JvmMethodSignature\022J\n\006setter\030\004 " + + "\001(\0132:.org.jetbrains.kotlin.serialization" + + ".jvm.JvmMethodSignature:\202\001\n\020method_signa" + + "ture\022,.org.jetbrains.kotlin.serializatio" + + "n.Callable\030d \001(\0132:.org.jetbrains.kotlin.", + "serialization.jvm.JvmMethodSignature:\206\001\n" + + "\022property_signature\022,.org.jetbrains.kotl" + + "in.serialization.Callable\030e \001(\0132<.org.je" + + "tbrains.kotlin.serialization.jvm.JvmProp" + + "ertySignature:K\n\017impl_class_name\022,.org.j" + + "etbrains.kotlin.serialization.Callable\030f" + + " \001(\005B\004\210\265\030\001:q\n\017type_annotation\022(.org.jetb" + + "rains.kotlin.serialization.Type\030d \003(\0132.." + + "org.jetbrains.kotlin.serialization.Annot" + + "ation:8\n\006is_raw\022(.org.jetbrains.kotlin.s", + "erialization.Type\030e \001(\010:J\n\005index\022;.org.j" + + "etbrains.kotlin.serialization.Callable.V" + + "alueParameter\030d \001(\005:s\n\020class_annotation\022" + + ").org.jetbrains.kotlin.serialization.Cla" + + "ss\030d \003(\0132..org.jetbrains.kotlin.serializ" + + "ation.AnnotationB\022B\020DebugJvmProtoBuf" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; - internal_static_org_jetbrains_kotlin_serialization_jvm_JvmMethodSignature_descriptor = + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_descriptor, + new java.lang.String[] { "Record", "LocalName", }); + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_descriptor = + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_descriptor.getNestedTypes().get(0); + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_jetbrains_kotlin_serialization_jvm_StringTableTypes_Record_descriptor, + new java.lang.String[] { "Range", "PredefinedIndex", "Operation", "SubstringIndex", "ReplaceChar", }); + internal_static_org_jetbrains_kotlin_serialization_jvm_JvmMethodSignature_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_org_jetbrains_kotlin_serialization_jvm_JvmMethodSignature_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_kotlin_serialization_jvm_JvmMethodSignature_descriptor, new java.lang.String[] { "Name", "Desc", }); internal_static_org_jetbrains_kotlin_serialization_jvm_JvmFieldSignature_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(2); internal_static_org_jetbrains_kotlin_serialization_jvm_JvmFieldSignature_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_kotlin_serialization_jvm_JvmFieldSignature_descriptor, new java.lang.String[] { "Name", "Desc", "IsStaticInOuter", }); internal_static_org_jetbrains_kotlin_serialization_jvm_JvmPropertySignature_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(3); internal_static_org_jetbrains_kotlin_serialization_jvm_JvmPropertySignature_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_kotlin_serialization_jvm_JvmPropertySignature_descriptor, diff --git a/compiler/tests/org/jetbrains/kotlin/serialization/jvm/JvmNameResolverTest.kt b/compiler/tests/org/jetbrains/kotlin/serialization/jvm/JvmNameResolverTest.kt new file mode 100644 index 00000000000..9a415f8df2d --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/serialization/jvm/JvmNameResolverTest.kt @@ -0,0 +1,161 @@ +/* + * Copyright 2010-2015 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.kotlin.serialization.jvm + +import com.intellij.testFramework.UsefulTestCase +import org.jetbrains.kotlin.load.kotlin.JvmNameResolver +import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.DESC_TO_CLASS_ID +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.INTERNAL_TO_CLASS_ID +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.NONE +import java.util.* +import kotlin.test.assertEquals + +class JvmNameResolverTest : UsefulTestCase() { + private class Context { + val types = JvmProtoBuf.StringTableTypes.newBuilder() + val strings = ArrayList() + + fun string( + string: String?, + range: Int? = null, + predefinedIndex: Int? = null, + operation: Record.Operation? = null, + substringIndex: List? = null, + replaceChar: List? = null + ) { + types.addRecord(Record.newBuilder().apply { + range?.let { setRange(it) } + predefinedIndex?.let { setPredefinedIndex(it) } + operation?.let { setOperation(it) } + substringIndex?.let { addAllSubstringIndex(it) } + replaceChar?.let { addAllReplaceChar(it.map(Char::toInt)) } + }.build()) + + string?.let { strings.add(it) } + } + } + + private fun create(init: Context.() -> Unit): JvmNameResolver { + return Context().run { + init() + JvmNameResolver(types.build(), strings.toTypedArray()) + } + } + + private fun str(string: String?, predefinedIndex: Int? = null, operation: Record.Operation? = null): String { + return create { string(string, null, predefinedIndex, operation, null, null) }.getString(0) + } + + fun testSimpleString() { + assertEquals("abc", str("abc")) + } + + fun testSimpleClassId() { + assertEquals( + ClassId.topLevel(FqName("foo.bar.Baz")), + create { string("Lfoo/bar/Baz;", operation = DESC_TO_CLASS_ID) }.getClassId(0) + ) + } + + fun testBasicOperations() { + assertEquals("java/util/Map.Entry", str("Ljava/util/Map\$Entry;", operation = DESC_TO_CLASS_ID)) + assertEquals("java/util/Map.Entry", str("java/util/Map\$Entry", operation = INTERNAL_TO_CLASS_ID)) + } + + fun testPredefined() { + for ((index, predefined) in JvmNameResolver.PREDEFINED_STRINGS.withIndex()) { + assertEquals(predefined, str("ignored", predefinedIndex = index), "Predefined string failed: $predefined (index $index)") + } + } + + fun testNotExistingPredefinedString() { + assertEquals("not-ignored", str("not-ignored", predefinedIndex = 123456789)) + } + + fun testOperationOnBadString() { + assertEquals("X", str("X", operation = DESC_TO_CLASS_ID)) + assertEquals("", str("", operation = DESC_TO_CLASS_ID)) + } + + fun testSubstring() { + val n = create { + string("kotlin", substringIndex = listOf(0, 6)) + string("kotlin", substringIndex = listOf(1, 4)) + string("kotlin", substringIndex = listOf(6, 6)) + + // Invalid operations + string("kotlin", substringIndex = listOf(7, 5)) + string("kotlin", substringIndex = listOf(0, -2)) + string("kotlin", substringIndex = listOf(3, 1)) + } + + assertEquals("kotlin", n.getString(0)) + assertEquals("otl", n.getString(1)) + assertEquals("", n.getString(2)) + + // All invalid operations should be ignored + (3..5).forEach { assertEquals("kotlin", n.getString(it)) } + } + + fun testSubstringHappensAfterOperation() { + assertEquals("tl", create { + string("kotlin", substringIndex = listOf(1, 5), operation = DESC_TO_CLASS_ID) + }.getString(0)) + } + + fun testReplaceAll() { + val n = create { + string("kotlin", replaceChar = listOf('k', 'm')) + string("java", replaceChar = listOf('a', 'o', 'a', 'b', 'c', 'd')) // All chars after the first two are ignored + + // Invalid operations + string("kotlin", replaceChar = listOf()) + string("kotlin", replaceChar = listOf('k')) + } + + assertEquals("motlin", n.getString(0)) + assertEquals("jovo", n.getString(1)) + + // All invalid operations should be ignored + (2..3).forEach { assertEquals("kotlin", n.getString(it)) } + } + + fun testRange() { + val n = create { + string("a\$b\$c", operation = INTERNAL_TO_CLASS_ID, range = 2) + string("d\$e\$f", operation = NONE, range = 2) + string("abc") + string("def") + } + + assertEquals("d.e.f", n.getString(1)) + assertEquals("def", n.getString(3)) + } + + fun testRangeWithDifferentOperations() { + val n = create { + string("a\$b\$c", operation = INTERNAL_TO_CLASS_ID, range = 2) + string("d\$e\$f", operation = NONE, substringIndex = listOf(2, 5)) + } + + assertEquals("a.b.c", n.getString(0)) + assertEquals("d.e.f", n.getString(1)) + } +} diff --git a/core/descriptor.loader.java/src/jvm_descriptors.proto b/core/descriptor.loader.java/src/jvm_descriptors.proto index b3048e1a5b6..99c0341f18a 100644 --- a/core/descriptor.loader.java/src/jvm_descriptors.proto +++ b/core/descriptor.loader.java/src/jvm_descriptors.proto @@ -22,6 +22,45 @@ import "core/deserialization/src/descriptors.proto"; option java_outer_classname = "JvmProtoBuf"; option optimize_for = LITE_RUNTIME; +message StringTableTypes { + message Record { + // The number of times this record should be repeated; this is used to collapse identical subsequent records in the list + optional int32 range = 1 [default = 1]; + + // Index of the predefined constant. If this field is present, the associated string is ignored + optional int32 predefined_index = 2; + + enum Operation { + NONE = 0; + + // replaceAll('$', '.') + // java/util/Map$Entry -> java/util/Map.Entry; + INTERNAL_TO_CLASS_ID = 1; + + // substring(1, length - 1) and then replaceAll('$', '.') + // Ljava/util/Map$Entry; -> java/util/Map.Entry + DESC_TO_CLASS_ID = 2; + } + + // Perform a described operation on the string + optional Operation operation = 3 [default = NONE]; + + // If this field is present, the "substring" operation must be performed with the first element of this list as the start index, + // and the second element as the end index. + // If an operation is not NONE, it's applied _after_ this substring operation + repeated int32 substring_index = 4 [packed = true]; + + // If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point + // of the character to replace, and the second element as the code point of the replacement character + repeated int32 replace_char = 5 [packed = true]; + } + + repeated Record record = 1; + + // Indices of strings which are names of local classes or anonymous objects + repeated int32 local_name = 5 [packed = true]; +} + message JvmMethodSignature { required int32 name = 1 [(string_id_in_table) = true]; diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin/JvmNameResolver.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin/JvmNameResolver.kt new file mode 100644 index 00000000000..1eec26ae51e --- /dev/null +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin/JvmNameResolver.kt @@ -0,0 +1,136 @@ +/* + * Copyright 2010-2015 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.kotlin.load.kotlin + +import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.serialization.deserialization.NameResolver +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.DESC_TO_CLASS_ID +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.INTERNAL_TO_CLASS_ID +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.NONE +import java.util.* + +class JvmNameResolver( + private val types: JvmProtoBuf.StringTableTypes, + private val strings: Array +) : NameResolver { + private val localNameIndices = types.localNameList.run { if (isEmpty()) emptySet() else toSet() } + + // Here we expand the 'range' field of the Record message for simplicity to a list of records + private val records: List = ArrayList().apply { + val records = types.recordList + this.ensureCapacity(records.size()) + for (record in records) { + repeat(record.range) { + this.add(record) + } + } + this.trimToSize() + } + + override fun getString(index: Int): String { + val record = records[index] + + var string = + if (record.hasPredefinedIndex() && record.predefinedIndex in PREDEFINED_STRINGS.indices) + PREDEFINED_STRINGS[record.predefinedIndex] + else strings[index] + + if (record.substringIndexCount >= 2) { + val (begin, end) = record.substringIndexList + if (0 <= begin && begin <= end && end <= string.length()) { + string = string.substring(begin, end) + } + } + + if (record.replaceCharCount >= 2) { + val (from, to) = record.replaceCharList + string = string.replace(from.toChar(), to.toChar()) + } + + when (record.operation ?: NONE) { + NONE -> { + // Do nothing + } + INTERNAL_TO_CLASS_ID -> { + string = string.replace('$', '.') + } + DESC_TO_CLASS_ID -> { + if (string.length() >= 2) { + string = string.substring(1, string.length() - 1) + } + string = string.replace('$', '.') + } + } + + return string + } + + override fun getName(index: Int) = Name.guess(getString(index)) + + override fun getClassId(index: Int): ClassId { + val string = getString(index) + val lastSlash = string.lastIndexOf('/') + val packageName = + if (lastSlash < 0) FqName.ROOT + else FqName(string.substring(0, lastSlash).replace('/', '.')) + val className = FqName(string.substring(lastSlash + 1)) + return ClassId(packageName, className, index in localNameIndices) + } + + companion object { + val PREDEFINED_STRINGS = listOf( + "kotlin/Any", + "kotlin/Nothing", + "kotlin/Unit", + "kotlin/Throwable", + "kotlin/Number", + + "kotlin/Byte", "kotlin/Double", "kotlin/Float", "kotlin/Int", + "kotlin/Long", "kotlin/Short", "kotlin/Boolean", "kotlin/Char", + + "kotlin/CharSequence", + "kotlin/String", + "kotlin/Comparable", + "kotlin/Enum", + + "kotlin/Array", + "kotlin/ByteArray", "kotlin/DoubleArray", "kotlin/FloatArray", "kotlin/IntArray", + "kotlin/LongArray", "kotlin/ShortArray", "kotlin/BooleanArray", "kotlin/CharArray", + + "kotlin/Cloneable", + "kotlin/Annotation", + + "kotlin/Iterable", "kotlin/MutableIterable", + "kotlin/Collection", "kotlin/MutableCollection", + "kotlin/List", "kotlin/MutableList", + "kotlin/Set", "kotlin/MutableSet", + "kotlin/Map", "kotlin/MutableMap", + "kotlin/Map.Entry", "kotlin/MutableMap.MutableEntry", + + "kotlin/Iterator", "kotlin/MutableIterator", + "kotlin/ListIterator", "kotlin/MutableListIterator" + ) + + private val PREDEFINED_STRINGS_MAP = PREDEFINED_STRINGS.withIndex().toMap({ it.value }, { it.index }) + + fun getPredefinedStringIndex(string: String): Int? = PREDEFINED_STRINGS_MAP[string] + } +} diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/serialization/jvm/JvmProtoBuf.java b/core/descriptor.loader.java/src/org/jetbrains/kotlin/serialization/jvm/JvmProtoBuf.java index 44fc3ce33bb..bd469cc7f47 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/serialization/jvm/JvmProtoBuf.java +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/serialization/jvm/JvmProtoBuf.java @@ -15,6 +15,1846 @@ public final class JvmProtoBuf { registry.add(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.index); registry.add(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.classAnnotation); } + public interface StringTableTypesOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + java.util.List + getRecordList(); + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record getRecord(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + int getRecordCount(); + + // repeated int32 local_name = 5 [packed = true]; + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + java.util.List getLocalNameList(); + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + int getLocalNameCount(); + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + int getLocalName(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes} + */ + public static final class StringTableTypes extends + com.google.protobuf.GeneratedMessageLite + implements StringTableTypesOrBuilder { + // Use StringTableTypes.newBuilder() to construct. + private StringTableTypes(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + + } + private StringTableTypes(boolean noInit) {} + + private static final StringTableTypes defaultInstance; + public static StringTableTypes getDefaultInstance() { + return defaultInstance; + } + + public StringTableTypes getDefaultInstanceForType() { + return defaultInstance; + } + + private StringTableTypes( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + record_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + record_.add(input.readMessage(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.PARSER, extensionRegistry)); + break; + } + case 40: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + localName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + localName_.add(input.readInt32()); + break; + } + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) { + localName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + localName_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + record_ = java.util.Collections.unmodifiableList(record_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + localName_ = java.util.Collections.unmodifiableList(localName_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public StringTableTypes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StringTableTypes(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface RecordOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // optional int32 range = 1 [default = 1]; + /** + * optional int32 range = 1 [default = 1]; + * + *
+       * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+       * 
+ */ + boolean hasRange(); + /** + * optional int32 range = 1 [default = 1]; + * + *
+       * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+       * 
+ */ + int getRange(); + + // optional int32 predefined_index = 2; + /** + * optional int32 predefined_index = 2; + * + *
+       * Index of the predefined constant. If this field is present, the associated string is ignored
+       * 
+ */ + boolean hasPredefinedIndex(); + /** + * optional int32 predefined_index = 2; + * + *
+       * Index of the predefined constant. If this field is present, the associated string is ignored
+       * 
+ */ + int getPredefinedIndex(); + + // optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + boolean hasOperation(); + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation getOperation(); + + // repeated int32 substring_index = 4 [packed = true]; + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + java.util.List getSubstringIndexList(); + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + int getSubstringIndexCount(); + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + int getSubstringIndex(int index); + + // repeated int32 replace_char = 5 [packed = true]; + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + java.util.List getReplaceCharList(); + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + int getReplaceCharCount(); + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + int getReplaceChar(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record} + */ + public static final class Record extends + com.google.protobuf.GeneratedMessageLite + implements RecordOrBuilder { + // Use Record.newBuilder() to construct. + private Record(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + + } + private Record(boolean noInit) {} + + private static final Record defaultInstance; + public static Record getDefaultInstance() { + return defaultInstance; + } + + public Record getDefaultInstanceForType() { + return defaultInstance; + } + + private Record( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + range_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + predefinedIndex_ = input.readInt32(); + break; + } + case 24: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation value = org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.valueOf(rawValue); + if (value != null) { + bitField0_ |= 0x00000004; + operation_ = value; + } + break; + } + case 32: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + substringIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + substringIndex_.add(input.readInt32()); + break; + } + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) { + substringIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + while (input.getBytesUntilLimit() > 0) { + substringIndex_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 40: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + replaceChar_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + replaceChar_.add(input.readInt32()); + break; + } + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) { + replaceChar_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + while (input.getBytesUntilLimit() > 0) { + replaceChar_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + substringIndex_ = java.util.Collections.unmodifiableList(substringIndex_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + replaceChar_ = java.util.Collections.unmodifiableList(replaceChar_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Record parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Record(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation} + */ + public enum Operation + implements com.google.protobuf.Internal.EnumLite { + /** + * NONE = 0; + */ + NONE(0, 0), + /** + * INTERNAL_TO_CLASS_ID = 1; + * + *
+         * replaceAll('$', '.')
+         * java/util/Map$Entry -> java/util/Map.Entry;
+         * 
+ */ + INTERNAL_TO_CLASS_ID(1, 1), + /** + * DESC_TO_CLASS_ID = 2; + * + *
+         * substring(1, length - 1) and then replaceAll('$', '.')
+         * Ljava/util/Map$Entry; -> java/util/Map.Entry
+         * 
+ */ + DESC_TO_CLASS_ID(2, 2), + ; + + /** + * NONE = 0; + */ + public static final int NONE_VALUE = 0; + /** + * INTERNAL_TO_CLASS_ID = 1; + * + *
+         * replaceAll('$', '.')
+         * java/util/Map$Entry -> java/util/Map.Entry;
+         * 
+ */ + public static final int INTERNAL_TO_CLASS_ID_VALUE = 1; + /** + * DESC_TO_CLASS_ID = 2; + * + *
+         * substring(1, length - 1) and then replaceAll('$', '.')
+         * Ljava/util/Map$Entry; -> java/util/Map.Entry
+         * 
+ */ + public static final int DESC_TO_CLASS_ID_VALUE = 2; + + + public final int getNumber() { return value; } + + public static Operation valueOf(int value) { + switch (value) { + case 0: return NONE; + case 1: return INTERNAL_TO_CLASS_ID; + case 2: return DESC_TO_CLASS_ID; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Operation findValueByNumber(int number) { + return Operation.valueOf(number); + } + }; + + private final int value; + + private Operation(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation) + } + + private int bitField0_; + // optional int32 range = 1 [default = 1]; + public static final int RANGE_FIELD_NUMBER = 1; + private int range_; + /** + * optional int32 range = 1 [default = 1]; + * + *
+       * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+       * 
+ */ + public boolean hasRange() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 range = 1 [default = 1]; + * + *
+       * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+       * 
+ */ + public int getRange() { + return range_; + } + + // optional int32 predefined_index = 2; + public static final int PREDEFINED_INDEX_FIELD_NUMBER = 2; + private int predefinedIndex_; + /** + * optional int32 predefined_index = 2; + * + *
+       * Index of the predefined constant. If this field is present, the associated string is ignored
+       * 
+ */ + public boolean hasPredefinedIndex() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 predefined_index = 2; + * + *
+       * Index of the predefined constant. If this field is present, the associated string is ignored
+       * 
+ */ + public int getPredefinedIndex() { + return predefinedIndex_; + } + + // optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + public static final int OPERATION_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation operation_; + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation getOperation() { + return operation_; + } + + // repeated int32 substring_index = 4 [packed = true]; + public static final int SUBSTRING_INDEX_FIELD_NUMBER = 4; + private java.util.List substringIndex_; + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + public java.util.List + getSubstringIndexList() { + return substringIndex_; + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + public int getSubstringIndexCount() { + return substringIndex_.size(); + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+       * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+       * and the second element as the end index.
+       * If an operation is not NONE, it's applied _after_ this substring operation
+       * 
+ */ + public int getSubstringIndex(int index) { + return substringIndex_.get(index); + } + private int substringIndexMemoizedSerializedSize = -1; + + // repeated int32 replace_char = 5 [packed = true]; + public static final int REPLACE_CHAR_FIELD_NUMBER = 5; + private java.util.List replaceChar_; + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + public java.util.List + getReplaceCharList() { + return replaceChar_; + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + public int getReplaceCharCount() { + return replaceChar_.size(); + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+       * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+       * of the character to replace, and the second element as the code point of the replacement character
+       * 
+ */ + public int getReplaceChar(int index) { + return replaceChar_.get(index); + } + private int replaceCharMemoizedSerializedSize = -1; + + private void initFields() { + range_ = 1; + predefinedIndex_ = 0; + operation_ = org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.NONE; + substringIndex_ = java.util.Collections.emptyList(); + replaceChar_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, range_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, predefinedIndex_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, operation_.getNumber()); + } + if (getSubstringIndexList().size() > 0) { + output.writeRawVarint32(34); + output.writeRawVarint32(substringIndexMemoizedSerializedSize); + } + for (int i = 0; i < substringIndex_.size(); i++) { + output.writeInt32NoTag(substringIndex_.get(i)); + } + if (getReplaceCharList().size() > 0) { + output.writeRawVarint32(42); + output.writeRawVarint32(replaceCharMemoizedSerializedSize); + } + for (int i = 0; i < replaceChar_.size(); i++) { + output.writeInt32NoTag(replaceChar_.get(i)); + } + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, range_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, predefinedIndex_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, operation_.getNumber()); + } + { + int dataSize = 0; + for (int i = 0; i < substringIndex_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(substringIndex_.get(i)); + } + size += dataSize; + if (!getSubstringIndexList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + substringIndexMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < replaceChar_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(replaceChar_.get(i)); + } + size += dataSize; + if (!getReplaceCharList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + replaceCharMemoizedSerializedSize = dataSize; + } + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record, Builder> + implements org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.RecordOrBuilder { + // Construct using org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + range_ = 1; + bitField0_ = (bitField0_ & ~0x00000001); + predefinedIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + operation_ = org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.NONE; + bitField0_ = (bitField0_ & ~0x00000004); + substringIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + replaceChar_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record build() { + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record buildPartial() { + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record result = new org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.range_ = range_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.predefinedIndex_ = predefinedIndex_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.operation_ = operation_; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + substringIndex_ = java.util.Collections.unmodifiableList(substringIndex_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.substringIndex_ = substringIndex_; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + replaceChar_ = java.util.Collections.unmodifiableList(replaceChar_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.replaceChar_ = replaceChar_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record other) { + if (other == org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.getDefaultInstance()) return this; + if (other.hasRange()) { + setRange(other.getRange()); + } + if (other.hasPredefinedIndex()) { + setPredefinedIndex(other.getPredefinedIndex()); + } + if (other.hasOperation()) { + setOperation(other.getOperation()); + } + if (!other.substringIndex_.isEmpty()) { + if (substringIndex_.isEmpty()) { + substringIndex_ = other.substringIndex_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSubstringIndexIsMutable(); + substringIndex_.addAll(other.substringIndex_); + } + + } + if (!other.replaceChar_.isEmpty()) { + if (replaceChar_.isEmpty()) { + replaceChar_ = other.replaceChar_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureReplaceCharIsMutable(); + replaceChar_.addAll(other.replaceChar_); + } + + } + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional int32 range = 1 [default = 1]; + private int range_ = 1; + /** + * optional int32 range = 1 [default = 1]; + * + *
+         * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+         * 
+ */ + public boolean hasRange() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 range = 1 [default = 1]; + * + *
+         * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+         * 
+ */ + public int getRange() { + return range_; + } + /** + * optional int32 range = 1 [default = 1]; + * + *
+         * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+         * 
+ */ + public Builder setRange(int value) { + bitField0_ |= 0x00000001; + range_ = value; + + return this; + } + /** + * optional int32 range = 1 [default = 1]; + * + *
+         * The number of times this record should be repeated; this is used to collapse identical subsequent records in the list
+         * 
+ */ + public Builder clearRange() { + bitField0_ = (bitField0_ & ~0x00000001); + range_ = 1; + + return this; + } + + // optional int32 predefined_index = 2; + private int predefinedIndex_ ; + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + public boolean hasPredefinedIndex() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + public int getPredefinedIndex() { + return predefinedIndex_; + } + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + public Builder setPredefinedIndex(int value) { + bitField0_ |= 0x00000002; + predefinedIndex_ = value; + + return this; + } + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + public Builder clearPredefinedIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + predefinedIndex_ = 0; + + return this; + } + + // optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + private org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation operation_ = org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.NONE; + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation getOperation() { + return operation_; + } + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public Builder setOperation(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + operation_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public Builder clearOperation() { + bitField0_ = (bitField0_ & ~0x00000004); + operation_ = org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.NONE; + + return this; + } + + // repeated int32 substring_index = 4 [packed = true]; + private java.util.List substringIndex_ = java.util.Collections.emptyList(); + private void ensureSubstringIndexIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + substringIndex_ = new java.util.ArrayList(substringIndex_); + bitField0_ |= 0x00000008; + } + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public java.util.List + getSubstringIndexList() { + return java.util.Collections.unmodifiableList(substringIndex_); + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public int getSubstringIndexCount() { + return substringIndex_.size(); + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public int getSubstringIndex(int index) { + return substringIndex_.get(index); + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public Builder setSubstringIndex( + int index, int value) { + ensureSubstringIndexIsMutable(); + substringIndex_.set(index, value); + + return this; + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public Builder addSubstringIndex(int value) { + ensureSubstringIndexIsMutable(); + substringIndex_.add(value); + + return this; + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public Builder addAllSubstringIndex( + java.lang.Iterable values) { + ensureSubstringIndexIsMutable(); + super.addAll(values, substringIndex_); + + return this; + } + /** + * repeated int32 substring_index = 4 [packed = true]; + * + *
+         * If this field is present, the "substring" operation must be performed with the first element of this list as the start index,
+         * and the second element as the end index.
+         * If an operation is not NONE, it's applied _after_ this substring operation
+         * 
+ */ + public Builder clearSubstringIndex() { + substringIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + + return this; + } + + // repeated int32 replace_char = 5 [packed = true]; + private java.util.List replaceChar_ = java.util.Collections.emptyList(); + private void ensureReplaceCharIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + replaceChar_ = new java.util.ArrayList(replaceChar_); + bitField0_ |= 0x00000010; + } + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public java.util.List + getReplaceCharList() { + return java.util.Collections.unmodifiableList(replaceChar_); + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public int getReplaceCharCount() { + return replaceChar_.size(); + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public int getReplaceChar(int index) { + return replaceChar_.get(index); + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public Builder setReplaceChar( + int index, int value) { + ensureReplaceCharIsMutable(); + replaceChar_.set(index, value); + + return this; + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public Builder addReplaceChar(int value) { + ensureReplaceCharIsMutable(); + replaceChar_.add(value); + + return this; + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public Builder addAllReplaceChar( + java.lang.Iterable values) { + ensureReplaceCharIsMutable(); + super.addAll(values, replaceChar_); + + return this; + } + /** + * repeated int32 replace_char = 5 [packed = true]; + * + *
+         * If this field is present, the "replaceAll" operation must be performed with the first element of this list as the code point
+         * of the character to replace, and the second element as the code point of the replacement character
+         * 
+ */ + public Builder clearReplaceChar() { + replaceChar_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record) + } + + static { + defaultInstance = new Record(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record) + } + + // repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + public static final int RECORD_FIELD_NUMBER = 1; + private java.util.List record_; + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List getRecordList() { + return record_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List + getRecordOrBuilderList() { + return record_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public int getRecordCount() { + return record_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record getRecord(int index) { + return record_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.RecordOrBuilder getRecordOrBuilder( + int index) { + return record_.get(index); + } + + // repeated int32 local_name = 5 [packed = true]; + public static final int LOCAL_NAME_FIELD_NUMBER = 5; + private java.util.List localName_; + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + public java.util.List + getLocalNameList() { + return localName_; + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + public int getLocalNameCount() { + return localName_.size(); + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+     * Indices of strings which are names of local classes or anonymous objects
+     * 
+ */ + public int getLocalName(int index) { + return localName_.get(index); + } + private int localNameMemoizedSerializedSize = -1; + + private void initFields() { + record_ = java.util.Collections.emptyList(); + localName_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < record_.size(); i++) { + output.writeMessage(1, record_.get(i)); + } + if (getLocalNameList().size() > 0) { + output.writeRawVarint32(42); + output.writeRawVarint32(localNameMemoizedSerializedSize); + } + for (int i = 0; i < localName_.size(); i++) { + output.writeInt32NoTag(localName_.get(i)); + } + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < record_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, record_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < localName_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(localName_.get(i)); + } + size += dataSize; + if (!getLocalNameList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + localNameMemoizedSerializedSize = dataSize; + } + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.jvm.StringTableTypes} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes, Builder> + implements org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypesOrBuilder { + // Construct using org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + record_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + localName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes build() { + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes buildPartial() { + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes result = new org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + record_ = java.util.Collections.unmodifiableList(record_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.record_ = record_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + localName_ = java.util.Collections.unmodifiableList(localName_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.localName_ = localName_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes other) { + if (other == org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.getDefaultInstance()) return this; + if (!other.record_.isEmpty()) { + if (record_.isEmpty()) { + record_ = other.record_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRecordIsMutable(); + record_.addAll(other.record_); + } + + } + if (!other.localName_.isEmpty()) { + if (localName_.isEmpty()) { + localName_ = other.localName_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLocalNameIsMutable(); + localName_.addAll(other.localName_); + } + + } + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + private java.util.List record_ = + java.util.Collections.emptyList(); + private void ensureRecordIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + record_ = new java.util.ArrayList(record_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List getRecordList() { + return java.util.Collections.unmodifiableList(record_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public int getRecordCount() { + return record_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record getRecord(int index) { + return record_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder setRecord( + int index, org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder setRecord( + int index, org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Builder builderForValue) { + ensureRecordIsMutable(); + record_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord(org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + int index, org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Builder builderForValue) { + ensureRecordIsMutable(); + record_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + int index, org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.StringTableTypes.Record.Builder builderForValue) { + ensureRecordIsMutable(); + record_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder addAllRecord( + java.lang.Iterable values) { + ensureRecordIsMutable(); + super.addAll(values, record_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder clearRecord() { + record_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.jvm.StringTableTypes.Record record = 1; + */ + public Builder removeRecord(int index) { + ensureRecordIsMutable(); + record_.remove(index); + + return this; + } + + // repeated int32 local_name = 5 [packed = true]; + private java.util.List localName_ = java.util.Collections.emptyList(); + private void ensureLocalNameIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + localName_ = new java.util.ArrayList(localName_); + bitField0_ |= 0x00000002; + } + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public java.util.List + getLocalNameList() { + return java.util.Collections.unmodifiableList(localName_); + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public int getLocalNameCount() { + return localName_.size(); + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public int getLocalName(int index) { + return localName_.get(index); + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public Builder setLocalName( + int index, int value) { + ensureLocalNameIsMutable(); + localName_.set(index, value); + + return this; + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public Builder addLocalName(int value) { + ensureLocalNameIsMutable(); + localName_.add(value); + + return this; + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public Builder addAllLocalName( + java.lang.Iterable values) { + ensureLocalNameIsMutable(); + super.addAll(values, localName_); + + return this; + } + /** + * repeated int32 local_name = 5 [packed = true]; + * + *
+       * Indices of strings which are names of local classes or anonymous objects
+       * 
+ */ + public Builder clearLocalName() { + localName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes) + } + + static { + defaultInstance = new StringTableTypes(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.jvm.StringTableTypes) + } + public interface JvmMethodSignatureOrBuilder extends com.google.protobuf.MessageLiteOrBuilder { @@ -31,10 +1871,18 @@ public final class JvmProtoBuf { // required int32 desc = 2; /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
*/ boolean hasDesc(); /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
*/ int getDesc(); } @@ -139,12 +1987,20 @@ public final class JvmProtoBuf { private int desc_; /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
*/ public boolean hasDesc() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
*/ public int getDesc() { return desc_; @@ -405,18 +2261,30 @@ public final class JvmProtoBuf { private int desc_ ; /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
*/ public boolean hasDesc() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
*/ public int getDesc() { return desc_; } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
*/ public Builder setDesc(int value) { bitField0_ |= 0x00000002; @@ -426,6 +2294,10 @@ public final class JvmProtoBuf { } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
*/ public Builder clearDesc() { bitField0_ = (bitField0_ & ~0x00000002); @@ -461,10 +2333,18 @@ public final class JvmProtoBuf { // required int32 desc = 2; /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
*/ boolean hasDesc(); /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
*/ int getDesc(); @@ -594,12 +2474,20 @@ public final class JvmProtoBuf { private int desc_; /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
*/ public boolean hasDesc() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
*/ public int getDesc() { return desc_; @@ -903,18 +2791,30 @@ public final class JvmProtoBuf { private int desc_ ; /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
*/ public boolean hasDesc() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
*/ public int getDesc() { return desc_; } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
*/ public Builder setDesc(int value) { bitField0_ |= 0x00000002; @@ -924,6 +2824,10 @@ public final class JvmProtoBuf { } /** * required int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
*/ public Builder clearDesc() { bitField0_ = (bitField0_ & ~0x00000002); diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/serialization/jvm/JvmProtoBufUtil.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/serialization/jvm/JvmProtoBufUtil.kt index 54c626c67be..f62a1bd7065 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/serialization/jvm/JvmProtoBufUtil.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/serialization/jvm/JvmProtoBufUtil.kt @@ -17,10 +17,10 @@ package org.jetbrains.kotlin.serialization.jvm import com.google.protobuf.ExtensionRegistryLite +import org.jetbrains.kotlin.load.kotlin.JvmNameResolver import org.jetbrains.kotlin.serialization.ClassData import org.jetbrains.kotlin.serialization.PackageData import org.jetbrains.kotlin.serialization.ProtoBuf -import org.jetbrains.kotlin.serialization.deserialization.NameResolverImpl import java.io.ByteArrayInputStream public object JvmProtoBufUtil { @@ -37,7 +37,7 @@ public object JvmProtoBufUtil { @JvmStatic public fun readClassDataFrom(bytes: ByteArray, strings: Array): ClassData { val input = ByteArrayInputStream(bytes) - val nameResolver = NameResolverImpl.read(input) + val nameResolver = JvmNameResolver(JvmProtoBuf.StringTableTypes.parseDelimitedFrom(input, EXTENSION_REGISTRY), strings) val classProto = ProtoBuf.Class.parseFrom(input, EXTENSION_REGISTRY) return ClassData(nameResolver, classProto) } @@ -49,7 +49,7 @@ public object JvmProtoBufUtil { @JvmStatic public fun readPackageDataFrom(bytes: ByteArray, strings: Array): PackageData { val input = ByteArrayInputStream(bytes) - val nameResolver = NameResolverImpl.read(input) + val nameResolver = JvmNameResolver(JvmProtoBuf.StringTableTypes.parseDelimitedFrom(input, EXTENSION_REGISTRY), strings) val packageProto = ProtoBuf.Package.parseFrom(input, EXTENSION_REGISTRY) return PackageData(nameResolver, packageProto) } diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/ProtoBuf.java b/core/deserialization/src/org/jetbrains/kotlin/serialization/ProtoBuf.java index 611adab715a..f98e178c727 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/ProtoBuf.java +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/ProtoBuf.java @@ -10043,7 +10043,9 @@ public final class ProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ boolean hasFlags(); @@ -10060,7 +10062,9 @@ public final class ProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ int getFlags(); @@ -11277,7 +11281,9 @@ public final class ProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public boolean hasFlags() { @@ -11296,7 +11302,9 @@ public final class ProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public int getFlags() { @@ -11907,7 +11915,9 @@ public final class ProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public boolean hasFlags() { @@ -11926,7 +11936,9 @@ public final class ProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public int getFlags() { @@ -11945,7 +11957,9 @@ public final class ProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public Builder setFlags(int value) { @@ -11967,7 +11981,9 @@ public final class ProtoBuf { *hasGetter *hasSetter *hasConstant + *isConst *lateinit + *isOperator * */ public Builder clearFlags() { diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/reflectLambda.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/reflectLambda.kt index 6096e238e31..b314226953b 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/reflectLambda.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/reflectLambda.kt @@ -17,11 +17,12 @@ package kotlin.reflect.jvm import org.jetbrains.kotlin.descriptors.FunctionDescriptor +import org.jetbrains.kotlin.load.kotlin.JvmNameResolver import org.jetbrains.kotlin.serialization.ProtoBuf import org.jetbrains.kotlin.serialization.deserialization.DeserializationContext import org.jetbrains.kotlin.serialization.deserialization.MemberDeserializer -import org.jetbrains.kotlin.serialization.deserialization.NameResolverImpl import org.jetbrains.kotlin.serialization.jvm.BitEncoding +import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf import org.jetbrains.kotlin.serialization.jvm.JvmProtoBufUtil import kotlin.jvm.internal.KotlinCallable import kotlin.reflect.KFunction @@ -37,7 +38,10 @@ import kotlin.reflect.jvm.internal.getOrCreateModule public fun Function.reflect(): KFunction? { val callable = javaClass.getAnnotation(KotlinCallable::class.java) ?: return null val input = BitEncoding.decodeBytes(callable.data).inputStream() - val nameResolver = NameResolverImpl.read(input) + val nameResolver = JvmNameResolver( + JvmProtoBuf.StringTableTypes.parseDelimitedFrom(input, JvmProtoBufUtil.EXTENSION_REGISTRY), + callable.strings + ) val proto = ProtoBuf.Callable.parseFrom(input, JvmProtoBufUtil.EXTENSION_REGISTRY) val moduleData = javaClass.getOrCreateModule() val context = DeserializationContext(moduleData.deserialization, nameResolver, moduleData.module, diff --git a/jps-plugin/test/org/jetbrains/kotlin/jps/build/classFilesComparison/classFilesComparison.kt b/jps-plugin/test/org/jetbrains/kotlin/jps/build/classFilesComparison/classFilesComparison.kt index 4155f6742ca..03aacad2200 100644 --- a/jps-plugin/test/org/jetbrains/kotlin/jps/build/classFilesComparison/classFilesComparison.kt +++ b/jps-plugin/test/org/jetbrains/kotlin/jps/build/classFilesComparison/classFilesComparison.kt @@ -16,28 +16,28 @@ package org.jetbrains.kotlin.jps.build.classFilesComparison -import java.io.File -import org.junit.Assert.* -import org.jetbrains.org.objectweb.asm.util.TraceClassVisitor -import java.io.PrintWriter -import org.jetbrains.org.objectweb.asm.ClassReader -import java.io.StringWriter -import org.jetbrains.kotlin.utils.Printer -import com.google.common.io.Files -import com.google.common.hash.Hashing -import com.intellij.openapi.util.io.FileUtil import com.google.common.collect.Sets -import java.util.HashSet -import org.jetbrains.kotlin.serialization.jvm.BitEncoding -import org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf +import com.google.common.hash.Hashing +import com.google.common.io.Files import com.google.protobuf.ExtensionRegistry -import java.io.ByteArrayInputStream -import org.jetbrains.kotlin.serialization.DebugProtoBuf -import java.util.Arrays +import com.intellij.openapi.util.io.FileUtil import org.jetbrains.kotlin.jps.incremental.LocalFileKotlinClass import org.jetbrains.kotlin.load.kotlin.header.isCompatibleClassKind import org.jetbrains.kotlin.load.kotlin.header.isCompatibleFileFacadeKind import org.jetbrains.kotlin.load.kotlin.header.isCompatiblePackageFacadeKind +import org.jetbrains.kotlin.serialization.DebugProtoBuf +import org.jetbrains.kotlin.serialization.jvm.BitEncoding +import org.jetbrains.kotlin.serialization.jvm.DebugJvmProtoBuf +import org.jetbrains.kotlin.utils.Printer +import org.jetbrains.org.objectweb.asm.ClassReader +import org.jetbrains.org.objectweb.asm.util.TraceClassVisitor +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotNull +import java.io.ByteArrayInputStream +import java.io.File +import java.io.PrintWriter +import java.io.StringWriter +import java.util.* // Set this to true if you want to dump all bytecode (test will fail in this case) val DUMP_ALL = System.getProperty("comparison.dump.all") == "true" @@ -139,8 +139,7 @@ fun classFileToString(classFile: File): String { ByteArrayInputStream(BitEncoding.decodeBytes(annotationDataEncoded)).use { input -> - out.write("\n------ simpleNames proto -----\n${DebugProtoBuf.StringTable.parseDelimitedFrom(input)}") - out.write("\n------ qualifiedNames proto -----\n${DebugProtoBuf.QualifiedNameTable.parseDelimitedFrom(input)}") + out.write("\n------ string table types proto -----\n${DebugJvmProtoBuf.StringTableTypes.parseDelimitedFrom(input)}") when { classHeader!!.isCompatiblePackageFacadeKind() ->